Token Approval Patterns and How DeFi Wallet
Integration Handles Them

Token approvals are one of the most common sources of user confusion and security risk in DeFi applications, and handling them correctly in the wallet integration is important for both user experience and protocol security. When a DeFi protocol needs to move ERC-20 tokens on behalf of a user, the ERC-20 standard requires the user to first approve the protocol contract to spend up to a specified amount of their tokens. This approval is a separate transaction from the primary protocol interaction, and the wallet integration needs to detect whether an existing approval exists and whether it covers the amount needed for the current interaction before deciding whether to prompt the user for a new approval transaction.

27 Blockchain's DeFi wallet integration handles the full approval lifecycle as part of the standard transaction management scope. The integration checks existing approval levels against the current interaction's requirements, initiates a new approval transaction only when necessary, and manages the sequencing between the approval transaction and the primary interaction to ensure that the primary interaction is not attempted before the approval is confirmed on chain. For protocols that use infinite approval patterns to reduce the number of approval transactions users encounter, 27 Blockchain also addresses the security considerations of infinite approvals in the integration's smart contract audit scope, ensuring that the approval pattern used does not expose users to unnecessary risk if the protocol contract is later compromised.

Back ↵