Approve spending
Approve spending

Ethereum Virtual Machine · Acts onchain

Grants a spender an allowance to transfer an ERC-20 token from the socket. The token's approve is called for the spender and amount. Set the amount to max for an unlimited allowance. Most write actions here handle their own approvals; this is for contracts they do not cover. Reach for it before calling into a protocol that pulls tokens on its own, or pair it with the revoke action so an allowance opened at the start of a transaction is closed at the end.

Approve Spending

plug
evm
6actions
  1. 1·Take

    Take opens by declaring token, a caller parameter naming the ERC-20 asset this plug reads and approves at execution time.

  2. 2·Get token balance

    Drawing on the token from slot 0.0, the balance held by Your Wallet is read, capturing the current holding for that address.

  3. 3·Bubble

    Surfacing that measured balance as an output of this plug hands the figure back to the caller.

  4. 4·Take

    A second parameter, amount, is declared for the caller to supply, sizing the allowance to grant.

  5. 5·Take

    Following that, spender_address is declared as a caller parameter, naming the address that receives the allowance.

  6. 6·Approve spending

    Granting the spender_address an allowance of amount for the token wired from slot 0.0, this action lets that spender transfer the ERC-20 from the socket.

Take
Get balance of held by
Bubble
Take
Take
Approve for
  • Approve Spending

    plug
    evm