Summary
Approvals are required because Matcha is a decentralized exchange (DEX) that uses the Ethereum blockchain to settle trades.
Approvals on v4 are required once per token, per wallet, and require a small amount of ETH to pay for the transaction.
Learn more about the benefits of 0x Protocol v4 here
Why are token approvals necessary?
When using a DEX, like Matcha, you must first approve each token that you plan to trade. DEXs use smart contracts on the Ethereum blockchain to execute transactions. To use a smart contract, you must 1) permit it to validate your token balance, and 2) allow it to transfer the number of tokens that you wish to trade from your wallet.
As a real-life example, think of the token approval process similar to an artist (user) selling their artwork (token) in a gallery (Matcha). Before an artist can display their artwork at the gallery, the artist first needs to prove that they own it. Then both parties will sign a contract that gives the gallery permission to display and sell the artwork on behalf of the artist
Permit2 standard
Matcha utilizes the Permit2 standard for its token approvals. Permit2 is a smart contract standard that addresses some of the challenges of wallet permissions and approvals to protect your crypto. Through Permit2, users only have to approve one smart contract that handles sub-approvals for other contracts.
βBenefits of token approvals with Permit2 include:
set expiry periods, eliminating manual revocation needs, thus minimizing risk.
gasless approval for all tokens.
Drawbacks include:
The Permit2 system is very flexible and allows for granting approvals for multiple tokens at once, which can make it harder for users to understand what they are approving.
this behavior can be used by malicious actors to trick users into granting approvals that they don't understand.
Overall, the Permit2 standard provides users with more security and reduces risk with exposed token allowances.
To learn more about Permit2, visit our blog post!
Cross Chain Swaps & Approvals
Like with Market and Limit orders, a token approval is required for a Cross Chain Swap to validate the allowance for the specific trade. The default amount we give to your wallet is the amount for the transaction, but you can always increase it if you want to in your wallet.
Each approval will require a small amount of native token for that chain, so please ensure you have some in your wallet before proceeding with the trade.
Matcha puts user safety first
Matcha uses the 0x Protocol v4 smart contacts, which have been thoroughly tested by 0x Labs and top blockchain security company, ConsenSys Diligence.
Learn more
π Recommended reading to learn more about the ERC-2O standard and token approvals: