set
Assign a value to a variable for use later in the script.
Supports runtime fields inside smart blocks. Use explicit @helper! expressions or captured outputs; other fields are evaluated at build time.
Syntax
Section titled “Syntax”set <variable> <value>Arguments
Section titled “Arguments”| Name | Type | Evaluation | Description |
|---|---|---|---|
variable | variable | Build time | Variable name |
value | any | Runtime in smart blocks | Value to assign |
Examples
Section titled “Examples”# Set a simple valueset $amount 1e18
# Set a stringset $greeting "hello world"
# Set from a helper resultset $dai @token(DAI)
# Destructuring assignmentset [$a $b] ["hello" "world"]
# Skip values with _set [_ $second] ["skip" "keep"]
# Nested destructuringset [$a [_ $b]] ["x" ["skip" "y"]]