Skip to content

token:permit

Approve a spender through an EIP-2612 permit signed by the connected wallet, encoded as a permit() call anyone can submit.

token:permit <amount> <token> <for> <spender>
NameTypeDescription
amountnumberAllowance in token units (wei)
tokenaddressToken address
forcommandKeyword for
spenderaddressSpender address
NameTypeDescription
--deadlinenumberPermit expiry as a Unix timestamp (defaults to no expiry)

The command reads the token nonce and EIP-712 domain, asks the connected wallet for a typed-data signature, and encodes the resulting permit(owner, spender, value, deadline, v, r, s) call. The signature only covers the connected account as owner, so the encoded call can be submitted by anyone — including inside a batch executed by another account.

Only standard EIP-2612 permits are supported; tokens with nonstandard permit signatures (e.g. DAI-style allowed permits) are rejected.

load token
set $token 0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb
set $spender 0x4F2083f5fBede34C2714aFfb3105539775f7FE64
# Approve via signature instead of an approve transaction
token:permit 100e18 $token for $spender
# Permit that expires in one day
token:permit 100e18 $token for $spender --deadline @date(now +1d)
  • token:approve — transaction-based approval
  • sign — sign arbitrary messages or typed data