| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
PlutusTx.Builtins.Internal
Description
This module contains the special Haskell names that are used to map to builtin types or functions in Plutus Core.
Most users should not use this module directly, but rather use Builtins.
Please note that the documentation for each function will only include operational invariants if there are any. This documentation assumes that the type system correctly enforces and prevents any structural errors on the generated UPLC. See Note [Structural vs operational errors within builtins].
Also note that all builtin functions will fail if the CEK machine exceeds its evaluation budget. Builtin functions with dynamic costing are particularly prone to budget overruns: for example, addInteger and appendByteString differ cost based on input size, so supplying very large integers or byte strings will cause these functions to abort when the budget limit is reached and fail. See Note [Budgeting].
Synopsis
- error :: BuiltinUnit -> a
- ifThenElse :: Bool -> a -> a -> a
- data BuiltinUnit = BuiltinUnit ~()
- unitval :: BuiltinUnit
- chooseUnit :: BuiltinUnit -> a -> a
- type BuiltinInteger = Integer
- addInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- subtractInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- multiplyInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- divideInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- modInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- quotientInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- remainderInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- lessThanInteger :: BuiltinInteger -> BuiltinInteger -> Bool
- lessThanEqualsInteger :: BuiltinInteger -> BuiltinInteger -> Bool
- equalsInteger :: BuiltinInteger -> BuiltinInteger -> Bool
- data BuiltinByteString = BuiltinByteString ~ByteString
- appendByteString :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString
- consByteString :: BuiltinInteger -> BuiltinByteString -> BuiltinByteString
- sliceByteString :: BuiltinInteger -> BuiltinInteger -> BuiltinByteString -> BuiltinByteString
- lengthOfByteString :: BuiltinByteString -> BuiltinInteger
- indexByteString :: BuiltinByteString -> BuiltinInteger -> BuiltinInteger
- emptyByteString :: BuiltinByteString
- sha2_256 :: BuiltinByteString -> BuiltinByteString
- sha3_256 :: BuiltinByteString -> BuiltinByteString
- blake2b_224 :: BuiltinByteString -> BuiltinByteString
- blake2b_256 :: BuiltinByteString -> BuiltinByteString
- keccak_256 :: BuiltinByteString -> BuiltinByteString
- ripemd_160 :: BuiltinByteString -> BuiltinByteString
- verifyEd25519Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> Bool
- verifyEcdsaSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> Bool
- verifySchnorrSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> Bool
- traceAll :: forall a f. Foldable f => f Text -> a -> a
- equalsByteString :: BuiltinByteString -> BuiltinByteString -> Bool
- lessThanByteString :: BuiltinByteString -> BuiltinByteString -> Bool
- lessThanEqualsByteString :: BuiltinByteString -> BuiltinByteString -> Bool
- decodeUtf8 :: BuiltinByteString -> BuiltinString
- data BuiltinString = BuiltinString ~Text
- appendString :: BuiltinString -> BuiltinString -> BuiltinString
- emptyString :: BuiltinString
- equalsString :: BuiltinString -> BuiltinString -> Bool
- trace :: BuiltinString -> a -> a
- encodeUtf8 :: BuiltinString -> BuiltinByteString
- data BuiltinPair a b = BuiltinPair ~(a, b)
- fst :: BuiltinPair a b -> a
- snd :: BuiltinPair a b -> b
- mkPairData :: BuiltinData -> BuiltinData -> BuiltinPair BuiltinData BuiltinData
- data BuiltinList a = BuiltinList ~[a]
- null :: BuiltinList a -> Bool
- head :: BuiltinList a -> a
- tail :: BuiltinList a -> BuiltinList a
- chooseList :: BuiltinList a -> b -> b -> b
- caseList' :: forall a r. r -> (a -> BuiltinList a -> r) -> BuiltinList a -> r
- unsafeCaseList :: (a -> BuiltinList a -> r) -> BuiltinList a -> r
- drop :: Integer -> BuiltinList a -> BuiltinList a
- mkNilData :: BuiltinUnit -> BuiltinList BuiltinData
- mkNilPairData :: BuiltinUnit -> BuiltinList (BuiltinPair BuiltinData BuiltinData)
- mkCons :: a -> BuiltinList a -> BuiltinList a
- data BuiltinData = BuiltinData ~Data
- builtinDataToData :: BuiltinData -> Data
- dataToBuiltinData :: Data -> BuiltinData
- chooseData :: BuiltinData -> a -> a -> a -> a -> a -> a
- mkConstr :: BuiltinInteger -> BuiltinList BuiltinData -> BuiltinData
- mkMap :: BuiltinList (BuiltinPair BuiltinData BuiltinData) -> BuiltinData
- mkList :: BuiltinList BuiltinData -> BuiltinData
- mkI :: BuiltinInteger -> BuiltinData
- mkB :: BuiltinByteString -> BuiltinData
- unsafeDataAsConstr :: BuiltinData -> BuiltinPair BuiltinInteger (BuiltinList BuiltinData)
- unsafeDataAsMap :: BuiltinData -> BuiltinList (BuiltinPair BuiltinData BuiltinData)
- unsafeDataAsList :: BuiltinData -> BuiltinList BuiltinData
- unsafeDataAsI :: BuiltinData -> BuiltinInteger
- unsafeDataAsB :: BuiltinData -> BuiltinByteString
- equalsData :: BuiltinData -> BuiltinData -> Bool
- serialiseData :: BuiltinData -> BuiltinByteString
- data BuiltinValue = BuiltinValue ~Value
- data BuiltinArray a = BuiltinArray ~(Vector a)
- lengthOfArray :: BuiltinArray a -> BuiltinInteger
- listToArray :: BuiltinList a -> BuiltinArray a
- indexArray :: BuiltinArray a -> BuiltinInteger -> a
- data BuiltinBLS12_381_G1_Element = BuiltinBLS12_381_G1_Element ~Element
- bls12_381_G1_equals :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> Bool
- bls12_381_G1_add :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element
- bls12_381_G1_neg :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element
- bls12_381_G1_scalarMul :: BuiltinInteger -> BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element
- bls12_381_G1_multiScalarMul :: BuiltinList BuiltinInteger -> BuiltinList BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element
- bls12_381_G1_compress :: BuiltinBLS12_381_G1_Element -> BuiltinByteString
- bls12_381_G1_uncompress :: BuiltinByteString -> BuiltinBLS12_381_G1_Element
- bls12_381_G1_hashToGroup :: BuiltinByteString -> BuiltinByteString -> BuiltinBLS12_381_G1_Element
- bls12_381_G1_compressed_zero :: BuiltinByteString
- bls12_381_G1_compressed_generator :: BuiltinByteString
- data BuiltinBLS12_381_G2_Element = BuiltinBLS12_381_G2_Element ~Element
- bls12_381_G2_equals :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> Bool
- bls12_381_G2_add :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element
- bls12_381_G2_neg :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element
- bls12_381_G2_scalarMul :: BuiltinInteger -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element
- bls12_381_G2_multiScalarMul :: BuiltinList BuiltinInteger -> BuiltinList BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element
- bls12_381_G2_compress :: BuiltinBLS12_381_G2_Element -> BuiltinByteString
- bls12_381_G2_uncompress :: BuiltinByteString -> BuiltinBLS12_381_G2_Element
- bls12_381_G2_hashToGroup :: BuiltinByteString -> BuiltinByteString -> BuiltinBLS12_381_G2_Element
- bls12_381_G2_compressed_zero :: BuiltinByteString
- bls12_381_G2_compressed_generator :: BuiltinByteString
- data BuiltinBLS12_381_MlResult = BuiltinBLS12_381_MlResult ~MlResult
- bls12_381_millerLoop :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_MlResult
- bls12_381_mulMlResult :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult
- bls12_381_finalVerify :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult -> Bool
- integerToByteString :: Bool -> BuiltinInteger -> BuiltinInteger -> BuiltinByteString
- byteStringToInteger :: Bool -> BuiltinByteString -> BuiltinInteger
- shiftByteString :: BuiltinByteString -> BuiltinInteger -> BuiltinByteString
- rotateByteString :: BuiltinByteString -> BuiltinInteger -> BuiltinByteString
- countSetBits :: BuiltinByteString -> BuiltinInteger
- findFirstSetBit :: BuiltinByteString -> BuiltinInteger
- andByteString :: Bool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString
- orByteString :: Bool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString
- xorByteString :: Bool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString
- complementByteString :: BuiltinByteString -> BuiltinByteString
- readBit :: BuiltinByteString -> BuiltinInteger -> Bool
- writeBits :: BuiltinByteString -> BuiltinList BuiltinInteger -> Bool -> BuiltinByteString
- replicateByte :: BuiltinInteger -> BuiltinInteger -> BuiltinByteString
- expModInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger -> BuiltinInteger
- insertCoin :: BuiltinByteString -> BuiltinByteString -> BuiltinInteger -> BuiltinValue -> BuiltinValue
- lookupCoin :: BuiltinByteString -> BuiltinByteString -> BuiltinValue -> Integer
- unionValue :: BuiltinValue -> BuiltinValue -> BuiltinValue
- valueContains :: BuiltinValue -> BuiltinValue -> Bool
- mkValue :: BuiltinValue -> BuiltinData
- unsafeDataAsValue :: BuiltinData -> BuiltinValue
- scaleValue :: Integer -> BuiltinValue -> BuiltinValue
- caseInteger :: Integer -> [a] -> a
- casePair :: BuiltinPair a b -> (a -> b -> r) -> r
Documentation
error :: BuiltinUnit -> a Source #
ifThenElse :: Bool -> a -> a -> a Source #
data BuiltinUnit Source #
Constructors
| BuiltinUnit ~() |
Instances
unitval :: BuiltinUnit Source #
Unit
chooseUnit :: BuiltinUnit -> a -> a Source #
type BuiltinInteger = Integer Source #
addInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger Source #
Adds two integers and never fails.
subtractInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger Source #
Subtracts two integers and never fails.
multiplyInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger Source #
Multiplies two integers and never fails.
divideInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger Source #
Finds the quotient of two integers and fails when the second argument, the divisor, is zero.
See Note [Integer division operations] for explanation on divideInteger, modInteger,
quotientInteger, and remainderInteger.
modInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger Source #
Finds the remainder of two integers and fails when the second argument, the divisor, is zero.
quotientInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger Source #
Finds the quotient of two integers and fails when the second argument, the divisor, is zero.
remainderInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger Source #
Finds the remainder of two integers and fails when the second argument, the divisor, is zero.
lessThanInteger :: BuiltinInteger -> BuiltinInteger -> Bool Source #
Compares two integers and returns true when the first argument is less than the second | argument.
lessThanEqualsInteger :: BuiltinInteger -> BuiltinInteger -> Bool Source #
Compares two integers and returns true when the first argument is less or equal to than the | second argument.
equalsInteger :: BuiltinInteger -> BuiltinInteger -> Bool Source #
Checks equality of two integers and never fails.
data BuiltinByteString Source #
An opaque type representing Plutus Core ByteStrings.
Constructors
| BuiltinByteString ~ByteString |
Instances
| Data BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuiltinByteString -> c BuiltinByteString Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BuiltinByteString Source # toConstr :: BuiltinByteString -> Constr Source # dataTypeOf :: BuiltinByteString -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BuiltinByteString) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BuiltinByteString) Source # gmapT :: (forall b. Data b => b -> b) -> BuiltinByteString -> BuiltinByteString Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinByteString -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinByteString -> r Source # gmapQ :: (forall d. Data d => d -> u) -> BuiltinByteString -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinByteString -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinByteString -> m BuiltinByteString Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinByteString -> m BuiltinByteString Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinByteString -> m BuiltinByteString Source # | |||||
| IsString BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods fromString :: String -> BuiltinByteString Source # | |||||
| Monoid BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods mempty :: BuiltinByteString Source # mappend :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source # mconcat :: [BuiltinByteString] -> BuiltinByteString Source # | |||||
| Semigroup BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (<>) :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source # sconcat :: NonEmpty BuiltinByteString -> BuiltinByteString Source # stimes :: Integral b => b -> BuiltinByteString -> BuiltinByteString Source # | |||||
| Show BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| NFData BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods rnf :: BuiltinByteString -> () Source # | |||||
| Eq BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (==) :: BuiltinByteString -> BuiltinByteString -> Bool Source # (/=) :: BuiltinByteString -> BuiltinByteString -> Bool Source # | |||||
| Ord BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods compare :: BuiltinByteString -> BuiltinByteString -> Ordering Source # (<) :: BuiltinByteString -> BuiltinByteString -> Bool Source # (<=) :: BuiltinByteString -> BuiltinByteString -> Bool Source # (>) :: BuiltinByteString -> BuiltinByteString -> Bool Source # (>=) :: BuiltinByteString -> BuiltinByteString -> Bool Source # max :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source # min :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source # | |||||
| Hashable BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| ByteArray BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| ByteArrayAccess BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods length :: BuiltinByteString -> Int withByteArray :: BuiltinByteString -> (Ptr p -> IO a) -> IO a copyByteArrayToPtr :: BuiltinByteString -> Ptr p -> IO () | |||||
| HasBlueprintDefinition BuiltinByteString Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll Associated Types
Methods | |||||
| HasFromBuiltin BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
Methods fromBuiltin :: BuiltinByteString -> FromBuiltin BuiltinByteString Source # | |||||
| MkNil BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||
| Eq BuiltinByteString Source # | |||||
Defined in PlutusTx.Eq.Class Methods (==) :: BuiltinByteString -> BuiltinByteString -> Bool Source # | |||||
| FromData BuiltinByteString Source # | |||||
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinByteString Source # | |||||
| ToData BuiltinByteString Source # | |||||
Defined in PlutusTx.IsData.Class Methods | |||||
| UnsafeFromData BuiltinByteString Source # | |||||
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinByteString Source # | |||||
| Monoid BuiltinByteString Source # | |||||
Defined in PlutusTx.Monoid Methods | |||||
| Ord BuiltinByteString Source # | |||||
Defined in PlutusTx.Ord.Class Methods compare :: BuiltinByteString -> BuiltinByteString -> Ordering Source # (<) :: BuiltinByteString -> BuiltinByteString -> Bool Source # (<=) :: BuiltinByteString -> BuiltinByteString -> Bool Source # (>) :: BuiltinByteString -> BuiltinByteString -> Bool Source # (>=) :: BuiltinByteString -> BuiltinByteString -> Bool Source # max :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source # min :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source # | |||||
| Semigroup BuiltinByteString Source # | |||||
Defined in PlutusTx.Semigroup Methods (<>) :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source # | |||||
| Show BuiltinByteString Source # | |||||
Defined in PlutusTx.Show | |||||
| Pretty BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| Serialise BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods encode :: BuiltinByteString -> Encoding decode :: Decoder s BuiltinByteString encodeList :: [BuiltinByteString] -> Encoding decodeList :: Decoder s [BuiltinByteString] | |||||
| HasBlueprintSchema BuiltinByteString referencedTypes Source # | |||||
Defined in PlutusTx.Blueprint.Class | |||||
| HasFromOpaque BuiltinByteString BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods fromOpaque :: BuiltinByteString -> BuiltinByteString Source # | |||||
| HasToOpaque BuiltinByteString BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||
| HasTermLevel uni ByteString => Lift uni BuiltinByteString Source # | |||||
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinByteString -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |||||
| HasTypeLevel uni ByteString => Typeable uni BuiltinByteString Source # | |||||
Defined in PlutusTx.Lift.Class | |||||
| type Unroll BuiltinByteString Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll | |||||
| type FromBuiltin BuiltinByteString Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
appendByteString :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source #
Appends a bytestring to another and never fails.
consByteString :: BuiltinInteger -> BuiltinByteString -> BuiltinByteString Source #
Appends a byte to the given bytestring.
The semantics of this function differ based on [Builtin semantics variants].
- For builtin semantics variant A and B, that is for PlutusV1 and PlutusV2, this reduces the first argument
modulo 256 and will never fail.
- For builtin semantics variant C, that is for PlutusV3, this will expect first argument to be in range
[0..255] and fail otherwise.
sliceByteString :: BuiltinInteger -> BuiltinInteger -> BuiltinByteString -> BuiltinByteString Source #
Slices the given bytestring and never fails. The first integer marks the beginning index and the second marks the end. Indices are expected to be 0-indexed, and when the first integer is greater than the second, it returns an empty bytestring.
lengthOfByteString :: BuiltinByteString -> BuiltinInteger Source #
Returns the length of the provided bytestring.
indexByteString :: BuiltinByteString -> BuiltinInteger -> BuiltinInteger Source #
Returns the n-th byte from the bytestring. Fails if the given index is not in the range [0..j),
where j is the length of the bytestring.
emptyByteString :: BuiltinByteString Source #
An empty bytestring.
sha2_256 :: BuiltinByteString -> BuiltinByteString Source #
Computes the SHA2-256 hash of the given bytestring.
sha3_256 :: BuiltinByteString -> BuiltinByteString Source #
Computes the SHA3-256 hash of the given bytestring.
blake2b_224 :: BuiltinByteString -> BuiltinByteString Source #
Computes the Blake2b-224 hash of the given bytestring.
blake2b_256 :: BuiltinByteString -> BuiltinByteString Source #
Computes the Blake2b-256 hash of the given bytestring.
keccak_256 :: BuiltinByteString -> BuiltinByteString Source #
Computes the Keccak-256 hash of the given bytestring.
ripemd_160 :: BuiltinByteString -> BuiltinByteString Source #
Computes the RIPEMD-160 hash of the given bytestring.
verifyEd25519Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> Bool Source #
Ed25519 signature verification. The first bytestring is the public key (32 bytes), followed by an arbitrary-size message and the signature (64 bytes). The sizes of the public key and signature are enforced, and it fails when given bytestrings of incorrect size.
verifyEcdsaSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> Bool Source #
ECDSA signature verification on the SECP256k1 curve. The first bytestring is the public key (33 bytes), followed by the message hash (32 bytes) and the signature (64 bytes). The sizes of the public key and signature are enforced, and it fails when given bytestrings of incorrect size.
verifySchnorrSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> Bool Source #
Schnorr signature verification on the SECP256k1 curve. The first bytestring is the public key (32 bytes), followed by an arbitrary-length message and the signature (64 bytes). The sizes of the public key and signature are enforced, and it fails when given bytestrings of incorrect size.
traceAll :: forall a f. Foldable f => f Text -> a -> a Source #
Runs trace for each element in a foldable structure.
equalsByteString :: BuiltinByteString -> BuiltinByteString -> Bool Source #
Checks the equality of two bytestrings and never fails
lessThanEqualsByteString :: BuiltinByteString -> BuiltinByteString -> Bool Source #
Checks if the first bytestring is less than or equal to the second bytestring and never fails.
decodeUtf8 :: BuiltinByteString -> BuiltinString Source #
Decodes the given bytestring to a string and fails when the given bytestring is not a valid UTF-8 bytestring.
data BuiltinString Source #
Constructors
| BuiltinString ~Text |
Instances
| Data BuiltinString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuiltinString -> c BuiltinString Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BuiltinString Source # toConstr :: BuiltinString -> Constr Source # dataTypeOf :: BuiltinString -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BuiltinString) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BuiltinString) Source # gmapT :: (forall b. Data b => b -> b) -> BuiltinString -> BuiltinString Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinString -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinString -> r Source # gmapQ :: (forall d. Data d => d -> u) -> BuiltinString -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinString -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinString -> m BuiltinString Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinString -> m BuiltinString Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinString -> m BuiltinString Source # | |||||
| IsString BuiltinString Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods fromString :: String -> BuiltinString Source # | |||||
| Show BuiltinString Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| Eq BuiltinString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (==) :: BuiltinString -> BuiltinString -> Bool Source # (/=) :: BuiltinString -> BuiltinString -> Bool Source # | |||||
| Ord BuiltinString Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods compare :: BuiltinString -> BuiltinString -> Ordering Source # (<) :: BuiltinString -> BuiltinString -> Bool Source # (<=) :: BuiltinString -> BuiltinString -> Bool Source # (>) :: BuiltinString -> BuiltinString -> Bool Source # (>=) :: BuiltinString -> BuiltinString -> Bool Source # max :: BuiltinString -> BuiltinString -> BuiltinString Source # min :: BuiltinString -> BuiltinString -> BuiltinString Source # | |||||
| HasBlueprintDefinition BuiltinString Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll Associated Types
Methods | |||||
| HasFromBuiltin BuiltinString Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
Methods fromBuiltin :: BuiltinString -> FromBuiltin BuiltinString Source # | |||||
| Eq BuiltinString Source # | |||||
Defined in PlutusTx.Eq.Class Methods (==) :: BuiltinString -> BuiltinString -> Bool Source # | |||||
| Monoid BuiltinString Source # | |||||
Defined in PlutusTx.Monoid Methods | |||||
| Semigroup BuiltinString Source # | |||||
Defined in PlutusTx.Semigroup Methods (<>) :: BuiltinString -> BuiltinString -> BuiltinString Source # | |||||
| Show BuiltinString Source # | |||||
Defined in PlutusTx.Show Methods showsPrec :: Integer -> BuiltinString -> ShowS Source # show :: BuiltinString -> BuiltinString Source # | |||||
| HasBlueprintSchema BuiltinString referencedTypes Source # | |||||
Defined in PlutusTx.Blueprint.Class | |||||
| HasFromOpaque BuiltinString BuiltinString Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||
| HasToOpaque BuiltinString BuiltinString Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||
| HasTermLevel uni Text => Lift uni BuiltinString Source # | |||||
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinString -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |||||
| HasTypeLevel uni Text => Typeable uni BuiltinString Source # | |||||
Defined in PlutusTx.Lift.Class | |||||
| type Unroll BuiltinString Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll | |||||
| type FromBuiltin BuiltinString Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
appendString :: BuiltinString -> BuiltinString -> BuiltinString Source #
Appends a string to another and never fails.
emptyString :: BuiltinString Source #
An empty string.
equalsString :: BuiltinString -> BuiltinString -> Bool Source #
Checks the equality of two strings and never fails.
trace :: BuiltinString -> a -> a Source #
Emits a trace message and never fails.
encodeUtf8 :: BuiltinString -> BuiltinByteString Source #
Encodes a string into a bytestring and never fails.
data BuiltinPair a b Source #
Constructors
| BuiltinPair ~(a, b) |
Instances
| (HasFromBuiltin arep, HasFromBuiltin brep, HasTermLevel uni (FromBuiltin arep, FromBuiltin brep)) => Lift uni (BuiltinPair arep brep) Source # | |||||
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinPair arep brep -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |||||
| (Data a, Data b) => Data (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> BuiltinPair a b -> c (BuiltinPair a b) Source # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (BuiltinPair a b) Source # toConstr :: BuiltinPair a b -> Constr Source # dataTypeOf :: BuiltinPair a b -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (BuiltinPair a b)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (BuiltinPair a b)) Source # gmapT :: (forall b0. Data b0 => b0 -> b0) -> BuiltinPair a b -> BuiltinPair a b Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinPair a b -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinPair a b -> r Source # gmapQ :: (forall d. Data d => d -> u) -> BuiltinPair a b -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinPair a b -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinPair a b -> m (BuiltinPair a b) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinPair a b -> m (BuiltinPair a b) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinPair a b -> m (BuiltinPair a b) Source # | |||||
| (Show a, Show b) => Show (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| (Eq a, Eq b) => Eq (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (==) :: BuiltinPair a b -> BuiltinPair a b -> Bool Source # (/=) :: BuiltinPair a b -> BuiltinPair a b -> Bool Source # | |||||
| (Ord a, Ord b) => Ord (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods compare :: BuiltinPair a b -> BuiltinPair a b -> Ordering Source # (<) :: BuiltinPair a b -> BuiltinPair a b -> Bool Source # (<=) :: BuiltinPair a b -> BuiltinPair a b -> Bool Source # (>) :: BuiltinPair a b -> BuiltinPair a b -> Bool Source # (>=) :: BuiltinPair a b -> BuiltinPair a b -> Bool Source # max :: BuiltinPair a b -> BuiltinPair a b -> BuiltinPair a b Source # min :: BuiltinPair a b -> BuiltinPair a b -> BuiltinPair a b Source # | |||||
| (HasBlueprintDefinition a, HasBlueprintDefinition b) => HasBlueprintDefinition (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll Associated Types
Methods | |||||
| (HasFromBuiltin a, HasFromBuiltin b) => HasFromBuiltin (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
Methods fromBuiltin :: BuiltinPair a b -> FromBuiltin (BuiltinPair a b) Source # | |||||
| (MkNil a, MkNil b) => MkNil (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods mkNil :: BuiltinList (BuiltinPair a b) Source # | |||||
| (HasBlueprintSchema a referencedTypes, HasBlueprintSchema b referencedTypes) => HasBlueprintSchema (BuiltinPair a b) referencedTypes Source # | |||||
Defined in PlutusTx.Blueprint.Class | |||||
| HasTypeLevel uni (,) => Typeable uni BuiltinPair Source # | |||||
Defined in PlutusTx.Lift.Class | |||||
| (HasFromOpaque arep a, HasFromOpaque brep b) => HasFromOpaque (BuiltinPair arep brep) (a, b) Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods fromOpaque :: BuiltinPair arep brep -> (a, b) Source # | |||||
| HasToOpaque (BuiltinData, BuiltinData) (BuiltinPair BuiltinData BuiltinData) Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods toOpaque :: (BuiltinData, BuiltinData) -> BuiltinPair BuiltinData BuiltinData Source # | |||||
| type Unroll (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll | |||||
| type FromBuiltin (BuiltinPair a b) Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
fst :: BuiltinPair a b -> a Source #
Takes first value from the tuple and never fails.
snd :: BuiltinPair a b -> b Source #
Takes second value from the tuple and never fails.
mkPairData :: BuiltinData -> BuiltinData -> BuiltinPair BuiltinData BuiltinData Source #
Constructs tuple from two builtin data.
data BuiltinList a Source #
Constructors
| BuiltinList ~[a] |
Instances
| (HasFromBuiltin arep, HasTermLevel uni [FromBuiltin arep]) => Lift uni (BuiltinList arep) Source # | |||||
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinList arep -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |||||
| Data a => Data (BuiltinList a) Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuiltinList a -> c (BuiltinList a) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (BuiltinList a) Source # toConstr :: BuiltinList a -> Constr Source # dataTypeOf :: BuiltinList a -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (BuiltinList a)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (BuiltinList a)) Source # gmapT :: (forall b. Data b => b -> b) -> BuiltinList a -> BuiltinList a Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinList a -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinList a -> r Source # gmapQ :: (forall d. Data d => d -> u) -> BuiltinList a -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinList a -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinList a -> m (BuiltinList a) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinList a -> m (BuiltinList a) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinList a -> m (BuiltinList a) Source # | |||||
| Show a => Show (BuiltinList a) Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| Eq a => Eq (BuiltinList a) Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (==) :: BuiltinList a -> BuiltinList a -> Bool Source # (/=) :: BuiltinList a -> BuiltinList a -> Bool Source # | |||||
| Ord a => Ord (BuiltinList a) Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods compare :: BuiltinList a -> BuiltinList a -> Ordering Source # (<) :: BuiltinList a -> BuiltinList a -> Bool Source # (<=) :: BuiltinList a -> BuiltinList a -> Bool Source # (>) :: BuiltinList a -> BuiltinList a -> Bool Source # (>=) :: BuiltinList a -> BuiltinList a -> Bool Source # max :: BuiltinList a -> BuiltinList a -> BuiltinList a Source # min :: BuiltinList a -> BuiltinList a -> BuiltinList a Source # | |||||
| HasBlueprintDefinition a => HasBlueprintDefinition (BuiltinList a) Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll Associated Types
Methods | |||||
| HasFromBuiltin a => HasFromBuiltin (BuiltinList a) Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
Methods fromBuiltin :: BuiltinList a -> FromBuiltin (BuiltinList a) Source # | |||||
| MkNil a => MkNil (BuiltinList a) Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods mkNil :: BuiltinList (BuiltinList a) Source # | |||||
| HasBlueprintSchema a referencedTypes => HasBlueprintSchema (BuiltinList a) referencedTypes Source # | |||||
Defined in PlutusTx.Blueprint.Class | |||||
| HasFromOpaque arep a => HasFromOpaque (BuiltinList arep) [a] Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods fromOpaque :: BuiltinList arep -> [a] Source # | |||||
| (HasToOpaque a arep, MkNil arep) => HasToOpaque [a] (BuiltinList arep) Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods toOpaque :: [a] -> BuiltinList arep Source # | |||||
| HasTypeLevel uni [] => Typeable uni BuiltinList Source # | |||||
Defined in PlutusTx.Lift.Class | |||||
| type Unroll (BuiltinList a) Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll | |||||
| type FromBuiltin (BuiltinList a) Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
null :: BuiltinList a -> Bool Source #
Checks if the given list is empty.
head :: BuiltinList a -> a Source #
Takes the first element of the list and fails if given list is empty.
tail :: BuiltinList a -> BuiltinList a Source #
Takes the last element of the list and fails if given list is empty.
chooseList :: BuiltinList a -> b -> b -> b Source #
Branches out depending on the structure of given list and never fails. If given list is empty, it will take the first branch and if not it will take the second branch.
caseList' :: forall a r. r -> (a -> BuiltinList a -> r) -> BuiltinList a -> r Source #
Similar to chooseList but deconstructs the list in case provided list is not empty.
unsafeCaseList :: (a -> BuiltinList a -> r) -> BuiltinList a -> r Source #
Similar to caseList', but empty list case is omitted so passing empty list will raise error
drop :: Integer -> BuiltinList a -> BuiltinList a Source #
Drops first n elements from the given list and never fails.
mkNilData :: BuiltinUnit -> BuiltinList BuiltinData Source #
Creates an empty data list and never fails. Prefer using constant. See Note [Constants vs built-in functions]
mkNilPairData :: BuiltinUnit -> BuiltinList (BuiltinPair BuiltinData BuiltinData) Source #
Creates an empty data pair list and never fails. Prefer using constant. See Note [Constants vs built-in functions]
mkCons :: a -> BuiltinList a -> BuiltinList a Source #
Appends a new element to the given list and never fails.
data BuiltinData Source #
A type corresponding to the Plutus Core builtin equivalent of Data.
The point of this type is to be an opaque equivalent of Data, so as to
ensure that it is only used in ways that the compiler can handle.
As such, you should use this type in your on-chain code, and in any data structures that you want to be representable on-chain.
For off-chain usage, there are conversion functions builtinDataToData and
dataToBuiltinData, but note that these will not work on-chain.
Constructors
| BuiltinData ~Data |
Instances
| Data BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuiltinData -> c BuiltinData Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BuiltinData Source # toConstr :: BuiltinData -> Constr Source # dataTypeOf :: BuiltinData -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BuiltinData) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BuiltinData) Source # gmapT :: (forall b. Data b => b -> b) -> BuiltinData -> BuiltinData Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinData -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinData -> r Source # gmapQ :: (forall d. Data d => d -> u) -> BuiltinData -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinData -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinData -> m BuiltinData Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinData -> m BuiltinData Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinData -> m BuiltinData Source # | |||||
| Generic BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.Internal Associated Types
Methods from :: BuiltinData -> Rep BuiltinData x Source # to :: Rep BuiltinData x -> BuiltinData Source # | |||||
| Show BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| NFData BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods rnf :: BuiltinData -> () Source # | |||||
| Eq BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (==) :: BuiltinData -> BuiltinData -> Bool Source # (/=) :: BuiltinData -> BuiltinData -> Bool Source # | |||||
| Ord BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods compare :: BuiltinData -> BuiltinData -> Ordering Source # (<) :: BuiltinData -> BuiltinData -> Bool Source # (<=) :: BuiltinData -> BuiltinData -> Bool Source # (>) :: BuiltinData -> BuiltinData -> Bool Source # (>=) :: BuiltinData -> BuiltinData -> Bool Source # max :: BuiltinData -> BuiltinData -> BuiltinData Source # min :: BuiltinData -> BuiltinData -> BuiltinData Source # | |||||
| HasBlueprintDefinition BuiltinData Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll Associated Types
Methods | |||||
| HasFromBuiltin BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
Methods fromBuiltin :: BuiltinData -> FromBuiltin BuiltinData Source # | |||||
| MkNil BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||
| Eq BuiltinData Source # | |||||
Defined in PlutusTx.Eq.Class Methods (==) :: BuiltinData -> BuiltinData -> Bool Source # | |||||
| FromData BuiltinData Source # | |||||
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinData Source # | |||||
| ToData BuiltinData Source # | |||||
Defined in PlutusTx.IsData.Class Methods | |||||
| UnsafeFromData BuiltinData Source # | |||||
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinData Source # | |||||
| Show BuiltinData Source # | |||||
Defined in PlutusTx.Show Methods showsPrec :: Integer -> BuiltinData -> ShowS Source # show :: BuiltinData -> BuiltinString Source # | |||||
| Pretty BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| HasBlueprintSchema BuiltinData referencedTypes Source # | |||||
Defined in PlutusTx.Blueprint.Class | |||||
| HasFromOpaque BuiltinData BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods fromOpaque :: BuiltinData -> BuiltinData Source # | |||||
| HasToOpaque BuiltinData BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods toOpaque :: BuiltinData -> BuiltinData Source # | |||||
| HasTermLevel uni Data => Lift uni BuiltinData Source # | |||||
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinData -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |||||
| HasTypeLevel uni Data => Typeable uni BuiltinData Source # | |||||
Defined in PlutusTx.Lift.Class | |||||
| HasToOpaque (BuiltinData, BuiltinData) (BuiltinPair BuiltinData BuiltinData) Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods toOpaque :: (BuiltinData, BuiltinData) -> BuiltinPair BuiltinData BuiltinData Source # | |||||
| type Rep BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.Internal type Rep BuiltinData = D1 ('MetaData "BuiltinData" "PlutusTx.Builtins.Internal" "plutus-tx-1.60.0.0-2VI8qZOpowK2Zo3DTnqORk" 'False) (C1 ('MetaCons "BuiltinData" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceLazy 'DecidedLazy) (Rec0 Data))) | |||||
| type Unroll BuiltinData Source # | |||||
Defined in PlutusTx.Blueprint.Definition.Unroll | |||||
| type FromBuiltin BuiltinData Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
builtinDataToData :: BuiltinData -> Data Source #
NOT a builtin. Converts a BuiltinData into a Data. Only works off-chain.
dataToBuiltinData :: Data -> BuiltinData Source #
NOT a builtin. Converts a Data into a BuiltinData. Only works off-chain.
chooseData :: BuiltinData -> a -> a -> a -> a -> a -> a Source #
Branches out depending on the structure of given data and never fails.
mkConstr :: BuiltinInteger -> BuiltinList BuiltinData -> BuiltinData Source #
Creates Constr data value with the given index and elements; never fails.
mkMap :: BuiltinList (BuiltinPair BuiltinData BuiltinData) -> BuiltinData Source #
Creates Map data value with the given list of pairs and never fails.
mkList :: BuiltinList BuiltinData -> BuiltinData Source #
Creates List data value with the given list and never fails.
mkI :: BuiltinInteger -> BuiltinData Source #
Creates I data value with the given integer and never fails.
mkB :: BuiltinByteString -> BuiltinData Source #
Creates B data value with the given bytestring and never fails.
unsafeDataAsConstr :: BuiltinData -> BuiltinPair BuiltinInteger (BuiltinList BuiltinData) Source #
Deconstructs the given data as a Constr, failing if it is not a Constr.
unsafeDataAsMap :: BuiltinData -> BuiltinList (BuiltinPair BuiltinData BuiltinData) Source #
Deconstructs the given data as a Map, failing if it is not a Map.
unsafeDataAsList :: BuiltinData -> BuiltinList BuiltinData Source #
Deconstructs the given data as a List, failing if it is not a List.
unsafeDataAsI :: BuiltinData -> BuiltinInteger Source #
Deconstructs the given data as a I, failing if it is not a I.
unsafeDataAsB :: BuiltinData -> BuiltinByteString Source #
Deconstructs the given data as a B, failing if it is not a B.
equalsData :: BuiltinData -> BuiltinData -> Bool Source #
Checks equality of two data and never fails.
data BuiltinValue Source #
Constructors
| BuiltinValue ~Value |
Instances
| Generic BuiltinValue Source # | |||||
Defined in PlutusTx.Builtins.Internal Associated Types
Methods from :: BuiltinValue -> Rep BuiltinValue x Source # to :: Rep BuiltinValue x -> BuiltinValue Source # | |||||
| HasFromBuiltin BuiltinValue Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
Methods fromBuiltin :: BuiltinValue -> FromBuiltin BuiltinValue Source # | |||||
| MkNil BuiltinValue Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||
| HasFromOpaque BuiltinValue BuiltinValue Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||
| HasToOpaque BuiltinValue BuiltinValue Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods toOpaque :: BuiltinValue -> BuiltinValue Source # | |||||
| HasTermLevel uni Value => Lift uni BuiltinValue Source # | |||||
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinValue -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |||||
| HasTypeLevel uni Value => Typeable uni BuiltinValue Source # | |||||
Defined in PlutusTx.Lift.Class | |||||
| type Rep BuiltinValue Source # | |||||
Defined in PlutusTx.Builtins.Internal type Rep BuiltinValue = D1 ('MetaData "BuiltinValue" "PlutusTx.Builtins.Internal" "plutus-tx-1.60.0.0-2VI8qZOpowK2Zo3DTnqORk" 'False) (C1 ('MetaCons "BuiltinValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceLazy 'DecidedLazy) (Rec0 Value))) | |||||
| type FromBuiltin BuiltinValue Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
data BuiltinArray a Source #
Constructors
| BuiltinArray ~(Vector a) |
Instances
| (HasFromBuiltin arep, HasTermLevel uni (Vector (FromBuiltin arep))) => Lift uni (BuiltinArray arep) Source # | |||||
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinArray arep -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |||||
| Data a => Data (BuiltinArray a) Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuiltinArray a -> c (BuiltinArray a) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (BuiltinArray a) Source # toConstr :: BuiltinArray a -> Constr Source # dataTypeOf :: BuiltinArray a -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (BuiltinArray a)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (BuiltinArray a)) Source # gmapT :: (forall b. Data b => b -> b) -> BuiltinArray a -> BuiltinArray a Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinArray a -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinArray a -> r Source # gmapQ :: (forall d. Data d => d -> u) -> BuiltinArray a -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinArray a -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinArray a -> m (BuiltinArray a) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinArray a -> m (BuiltinArray a) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinArray a -> m (BuiltinArray a) Source # | |||||
| Show a => Show (BuiltinArray a) Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| Eq a => Eq (BuiltinArray a) Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (==) :: BuiltinArray a -> BuiltinArray a -> Bool Source # (/=) :: BuiltinArray a -> BuiltinArray a -> Bool Source # | |||||
| Ord a => Ord (BuiltinArray a) Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods compare :: BuiltinArray a -> BuiltinArray a -> Ordering Source # (<) :: BuiltinArray a -> BuiltinArray a -> Bool Source # (<=) :: BuiltinArray a -> BuiltinArray a -> Bool Source # (>) :: BuiltinArray a -> BuiltinArray a -> Bool Source # (>=) :: BuiltinArray a -> BuiltinArray a -> Bool Source # max :: BuiltinArray a -> BuiltinArray a -> BuiltinArray a Source # min :: BuiltinArray a -> BuiltinArray a -> BuiltinArray a Source # | |||||
| HasFromBuiltin a => HasFromBuiltin (BuiltinArray a) Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
Methods fromBuiltin :: BuiltinArray a -> FromBuiltin (BuiltinArray a) Source # | |||||
| MkNil a => MkNil (BuiltinArray a) Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods mkNil :: BuiltinList (BuiltinArray a) Source # | |||||
| HasTypeLevel uni Vector => Typeable uni BuiltinArray Source # | |||||
Defined in PlutusTx.Lift.Class | |||||
| type FromBuiltin (BuiltinArray a) Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
lengthOfArray :: BuiltinArray a -> BuiltinInteger Source #
Returns the length of the provided array and never fails
listToArray :: BuiltinList a -> BuiltinArray a Source #
Converts given list into array and never fails.
indexArray :: BuiltinArray a -> BuiltinInteger -> a Source #
Returns the n-th element from the array. Fails if the given index is not in the range [0..j),
where j is the length of the array.
data BuiltinBLS12_381_G1_Element Source #
Constructors
| BuiltinBLS12_381_G1_Element ~Element |
Instances
| Show BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| NFData BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods rnf :: BuiltinBLS12_381_G1_Element -> () Source # | |||||
| Eq BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (==) :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> Bool Source # (/=) :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> Bool Source # | |||||
| HasFromBuiltin BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
| |||||
| MkNil BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||
| Eq BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Eq.Class Methods (==) :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> Bool Source # | |||||
| FromData BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinBLS12_381_G1_Element Source # | |||||
| ToData BuiltinBLS12_381_G1_Element Source # | For the BLS12-381 G1 and G2 types we use the | ||||
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: BuiltinBLS12_381_G1_Element -> BuiltinData Source # | |||||
| UnsafeFromData BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinBLS12_381_G1_Element Source # | |||||
| Pretty BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods pretty :: BuiltinBLS12_381_G1_Element -> Doc ann prettyList :: [BuiltinBLS12_381_G1_Element] -> Doc ann | |||||
| HasFromOpaque BuiltinBLS12_381_G1_Element BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque | |||||
| HasToOpaque BuiltinBLS12_381_G1_Element BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque | |||||
| HasTermLevel uni Element => Lift uni BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinBLS12_381_G1_Element -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |||||
| HasTypeLevel uni Element => Typeable uni BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Lift.Class | |||||
| type FromBuiltin BuiltinBLS12_381_G1_Element Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
bls12_381_G1_equals :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> Bool Source #
Checks equality of two G1 elements and never fails.
bls12_381_G1_add :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element Source #
Adds two G1 elements and never fails.
bls12_381_G1_neg :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element Source #
Negates a G1 element and never fails.
bls12_381_G1_scalarMul :: BuiltinInteger -> BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element Source #
Multiplies a G1 element by a scalar and never fails.
bls12_381_G1_multiScalarMul :: BuiltinList BuiltinInteger -> BuiltinList BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element Source #
bls12_381_G1_compress :: BuiltinBLS12_381_G1_Element -> BuiltinByteString Source #
Compresses a G1 element to a bytestring and never fails.
bls12_381_G1_uncompress :: BuiltinByteString -> BuiltinBLS12_381_G1_Element Source #
Uncompresses a bytestring to a G1 element, failing if the bytestring is not a valid compressed G1 element.
bls12_381_G1_hashToGroup :: BuiltinByteString -> BuiltinByteString -> BuiltinBLS12_381_G1_Element Source #
Hashes an arbitrary bytestring message to a G1 element using the given domain separation tag (DST), failing if length of the DST is bigger than 255 bytes.
bls12_381_G1_compressed_zero :: BuiltinByteString Source #
The compressed form of the G1 identity element.
bls12_381_G1_compressed_generator :: BuiltinByteString Source #
The compressed form of the G1 generator element.
data BuiltinBLS12_381_G2_Element Source #
Constructors
| BuiltinBLS12_381_G2_Element ~Element |
Instances
| Show BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| NFData BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods rnf :: BuiltinBLS12_381_G2_Element -> () Source # | |||||
| Eq BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (==) :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> Bool Source # (/=) :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> Bool Source # | |||||
| HasFromBuiltin BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
| |||||
| MkNil BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods | |||||
| Eq BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Eq.Class Methods (==) :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> Bool Source # | |||||
| FromData BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinBLS12_381_G2_Element Source # | |||||
| ToData BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: BuiltinBLS12_381_G2_Element -> BuiltinData Source # | |||||
| UnsafeFromData BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinBLS12_381_G2_Element Source # | |||||
| Pretty BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods pretty :: BuiltinBLS12_381_G2_Element -> Doc ann prettyList :: [BuiltinBLS12_381_G2_Element] -> Doc ann | |||||
| HasFromOpaque BuiltinBLS12_381_G2_Element BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque | |||||
| HasToOpaque BuiltinBLS12_381_G2_Element BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque | |||||
| HasTermLevel uni Element => Lift uni BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinBLS12_381_G2_Element -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |||||
| HasTypeLevel uni Element => Typeable uni BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Lift.Class | |||||
| type FromBuiltin BuiltinBLS12_381_G2_Element Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
bls12_381_G2_equals :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> Bool Source #
Checks equality of two G2 elements and never fails.
bls12_381_G2_add :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element Source #
Adds two G2 elements and never fails.
bls12_381_G2_neg :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element Source #
Negates a G2 element and never fails.
bls12_381_G2_scalarMul :: BuiltinInteger -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element Source #
Multiplies a G2 element by a scalar and never fails.
bls12_381_G2_multiScalarMul :: BuiltinList BuiltinInteger -> BuiltinList BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element Source #
bls12_381_G2_compress :: BuiltinBLS12_381_G2_Element -> BuiltinByteString Source #
Compresses a G2 element to a bytestring and never fails.
bls12_381_G2_uncompress :: BuiltinByteString -> BuiltinBLS12_381_G2_Element Source #
Uncompresses a bytestring to a G2 element, failing if the bytestring is not a valid compressed G2 element.
bls12_381_G2_hashToGroup :: BuiltinByteString -> BuiltinByteString -> BuiltinBLS12_381_G2_Element Source #
Hashes an arbitrary bytestring message to a G2 element using the given domain separation tag (DST), failing if length of the DST is bigger than 255 bytes.
bls12_381_G2_compressed_zero :: BuiltinByteString Source #
The compressed form of the G2 identity element (also known as zero or point at infinity).
bls12_381_G2_compressed_generator :: BuiltinByteString Source #
The compressed form of the G2 generator element.
data BuiltinBLS12_381_MlResult Source #
Constructors
| BuiltinBLS12_381_MlResult ~MlResult |
Instances
| Show BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Builtins.Internal | |||||
| NFData BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods rnf :: BuiltinBLS12_381_MlResult -> () Source # | |||||
| Eq BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods (==) :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult -> Bool Source # (/=) :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult -> Bool Source # | |||||
| HasFromBuiltin BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin Associated Types
| |||||
| (TypeError ('Text "fromBuiltinData is not supported for BuiltinBLS12_381_MlResult") :: Constraint) => FromData BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.IsData.Class Methods fromBuiltinData :: BuiltinData -> Maybe BuiltinBLS12_381_MlResult Source # | |||||
| (TypeError ('Text "toBuiltinData is not supported for BuiltinBLS12_381_MlResult") :: Constraint) => ToData BuiltinBLS12_381_MlResult Source # | We do not provide instances of any of these classes for BuiltinBLS12_381_MlResult since there is no serialisation format: we expect that values of that type will only occur as the result of on-chain computations. | ||||
Defined in PlutusTx.IsData.Class Methods toBuiltinData :: BuiltinBLS12_381_MlResult -> BuiltinData Source # | |||||
| (TypeError ('Text "unsafeFromBuiltinData is not supported for BuiltinBLS12_381_MlResult") :: Constraint) => UnsafeFromData BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.IsData.Class Methods unsafeFromBuiltinData :: BuiltinData -> BuiltinBLS12_381_MlResult Source # | |||||
| Pretty BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Builtins.Internal Methods pretty :: BuiltinBLS12_381_MlResult -> Doc ann prettyList :: [BuiltinBLS12_381_MlResult] -> Doc ann | |||||
| HasFromOpaque BuiltinBLS12_381_MlResult BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods fromOpaque :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult Source # | |||||
| HasToOpaque BuiltinBLS12_381_MlResult BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Builtins.HasOpaque Methods toOpaque :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult Source # | |||||
| HasTermLevel uni MlResult => Lift uni BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Lift.Class Methods lift :: BuiltinBLS12_381_MlResult -> RTCompile uni fun (Term TyName Name uni fun ()) Source # | |||||
| HasTypeLevel uni MlResult => Typeable uni BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Lift.Class | |||||
| type FromBuiltin BuiltinBLS12_381_MlResult Source # | |||||
Defined in PlutusTx.Builtins.HasBuiltin | |||||
bls12_381_millerLoop :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_MlResult Source #
Computes the Miller loop between a G1 element and a G2 element and never fails.
bls12_381_mulMlResult :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult Source #
Multiplies two Miller loop results and never fails.
bls12_381_finalVerify :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult -> Bool Source #
Performs the final verification step of a pairing check. Returns true if e(P,Q) == e(R,S) for the given Miller loop results, and never fails.
integerToByteString :: Bool -> BuiltinInteger -> BuiltinInteger -> BuiltinByteString Source #
Converts the given integer to a bytestring. The first argument specifies
endianness (True for big-endian), followed by the target length of the resulting bytestring
and the integer itself. Fails if the target length is greater than 8192 or if the length
argument is 0 and the result won't fit into 8192 bytes.
See integerToByteString for its invariants in detail.
byteStringToInteger :: Bool -> BuiltinByteString -> BuiltinInteger Source #
Converts the given bytestring to the integer and never fails. The first argument specifies endianness (True for big-endian), followed by the bytestring.
shiftByteString :: BuiltinByteString -> BuiltinInteger -> BuiltinByteString Source #
Shifts the bytestring to the left if the second argument is positive, and to the right otherwise. Right-shifts fill with 0s from the left (logical shift); left-shifts fill with 0s from the right. Never fails.
rotateByteString :: BuiltinByteString -> BuiltinInteger -> BuiltinByteString Source #
Rotates the bytestring to the left if the second argument is positive, and to the right otherwise. Never fails.
countSetBits :: BuiltinByteString -> BuiltinInteger Source #
Counts the number of bits set to 1 in the bytestring and never fails.
findFirstSetBit :: BuiltinByteString -> BuiltinInteger Source #
Finds the index of the first bit set to 1 in the bytestring. If the bytestring consists only of 0s, it returns the length of the bytestring in bits. Never fails.
andByteString :: Bool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source #
Performs a bitwise AND on two bytestrings. The first boolean argument indicates whether to use padding (True) or truncation (False) if the bytestrings have different lengths. Never fails.
orByteString :: Bool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source #
Performs a bitwise OR on two bytestrings. The first boolean argument indicates whether to use padding (True) or truncation (False) if the bytestrings have different lengths. Never fails.
xorByteString :: Bool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source #
Performs a bitwise XOR on two bytestrings. The first boolean argument indicates whether to use padding (True) or truncation (False) if the bytestrings have different lengths. Never fails.
complementByteString :: BuiltinByteString -> BuiltinByteString Source #
Performs a bitwise complement on the bytestring and never fails.
readBit :: BuiltinByteString -> BuiltinInteger -> Bool Source #
Reads the bit at the given index in the bytestring. Fails if the index is out of bounds.
writeBits :: BuiltinByteString -> BuiltinList BuiltinInteger -> Bool -> BuiltinByteString Source #
Writes the given bit (third argument, True for 1, False for 0) at the specified indices (second argument) in the bytestring. Fails if any index is out of bounds.
replicateByte :: BuiltinInteger -> BuiltinInteger -> BuiltinByteString Source #
Creates a bytestring of a given length by repeating the given byte.
Fails if the byte, second argument, is not in range [0,255], the length is negative,
or when the length is greater than 8192.
expModInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger -> BuiltinInteger Source #
Computes modular exponentiation (base^exponent mod modulus). Fails if the modulus is zero or negative, or if the exponent is negative and the modular inverse does not exist.
insertCoin :: BuiltinByteString -> BuiltinByteString -> BuiltinInteger -> BuiltinValue -> BuiltinValue Source #
lookupCoin :: BuiltinByteString -> BuiltinByteString -> BuiltinValue -> Integer Source #
unionValue :: BuiltinValue -> BuiltinValue -> BuiltinValue Source #
valueContains :: BuiltinValue -> BuiltinValue -> Bool Source #
mkValue :: BuiltinValue -> BuiltinData Source #
scaleValue :: Integer -> BuiltinValue -> BuiltinValue Source #
caseInteger :: Integer -> [a] -> a Source #
casePair :: BuiltinPair a b -> (a -> b -> r) -> r Source #
Case matching on a builtin pair. Continuation is needed here to make it more efficient on builtin-casing implementation.