Overview
Token approvals are common when interacting on Web3 platforms since they allow decentralized applications (dApps) and smart contracts to move tokens on your behalf. To complete an operation, such as swapping tokens or selling NFTs on a marketplace, dApps and smart contracts need permission from the token holder. If the dApp or smart contract has permission, the transaction can be completed.
There are two different types of token approvals:
- Approve transactions
- Permit allowances
Approve transactions
Approve transactions call an approve function that allows another address to spend tokens on behalf of the signer. In order to execute an operation from a dApp or smart contract, you must first sign an Approve transaction that gives the dApp or smart contract permission to move your funds. Then you can sign the transaction for the actual operation, such as a token swap, in which the contract transfers the required amount of funds. Note that gas fees are paid for each transaction.
Typically, creating an Approve transaction from a dApp allows transferring an unlimited amount of tokens. The dApp’s smart contract is then allowed to transfer an unlimited amount of the user’s tokens. Although this reduces the need to create additional Approve transactions in the future, it poses a potential security risk. Fireblocks recommends setting an amount cap for your Approve transactions.
Approve transactions are sent to your Fireblocks mobile app for signing like any other transaction. You can tap on the transaction information to see more details included in the transaction message.
Permit allowances
Permit allowances use the Permit function to allow dApps and smart contracts to move your tokens. Permit allowances can combine the token approval and the actual operation into one transaction. This method helps you save money since you only pay gas fees once.
Fireblocks supports the following permit allowance formats:
- Permit
- Permit2 (permit single, permit batch)
- Generic EIP
Permit message signatures are sent to your Fireblocks mobile app for signing like any other transaction. You can tap on the transaction information to see more details included in the transaction message.