ABI Signatures
Contract function signatures follow Solidity syntax. Inside a signature string the parameter types are comma-separated, exactly as in Solidity:
# Write functions (for exec): inputs onlyexec @token(DAI) "transfer(address,uint256)" @me 100e18exec @token(DAI) "approve(address,uint256)" @me 100e18
# Read functions (for @get): append (returnTypes) directly after the inputsset $bal @get(@token(DAI) "balanceOf(address)(uint256)" @me)set $name @get(@token(DAI) "name()(string)")set $reserves @get(0x44fA8E6f47987339850636F88629646662444217 "getReserves()(uint112,uint112,uint32)")The read format is "name(inputTypes)(returnTypes)" — two parenthesized
lists back to back with no colon or other separator between them
("name()(string)", not "name():(string)").
Inline Calls
Section titled “Inline Calls”A read signature can also be embedded directly in an inline call: write
the target address, the :: operator, and the signature with its
arguments inside braces — no quotes, arguments space-separated after the
signature:
print "Balance: " @token(DAI)::{balanceOf(address)(uint256) @me}This is an expression form of @get — it performs the same read-only
call and can be used anywhere a value is expected:
set $reserves 0x44fA8E6f47987339850636F88629646662444217::{getReserves()(uint112,uint112,uint32)}An inline call runs while the script builds. Inside an on-chain
expression — an assert side, or the arguments of a ! helper — the call
is instead read when the assertion is judged, and the operator says so:
write ::!{...}. A plain ::{...} there is an error.
assert @token(DAI)::!{balanceOf(address)(uint256) @me} >= 100e18 "short on DAI"Inline calls chain: when a call returns an address, append another
::{...} to call into it directly:
load ens
set $registry 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1eset $node @ens:namehash("vitalik.eth")
print "Address:" $registry::{resolver(bytes32)(address) $node}::{addr(bytes32)(address) $node}