Token Approval

Token Approval for EVM and Tezos

Improve user experience by limiting transaction signing with Token Approval. Instead of signing every individual transaction, users can set a 'payment limit' of tokens that can be spent without continually requesting user approval. Until the payment limit is reached, users do not need to sign another transaction.

EVM Token Approval

ERC-20


An ERC-20 token approval is a method of allowing a smart contract or another address to withdraw funds from the address sending the transaction.

Tweed SDK identifies that an ERC-20 token approval transaction is being sent and generates a dedicated UI for the user to approve or reject it. In addition, the user can edit the spending cap. The platform can create a default value for token approval.

Code example:
const provider = new ethers.providers.Web3Provider(tweedProvider)
const signer = provider.getSigner()
const contract = new ethers.Contract(
  'ERC20_CONTRACT_ADDRESS',
  ['function approve(address spender, uint256 amount) public returns (bool)'],
  signer,
)
await contract['approve']('SPENDEE_WALLET_ADDRESS', 'LIMIT_DEFAULT')

Tezos Token Approvals

FA1.2


There are two relevant functions in the FA1.2 standard:

  1. Approve - Allows a token holder to approve a delegate who can transfer a specified amount of tokens on their behalf.

  2. Get_allowance - Lets users query the amount of tokens that a delegate is approved to transfer.

Tweed automatically detects a transaction that requests the FA1.2 contract for approval and shows the user the Approval widget.

Last updated