token:approve
Approve a spender for an ERC20 token allowance.
Supports runtime fields inside smart blocks. Use explicit @helper! expressions or captured outputs; other fields are evaluated at build time.
Syntax
Section titled “Syntax”token:approve <amount> <token> <for> <spender>Arguments
Section titled “Arguments”| Name | Type | Evaluation | Description |
|---|---|---|---|
amount | number | Runtime in smart blocks | Allowance in token units (wei) |
token | address | Runtime in smart blocks | Token address |
for | command | Build time | Keyword for |
spender | address | Runtime in smart blocks | Spender address |
Examples
Section titled “Examples”load token
set $token 0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdbset $spender 0x4F2083f5fBede34C2714aFfb3105539775f7FE64
token:approve 100e18 $token for $spender
# Revoke an allowancetoken:approve 0 $token for $spender