An expression
An expression
Source code line information (Used in error messages)
An expression
Check if a value is greater than or equal another value.
GreaterThanOrEqual(Nat(1), Nat(1)); // Bool(true)
An expression
An expression
Source code line information (Used in error messages)
An expression
Check if a value is less than another value.
LessThan(Nat(1), Nat(1)); // Bool(false)
An expression
An expression
Source code line information (Used in error messages)
An expression
Check if a value is less than or equal another value.
LessThanOrEqual(Nat(1), Nat(1)); // Bool(true)
An expression
An expression
Source code line information (Used in error messages)
An expression
Compute a Blake2B cryptographic hash
BLAKE2B(Bytes("0x01"));
An expression that evaluates to a bytes value.
Source code line information (Used in error messages)
An expression
Verifies that a given sequence of bytes has been signed with a given key.
CheckSignature(Key("edpku3g7CeTEvSKhxipD4Q2B6EiEP8cR323u8PFmGFgKRVRvCneEmT"), Signature("sigsAujsNePapNNGsVotTvcKWMNNJja9B4a2FfAe8vExzFhEgEo1GTQStiif22uSA6iNxPGCGsXsRyeLHzeLbJL2y8CnYuNe"), Bytes("0x01"));
The public key that signed the bytes.
The bytes signature.
The raw bytes that were signed.
Source code line information (Used in error messages)
An expression of type TBool()
.
Hash public key.
HashKey(Key("edpku3g7CeTEvSKhxipD4Q2B6EiEP8cR323u8PFmGFgKRVRvCneEmT"));
An expression that evaluates to a public key value.
Source code line information (Used in error messages)
An expression of type TContract(TUnit())
.
Compute a Keccak-256 cryptographic hash
KECCAK(Bytes("0x01"));
An expression that evaluates to a bytes value.
Source code line information (Used in error messages)
An expression
Compute a SHA-256 cryptographic hash
SHA256(Bytes("0x01"));
An expression that evaluates to a bytes value.
Source code line information (Used in error messages)
An expression
Compute a SHA3-256 cryptographic hash
SHA3(Bytes("0x01"));
An expression that evaluates to a bytes value.
Source code line information (Used in error messages)
An expression
Compute a SHA-512 cryptographic hash
SHA512(Bytes("0x01"));
An expression that evaluates to a bytes value.
Source code line information (Used in error messages)
An expression
Checks if two expressions resolve to equal values
Equal(Nat(1), Nat(1)); // Bool(true)
An expression
An expression
Source code line information (Used in error messages)
An expression
Checks if two expressions resolve to a different values
NotEqual(Nat(1), Nat(1)); // Bool(false)
An expression
An expression
Source code line information (Used in error messages)
An expression
Build a literal of type address.
Address("KT1R9M3MDffw7qSVSnbJs46aMC9YzzZz3aGT");
Source code line information (Used in error messages)
An expression
Build a literal of type big_map.
Big_map([
[Nat(1), String('WORD1')],
[Nat(2), String('WORD2')],
]);
Source code line information (Used in error messages)
An expression
Build a literal of type bls12_381_fr.
Bls12_381_fr("0x0001");
Source code line information (Used in error messages)
An expression
Build a literal of type bls12_381_g1.
Bls12_381_g1("0x0572cbea904d67468808c8eb50a9450c9721db309128012543902d0ac358a62ae28f75bb8f1c7c42c39a8c5529bf0f4e166a9d8cabc673a322fda673779d8e3822ba3ecb8670e461f73bb9021d5fd76a4c56d9d4cd16bd1bba86881979749d28");
Source code line information (Used in error messages)
An expression
Build a literal of type bls12_381_g2.
Bls12_381_g2("0x13e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb813fa4d4a0ad8b1ce186ed5061789213d993923066dddaf1040bc3ff59f825c78df74f2d75467e25e0f55f8a00fa030ed0d1b3cc2c7027888be51d9ef691d77bcb679afda66c73f17f9ee3837a55024f78c71363275a75d75d86bab79f74782aa");
Source code line information (Used in error messages)
An expression
Build a literal of type bool.
Bool(false);
Source code line information (Used in error messages)
An expression
Build a literal of type bytes.
Bytes("0x01");
Source code line information (Used in error messages)
An expression
Build a literal of type chain_id. (Represents a chain identifier)
Chain_id("0x00");
Source code line information (Used in error messages)
An expression
Build a literal of type int.
Int(1);
Source code line information (Used in error messages)
An expression
Build a literal of type key.
Key("edpku3g7CeTEvSKhxipD4Q2B6EiEP8cR323u8PFmGFgKRVRvCneEmT");
Source code line information (Used in error messages)
An expression
Build a literal of type key_hash.
Key_hash("tz28QJHLyqvaY2rXAoFZTbxrXeD88NA8wscC");
Source code line information (Used in error messages)
An expression
Build a literal of type lambda.
Lambda()
.setInputType(TString())
.code((arg) => [Return(arg)]);
Source code line information (Used in error messages)
An expression
Build a literal of type or. (Wrap a value in a union. It represents the left branch.)
Left(Nat(1));
Source code line information (Used in error messages)
An expression
Build a literal of type list.
List([Nat(1)]);
Source code line information (Used in error messages)
An expression
Build a literal of type map.
Map([
[Nat(1), String('WORD1')],
[Nat(2), String('WORD2')],
]);
Source code line information (Used in error messages)
An expression
Build a literal of type mutez.
Mutez(1);
Source code line information (Used in error messages)
An expression
Build a literal of type nat.
Nat(1);
Source code line information (Used in error messages)
An expression
Build a literal of type option. (Used to represent an absent optional value)
None();
Source code line information (Used in error messages)
An expression
Build a literal of type pair. (A binary tuple of values)
Pair(Nat(1), Bool(false));
Source code line information (Used in error messages)
An expression
An artificial literal of type pair. (Uses nested annotated pair's to simulate an object value)
Record({
field1: Nat(1),
field2: Int(2),
field3: Bytes('0x00'),
});
Source code line information (Used in error messages)
An expression
Build a literal of type or. (Wrap a value in a union. It represents the right branch.)
Right(Bool(false));
Source code line information (Used in error messages)
An expression
Build a literal of type sapling_state.
Sapling_state(8);
size
Source code line information (Used in error messages)
An expression of type TSapling_state()
.
Build a literal of type set.
Set([Nat(1)]);
Source code line information (Used in error messages)
An expression
Build a literal of type signature.
Signature("sigsAujsNePapNNGsVotTvcKWMNNJja9B4a2FfAe8vExzFhEgEo1GTQStiif22uSA6iNxPGCGsXsRyeLHzeLbJL2y8CnYuNe");
Source code line information (Used in error messages)
An expression
Build a literal of type option. (Wraps an existing optional value)
Some(Nat(1));
Source code line information (Used in error messages)
An expression
Build a literal of type string.
String("Some String");
Source code line information (Used in error messages)
An expression
Build a literal of type ticket.
Ticket(String('A Ticket'), Nat(1));
Source code line information (Used in error messages)
An expression
Build a literal of type timestamp. (The input is the number of seconds since Epoch)
Timestamp(1000);
Source code line information (Used in error messages)
An expression
Build a literal of type unit.
Unit();
Source code line information (Used in error messages)
An expression
An artificial literal of type or. (Uses nested annotated or's)
Variant('branch1', Int(1));
Source code line information (Used in error messages)
An expression
Add two numerical values
Add(Nat(1), Nat(1)); // Nat(2)
Expression
Expression
Source code line information (Used in error messages)
An expression
Division operation.
Divide(Nat(1), Nat(1)); // Nat(1)
Expression
Expression
Source code line information (Used in error messages)
An expression
Euclidean Division
EuclideanDivision(Nat(13), Nat(3)); // Some(Pair(Nat(4), Nat(1)))
Expression
Expression
Source code line information (Used in error messages)
An expression of type `TOption(TPair(@quotient_type, @remainder_type)))
Computes the median of a list of integers.
Median(List([Nat(2), Nat(1), Nat(3)]); // Nat(2)
Expression
Source code line information (Used in error messages)
An expression that evaluates to TNat()
or TInt
depending on the input type.
Modulus
Mod(Nat(13), Nat(3)); // Nat(1)
Expression
Expression
Source code line information (Used in error messages)
An expression.
Multiply two numerical values
Multiply(Nat(1), Nat(1)); // Nat(1)
Expression
Expression
Source code line information (Used in error messages)
An expression
Logical left shift
ShiftLeft(Nat(2), Nat(1)); // Nat(1)
Expression
Expression
Source code line information (Used in error messages)
An expression.
Logical right shift
ShiftRight(Nat(2), Nat(1)); // Nat(1)
Expression
Expression
Source code line information (Used in error messages)
An expression.
Subtract two numerical values
Subtract(Nat(1), Nat(1)); // Nat(0)
Expression
Expression
Source code line information (Used in error messages)
An expression
Build a origination operation.
// Create a new contract (Simple)
CreateContract(new Contract(), Unit()).send();
// Create a new contract (Full)
CreateContract(new Contract(), Nat(1), Mutez(100), Some(Key_hash("tz1gTnKMA65qaKVpp6x4cgMLU2UyKF2zjHYN"))).send();
Contract class
Initial storage for the contract
Initial balance for the new contract
The address of the delegate implicit account
Source code line information (Used in error messages)
An expression
Build a delegation operation.
// Build and send a delegation operation
SetDelegate(Some(Key_hash("tz1gTnKMA65qaKVpp6x4cgMLU2UyKF2zjHYN"))).send();
// Clear Delegate
SetDelegate(None()).send();
An optional implicit account to receive the delegation.
Source code line information (Used in error messages)
An expression
Build a transaction operation.
// Transfer 100 mutez to an implicit account
Transfer(GetContract(Address('tz1gTnKMA65qaKVpp6x4cgMLU2UyKF2zjHYN')), Mutez(100)).send();
// Call an originated contract
Transfer(GetContract(Address('KT1R9M3MDffw7qSVSnbJs46aMC9YzzZz3aGT'), '<entrypoint>', TNat()), Mutez(100), Nat(1)).send();
Recipient contract
Transaction amount
Entrypoint argument
Source code line information (Used in error messages)
An expression
Serializes any value of packable type to its optimized binary representation, of type TBytes()
.
Pack(Nat(1));
An expression
Source code line information (Used in error messages)
An expression of type TBytes()
.
Deserialize a value of type TBytes()
into the corresponding Michelson value of type TOption(...)
.
Unpack(Bytes("0x05070707070100000004746f746f020000000800030007000900010200000006000100020003"));
An expression that evaluates to type TBytes()
The type of the deserialized value.
Source code line information (Used in error messages)
An expression of type TOption(<type>)
Negate a numerical value.
Negate(Int(1)); // Int(-1)
An expression that evaluates to either TInt()
, TNat()
, TBls12_381_g2()
, TBls12_381_g1()
or TBls12_381_fr()
.
Source code line information (Used in error messages)
An expression
Boolean negation and bitwise complement.
Not(Bool(true)); // Bool(false)
An expression that evaluates to either TBool()
, TInt()
or TNat()
.
Source code line information (Used in error messages)
An expression
Check a BLS12-381 pairing.
PairingCheck(List([
Pair(
Bls12_381_g1("0x17f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb08b3f481e3aaa0f1a09e30ed741d8ae4fcf5e095d5d00af600db18cb2c04b3edd03cc744a2888ae40caa232946c5e7e1"),
Bls12_381_g2("0x13e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb80606c4a02ea734cc32acd2b02bc28b99cb3e287e85a763af267492ab572e99ab3f370d275cec1da1aaa9075ff05f79be0ce5d527727d6e118cc9cdc6da2e351aadfd9baa8cbdd3a76d429a695160d12c923ac9cc3baca289e193548608b82801")
),
Pair(
Bls12_381_g1("0x17f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb08b3f481e3aaa0f1a09e30ed741d8ae4fcf5e095d5d00af600db18cb2c04b3edd03cc744a2888ae40caa232946c5e7e1"),
Bls12_381_g2("0x13e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb80606c4a02ea734cc32acd2b02bc28b99cb3e287e85a763af267492ab572e99ab3f370d275cec1da1aaa9075ff05f79be0ce5d527727d6e118cc9cdc6da2e351aadfd9baa8cbdd3a76d429a695160d12c923ac9cc3baca289e193548608b82801")
)
]));
An expression that evaluates to a value of type TList(TPair(TBls12_381_g1(), TBls12_381_g2()))
.
Source code line information (Used in error messages)
An expression of types TBool()
.
Check if a value is greater than another value.
GreaterThan(Nat(1), Nat(1)); // Bool(false)
An expression
An expression
Source code line information (Used in error messages)
An expression
Check if a value is greater than or equal another value.
GreaterThanOrEqual(Nat(1), Nat(1)); // Bool(true)
An expression
An expression
Source code line information (Used in error messages)
An expression
Check if a value is less than another value.
LessThan(Nat(1), Nat(1)); // Bool(false)
An expression
An expression
Source code line information (Used in error messages)
An expression
Check if a value is less than or equal another value.
LessThanOrEqual(Nat(1), Nat(1)); // Bool(true)
An expression
An expression
Source code line information (Used in error messages)
An expression
Cast an address to a typed contract.
GetContract(Address('KT1R9M3MDffw7qSVSnbJs46aMC9YzzZz3aGT'), 'some_entrypoint', TNat());
An expression that resolves to an address value
Contract entrypoint
Entrypoint argument type
Source code line information (Used in error messages)
An expression of type TOption(TContract(@argumentType))
.
Hash public key.
HashKey(Key("edpku3g7CeTEvSKhxipD4Q2B6EiEP8cR323u8PFmGFgKRVRvCneEmT"));
An expression that evaluates to a public key value.
Source code line information (Used in error messages)
An expression of type TContract(TUnit())
.
Create an implicit account.
ImplicitAccount(Key_hash("tz1gTnKMA65qaKVpp6x4cgMLU2UyKF2zjHYN"));
An expression that evaluates to a public key hash value.
Source code line information (Used in error messages)
An expression of type TContract(TUnit())
.
Get the address of a contract value.
ToAddress(GetSelf());
An expression that evaluates to a contract value.
Source code line information (Used in error messages)
An expression of type TAddress()
.
Cast an address to a typed contract.
ToContract(Address('KT1R9M3MDffw7qSVSnbJs46aMC9YzzZz3aGT'), 'some_entrypoint', TNat());
An expression that resolves to an address value
Contract entrypoint
Entrypoint argument type
The value to be included in the error trace
Source code line information (Used in error messages)
An expression of type TContract()
.
Compute a Blake2B cryptographic hash
BLAKE2B(Bytes("0x01"));
An expression that evaluates to a bytes value.
Source code line information (Used in error messages)
An expression
Verifies that a given sequence of bytes has been signed with a given key.
CheckSignature(Key("edpku3g7CeTEvSKhxipD4Q2B6EiEP8cR323u8PFmGFgKRVRvCneEmT"), Signature("sigsAujsNePapNNGsVotTvcKWMNNJja9B4a2FfAe8vExzFhEgEo1GTQStiif22uSA6iNxPGCGsXsRyeLHzeLbJL2y8CnYuNe"), Bytes("0x01"));
The public key that signed the bytes.
The bytes signature.
The raw bytes that were signed.
Source code line information (Used in error messages)
An expression of type TBool()
.
Compute a Keccak-256 cryptographic hash
KECCAK(Bytes("0x01"));
An expression that evaluates to a bytes value.
Source code line information (Used in error messages)
An expression
Compute a SHA-256 cryptographic hash
SHA256(Bytes("0x01"));
An expression that evaluates to a bytes value.
Source code line information (Used in error messages)
An expression
Compute a SHA3-256 cryptographic hash
SHA3(Bytes("0x01"));
An expression that evaluates to a bytes value.
Source code line information (Used in error messages)
An expression
Compute a SHA-512 cryptographic hash
SHA512(Bytes("0x01"));
An expression that evaluates to a bytes value.
Source code line information (Used in error messages)
An expression
Checks if two expressions resolve to equal values
Equal(Nat(1), Nat(1)); // Bool(true)
An expression
An expression
Source code line information (Used in error messages)
An expression
Checks if two expressions resolve to a different values
NotEqual(Nat(1), Nat(1)); // Bool(false)
An expression
An expression
Source code line information (Used in error messages)
An expression
Obtain the absolute value of an TInt()
value.
ABS(Int(-1)); // Nat(1)
An expression that evaluates to a value of type TInt()
.
Source code line information (Used in error messages)
An expression that evaluates to TNat()
.
Convert a value of type TNat()
to TInt()
CastToInt(Nat(1)); // Int(1)
An expression that evaluates to a value of type TInt()
.
Source code line information (Used in error messages)
An expression that evaluates to TNat()
.
Convert a value of type TInt()
to TNat()
.
CastToNat(Subtract(Nat(2), Nat(1))); // Nat(1)
A non-negative integer expression.
An optional value to be included in the error trace if the integer is negative.
Source code line information (Used in error messages)
An expression that evaluates to TNat().
Convert a value of type TInt()
to TOption(TNat())
.
IsNat(Subtract(Nat(2), Nat(1))); // Some(Nat(1))
A non-negative integer expression.
Source code line information (Used in error messages)
An expression that evaluates to TOption(TNat()).
Boolean AND. (The result is true only if both expressions are true)
And(Bool(true), Bool(false)); // Bool(false)
Boolean expression
Boolean expression
Source code line information (Used in error messages)
An expression
Boolean OR. (The result is true if at least one of the expressions is true)
Or(Bool(true), Bool(false)); // Bool(true)
Boolean expression
Boolean expression
Source code line information (Used in error messages)
An expression
Boolean XOR.
Xor(Bool(true), Bool(false)); // Bool(true)
Boolean expression
Boolean expression
Source code line information (Used in error messages)
An expression
Call inlined michelson.
Inlined michelson
Arguments
An expression
Inline michelson code.
InlinedMichelson(
`
DUP;
SIZE;
DIG 2;
SWAP;
PUSH nat 0;
SLICE;
IF_NONE
{
DROP;
PUSH bool False;
}
{
COMPARE;
EQ;
};
`,
[TString(), TString()],
[TBool()]
)
Micheline code
An expression
Verify and apply a transaction on a Sapling state.
ApplySaplingUpdate(ContractStorage().state, transition);
A sapling state
A sapling transition
Source code line information (Used in error messages)
An expression of type TOption(TPair(TInt(), TSaplingState(@memo_size)))
Creates an empty Sapling state.
EmptySaplingState(8);
size
Source code line information (Used in error messages)
An expression of type TSapling_state()
Serializes any value of packable type to its optimized binary representation, of type TBytes()
.
Pack(Nat(1));
An expression
Source code line information (Used in error messages)
An expression of type TBytes()
.
Deserialize a value of type TBytes()
into the corresponding Michelson value of type TOption(...)
.
Unpack(Bytes("0x05070707070100000004746f746f020000000800030007000900010200000006000100020003"));
An expression that evaluates to type TBytes()
The type of the deserialized value.
Source code line information (Used in error messages)
An expression of type TOption(<type>)
Get the chain identifier.
GetChain_id();
An expression
Get the head block level.
GetLevel();
An expression
Get the head block timestamp.
GetTimestamp();
An expression
Get total voting power.
GetTotalVotingPower();
An expression
Get the voting power of a given implicit account.
GetVotingPower(Key_hash('tz1gTnKMA65qaKVpp6x4cgMLU2UyKF2zjHYN'));
An expression that resolves to a key_hash value.
Source code line information (Used in error messages)
An expression
Concatenate a list with values of type TString()
or TBytes()
.
Concat([ String("Hello"), String(" "), String("World") ]);
Source code line information (Used in error messages)
An expression.
Build a literal of type big_map.
Big_map([
[Nat(1), String('WORD1')],
[Nat(2), String('WORD2')],
]);
Source code line information (Used in error messages)
An expression
Build a literal of type lambda.
Lambda()
.setInputType(TString())
.code((arg) => [Return(arg)]);
Source code line information (Used in error messages)
An expression
Build a literal of type or. (Wrap a value in a union. It represents the left branch.)
Left(Nat(1));
Source code line information (Used in error messages)
An expression
Build a literal of type list.
List([Nat(1)]);
Source code line information (Used in error messages)
An expression
Build a literal of type map.
Map([
[Nat(1), String('WORD1')],
[Nat(2), String('WORD2')],
]);
Source code line information (Used in error messages)
An expression
Build a literal of type option. (Used to represent an absent optional value)
None();
Source code line information (Used in error messages)
An expression
Build a literal of type pair. (A binary tuple of values)
Pair(Nat(1), Bool(false));
Source code line information (Used in error messages)
An expression
An artificial literal of type pair. (Uses nested annotated pair's to simulate an object value)
Record({
field1: Nat(1),
field2: Int(2),
field3: Bytes('0x00'),
});
Source code line information (Used in error messages)
An expression
Build a literal of type or. (Wrap a value in a union. It represents the right branch.)
Right(Bool(false));
Source code line information (Used in error messages)
An expression
Build a literal of type sapling_state.
Sapling_state(8);
size
Source code line information (Used in error messages)
An expression of type TSapling_state()
.
Build a literal of type set.
Set([Nat(1)]);
Source code line information (Used in error messages)
An expression
Build a literal of type option. (Wraps an existing optional value)
Some(Nat(1));
Source code line information (Used in error messages)
An expression
Build a literal of type ticket.
Ticket(String('A Ticket'), Nat(1));
Source code line information (Used in error messages)
An expression
An artificial literal of type or. (Uses nested annotated or's)
Variant('branch1', Int(1));
Source code line information (Used in error messages)
An expression
Call lambda.
// Calling a lambda variable with a boolean as argument
CallLambda(GetVariable("some_lambda"), Bool(true));
Lambda expression
Lambda argument
Source code line information (Used in error messages)
An expression.
Prepend a value to a list. (Creates a new list)
PrependToList(List([Nat(1)]), Nat(2));
The value to be appended to the list
Source code line information (Used in error messages)
An expression
Accesss by key the value stored in a map or big map.
AccessMapByKey(ContractStorage().metadata, String("key"))
Map expression
Map key.
An optional default value when the key does not exist.
An optional value to be included in the error trace.
Source code line information (Used in error messages)
An expression
Get map entries.
GetMapEntries(
Map(
[
[String("some_key_a"), Nat(1)],
[String("some_key_b"), Nat(2)]
]
)
);
Map expression
Source code line information (Used in error messages)
An expression of type TList(TRecord({ key: ..., value: ... })).
Get map keys.
GetMapKeys(
Map(
[
[String("some_key_a"), Nat(1)],
[String("some_key_b"), Nat(2)]
]
)
);
Map expression
Source code line information (Used in error messages)
An expression of type TList(
Get map values.
GetMapValues(
Map(
[
[String("some_key_a"), Nat(1)],
[String("some_key_b"), Nat(2)]
]
)
);
Map expression
Source code line information (Used in error messages)
An expression of type TList(
Checks if a given key exists in map or big_map.
MapContainsKey(ContractStorage().metadata, String("sone_key"))
Map expression
Map key.
Source code line information (Used in error messages)
An expression that resolves to a boolean value.
Update an entry on map or big map.
// Update/Insert entry
UpdateMap(ContractStorage().metadata, String("some_key"), Some(Nat(10)));
// Remove entry
UpdateMap(ContractStorage().metadata, String("some_key"), None());
A map expression.
The map key.
An optional value to be indexed by the given key. (The entry is removed if None() is provided as value)
Source code line information (Used in error messages)
An expression
Add two numerical values
Add(Nat(1), Nat(1)); // Nat(2)
Expression
Expression
Source code line information (Used in error messages)
An expression
Division operation.
Divide(Nat(1), Nat(1)); // Nat(1)
Expression
Expression
Source code line information (Used in error messages)
An expression
Euclidean Division
EuclideanDivision(Nat(13), Nat(3)); // Some(Pair(Nat(4), Nat(1)))
Expression
Expression
Source code line information (Used in error messages)
An expression of type `TOption(TPair(@quotient_type, @remainder_type)))
Computes the median of a list of integers.
Median(List([Nat(2), Nat(1), Nat(3)]); // Nat(2)
Expression
Source code line information (Used in error messages)
An expression that evaluates to TNat()
or TInt
depending on the input type.
Modulus
Mod(Nat(13), Nat(3)); // Nat(1)
Expression
Expression
Source code line information (Used in error messages)
An expression.
Multiply two numerical values
Multiply(Nat(1), Nat(1)); // Nat(1)
Expression
Expression
Source code line information (Used in error messages)
An expression
Logical left shift
ShiftLeft(Nat(2), Nat(1)); // Nat(1)
Expression
Expression
Source code line information (Used in error messages)
An expression.
Logical right shift
ShiftRight(Nat(2), Nat(1)); // Nat(1)
Expression
Expression
Source code line information (Used in error messages)
An expression.
Subtract two numerical values
Subtract(Nat(1), Nat(1)); // Nat(0)
Expression
Expression
Source code line information (Used in error messages)
An expression
Build a origination operation.
// Create a new contract (Simple)
CreateContract(new Contract(), Unit()).send();
// Create a new contract (Full)
CreateContract(new Contract(), Nat(1), Mutez(100), Some(Key_hash("tz1gTnKMA65qaKVpp6x4cgMLU2UyKF2zjHYN"))).send();
Contract class
Initial storage for the contract
Initial balance for the new contract
The address of the delegate implicit account
Source code line information (Used in error messages)
An expression
Build a delegation operation.
// Build and send a delegation operation
SetDelegate(Some(Key_hash("tz1gTnKMA65qaKVpp6x4cgMLU2UyKF2zjHYN"))).send();
// Clear Delegate
SetDelegate(None()).send();
An optional implicit account to receive the delegation.
Source code line information (Used in error messages)
An expression
Build a transaction operation.
// Transfer 100 mutez to an implicit account
Transfer(GetContract(Address('tz1gTnKMA65qaKVpp6x4cgMLU2UyKF2zjHYN')), Mutez(100)).send();
// Call an originated contract
Transfer(GetContract(Address('KT1R9M3MDffw7qSVSnbJs46aMC9YzzZz3aGT'), '<entrypoint>', TNat()), Mutez(100), Nat(1)).send();
Recipient contract
Transaction amount
Entrypoint argument
Source code line information (Used in error messages)
An expression
Access the left part of a pair
FirstElement(Pair(Nat(1), String("A String"))); // Nat(1)
An expression that resolves to a value of type TPair(...);
Source code line information (Used in error messages)
An expression.
Access the right part of a pair
SecondElement(Pair(Nat(1), String("A String"))); // String("A String")
An expression that resolves to a value of type TPair(...);
Source code line information (Used in error messages)
An expression.
Get the sorted list of elements in a set.
GetElementsFromSet(Set([Nat(1)]));
An expression of type set.
Source code line information (Used in error messages)
An expression of type list.
Checks if a given element exists in a Set.
SetContainsElement(Set([Nat(2)]), Nat(2))
Source code line information (Used in error messages)
An expression that resolves to a boolean value.
Build a literal of type address.
Address("KT1R9M3MDffw7qSVSnbJs46aMC9YzzZz3aGT");
Source code line information (Used in error messages)
An expression
Build a literal of type bls12_381_fr.
Bls12_381_fr("0x0001");
Source code line information (Used in error messages)
An expression
Build a literal of type bls12_381_g1.
Bls12_381_g1("0x0572cbea904d67468808c8eb50a9450c9721db309128012543902d0ac358a62ae28f75bb8f1c7c42c39a8c5529bf0f4e166a9d8cabc673a322fda673779d8e3822ba3ecb8670e461f73bb9021d5fd76a4c56d9d4cd16bd1bba86881979749d28");
Source code line information (Used in error messages)
An expression
Build a literal of type bls12_381_g2.
Bls12_381_g2("0x13e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb813fa4d4a0ad8b1ce186ed5061789213d993923066dddaf1040bc3ff59f825c78df74f2d75467e25e0f55f8a00fa030ed0d1b3cc2c7027888be51d9ef691d77bcb679afda66c73f17f9ee3837a55024f78c71363275a75d75d86bab79f74782aa");
Source code line information (Used in error messages)
An expression
Build a literal of type bool.
Bool(false);
Source code line information (Used in error messages)
An expression
Build a literal of type bytes.
Bytes("0x01");
Source code line information (Used in error messages)
An expression
Build a literal of type chain_id. (Represents a chain identifier)
Chain_id("0x00");
Source code line information (Used in error messages)
An expression
Build a literal of type int.
Int(1);
Source code line information (Used in error messages)
An expression
Build a literal of type key.
Key("edpku3g7CeTEvSKhxipD4Q2B6EiEP8cR323u8PFmGFgKRVRvCneEmT");
Source code line information (Used in error messages)
An expression
Build a literal of type key_hash.
Key_hash("tz28QJHLyqvaY2rXAoFZTbxrXeD88NA8wscC");
Source code line information (Used in error messages)
An expression
Build a literal of type mutez.
Mutez(1);
Source code line information (Used in error messages)
An expression
Build a literal of type nat.
Nat(1);
Source code line information (Used in error messages)
An expression
Build a literal of type signature.
Signature("sigsAujsNePapNNGsVotTvcKWMNNJja9B4a2FfAe8vExzFhEgEo1GTQStiif22uSA6iNxPGCGsXsRyeLHzeLbJL2y8CnYuNe");
Source code line information (Used in error messages)
An expression
Build a literal of type string.
String("Some String");
Source code line information (Used in error messages)
An expression
Build a literal of type timestamp. (The input is the number of seconds since Epoch)
Timestamp(1000);
Source code line information (Used in error messages)
An expression
Build a literal of type unit.
Unit();
Source code line information (Used in error messages)
An expression
Obtain size of values with type TString()
, TBytes()
, TList(...)
, TSet(...)
and TMap()
.
SizeOf(String("Hello")); // Nat(5)
Source code line information (Used in error messages)
An expression.
Slice a value of type TBytes()
from offset for length characters.
Slice(Bytes("0x0a1111"), Nat(1), Nat(2)); // 0x1111
Source code line information (Used in error messages)
An expression of type TOption(TBytes())
.
Creates a ticket with some content and an amount.
For a ticket with content of type t
, the return type will be TTicket(t)
.
CreateTicket(String("TEST"), Nat(10));
The content to be wrapped in the ticket.
The ticket amount.
Source code line information (Used in error messages)
A value of type ticket
.
Join two tickets into one.
JoinTicket(some_ticket, some_other_ticket);
Source code line information (Used in error messages)
A value of type TTicket(t)
.
Retrieve the information stored in a ticket. Also return the ticket.
ReadTicket(some_ticket);
The ticket to be read.
Source code line information (Used in error messages)
A value of type TPair(TPair(TAddress(), t, TNat()), TTicket(t))
.
Splits a ticket in two.
SplitTicket(some_ticket, Nat(1), Nat(1));
The ticket to be split.
The quantity that the first new ticket will have.
The quantity that the second new ticket will have.
Source code line information (Used in error messages)
A value of type TOption(TPair(TTicket(t), TTicket(t)))
.
Add minutes to a timestamp.
AddHours(Timestamp(), 10);
The minutes to be added.
Source code line information (Used in error messages)
A value of type TTimestamp
.
Add minutes to a timestamp.
AddMinutes(Timestamp(), 10);
The minutes to be added.
Source code line information (Used in error messages)
A value of type TTimestamp
.
Add seconds to a timestamp.
AddSeconds(Timestamp(), Int(10));
The seconds to be added.
Source code line information (Used in error messages)
A value of type TTimestamp
.
Get the amount sent in the transaction.
GetAmount();
An expression
Get the contract balance.
GetBalance();
An expression
Get an entrypoint of the current contract.
GetSelf();
An expression
Get current contract address.
GetSelfAddress();
An expression
Get transaction sender.
GetSender();
An expression
Get transaction source.
GetSource();
An expression
Annotate an expression with type.
AsType(GetVariable("some_variable"), TNat());
Source code line information (Used in error messages)
An expression
Negate a numerical value.
Negate(Int(1)); // Int(-1)
An expression that evaluates to either TInt()
, TNat()
, TBls12_381_g2()
, TBls12_381_g1()
or TBls12_381_fr()
.
Source code line information (Used in error messages)
An expression
Boolean negation and bitwise complement.
Not(Bool(true)); // Bool(false)
An expression that evaluates to either TBool()
, TInt()
or TNat()
.
Source code line information (Used in error messages)
An expression
Get contract storage.
ContractStorage()
An expression
Get operations list from the stack or an empty list otherwise.
// Get operations list from the stack or an empty list otherwise.
GetOperations();
Source code line information (Used in error messages)
An expression
Access a property of a record value.
GetProperty(ContractStorage(), "prop1")
An expression that resolves to a record value
Property name
Source code line information (Used in error messages)
An expression
Get variable value.
GetVariable("some_variable")
Variable name
Source code line information (Used in error messages)
An expression
Get iterator value. (Only used inside for loops)
Iterator("some_iterator")
iterator name
Source code line information (Used in error messages)
An expression
Get lambda argument.
LambdaArgument()
The name of the argument
Source code line information (Used in error messages)
An expression
Get entrypoint/view argument.
MethodArgument()
Source code line information (Used in error messages)
An expression
Get the argument of a variant match case.
VariantCaseArgument("action_1")
The name of the argument
Source code line information (Used in error messages)
An expression
Unwrap a option value
GetSome(Some(Nat(1)), String("COULD NOT UNWRAP OPTION"))
Variant expression
The value to be included in the error trace.
Source code line information (Used in error messages)
An expression
Check if a variant literal matches a given branch.
IsVariant(Left(Nat(1)), "Left") // true
IsVariant(Right(Nat(1)), "Left") // false
Variant expression
The branch name of the variant
Source code line information (Used in error messages)
An expression
Open a variant
OpenVariant(Left(Nat(1)), "Left", String("COULD NOT OPEN VARIANT"))
Variant expression
The branch name of the variant
The value to be included in the error trace.
Source code line information (Used in error messages)
An expression
Checks if option variant is None.
isNone(None())
Option expression
Source code line information (Used in error messages)
An expression of type bool.
Checks if option variant is Some.
isSome(Some(Nat(1)))
Option expression
Source code line information (Used in error messages)
An expression of type bool.
Call a onchain view.
CallView("some_view", Address("KT1R9M3MDffw7qSVSnbJs46aMC9YzzZz3aGT"), Nat(10), TNat());
View name
Contract address that contains the view being called
View argument
Source code line information (Used in error messages)
An expression.
Generated using TypeDoc
Check if a value is greater than another value.