set
Assign a value to a variable for use later in the script.
Syntax
Section titled “Syntax”set <variable> <value>Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
variable |
variable |
Variable name |
value |
any |
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"]]