A map expression.
The indexing key to be deleted.
Source code line information (Used in error messages)
A statement
Test a condition and interrupt the smart-contract execution if the condition is false. (The whole operation is rollbacked)
Require(LessThanOrEqual(ContractStorage(), Nat(10)), String("LessThanOrEqual to 10"));
The value to be included in the error trace.
Source code line information (Used in error messages)
A statement
A (If) statement.
If(GreaterThan(ContractStorage(), Nat(5)))
.Then([SetValue(ContractStorage(), Nat(5))])
.Else([])
Statements to be applied if the condition is true.
Statements to be applied if the condition is false.
Source code line information (Used in error messages)
A statement
Switch statement used to match branches on variant expressions.
MatchVariant(arg)
.Case('action1', (action) => [SetValue(ContractStorage(), action)])
.Case('action2', (action) => [SetValue(ContractStorage(), action)])
Variant expression
An optional argument name
Source code line information (Used in error messages)
A statement
A basic (for) loop.
For(Nat(0), Nat(10), Nat(1)).Do((i) => [SetValue(ContractStorage(), Add(ContractStorage(), i))]);
The initial value
The target value
The incrementor
The statements inside the loop body
The variable name being incremented inside the loop
Source code line information (Used in error messages)
A statement
A (forEach) loop.
ForEachOf(arg)
.Do((i) => [SetValue(ContractStorage(), Add(ContractStorage(), i))]);
The list to be iterated over
The statements inside the loop body
The iterator name
Source code line information (Used in error messages)
A statement
A basic (while) loop.
While(LessThanOrEqual(ContractStorage(), Nat(10)))
.Do([SetValue(ContractStorage(), Add(ContractStorage(), Nat(1)))]);
The statements inside the loop body
Source code line information (Used in error messages)
A statement
Interrupt the smart-contract execution. (The whole operation is rollbacked)
FailWith(String("SOME ERROR MESSAGE"));
The value to be included in the error trace.
Source code line information (Used in error messages)
A statement
Return statement used inside lambdas and views.
Lambda().setInputType(TString()).code((arg) => [Return(arg)])
Method returned expression
Source code line information (Used in error messages)
A statement
Add element to set.
AddElementToSet(Set([Nat(1)]), Nat(2));
An expression of type set.
The element to be added.
Source code line information (Used in error messages)
An expression of type list.
Remove element to set.
RemoveElementFromSet(Set([Nat(1)]), Nat(1));
An expression of type set.
The element to be removed.
Source code line information (Used in error messages)
An expression of type list.
Set expression type.
Lambda().setInputType(TString()).code((arg) => [SetType(arg, TBool())])
Expression type.
Source code line information (Used in error messages)
A statement
Declare a new variable.
// Mutable
NewVariable("a", String("HELLO WORLD"));
// Unmutable
NewVariable("b", String("HELLO WORLD"), false);
Variable name
Variable initial value
Optional flag that can be used to set the variable as final (false: final, true: mutable)
Source code line information (Used in error messages)
A statement
Assign value to variable.
SetValue(ContractStorage(), Nat(1));
The variable to be updated
Value to be assigned
Source code line information (Used in error messages)
A statement
Generated using TypeDoc
Delete map entry.