A token approval is a common transaction type that you'll frequently encounter when using Ethereum and other similar blockchains. A token approval allows a decentralized application to move a specific type of token from your wallet.
When using Ethereum or other blockchain networks, multiple smart contracts will likely have your approval to spend tokens from your wallet.
While this is usually not a cause for concern, it's advisable to periodically check your smart contract approvals and revoke any that you no longer need or find suspicious.
In this article, we will guide you through the process of checking and revoking token and smart contract approvals on MetaMask, and also highlight some alternative methods for revoking approvals.
Understanding token & smart contract approvals
A token approval is a common transaction type that you will frequently encounter when using Ethereum and other similar blockchains. A token approval essentially allows a decentralized application to move a specific type of token from your wallet.
For example, if you want to use a decentralized exchange like Uniswap, you will be required to approve Uniswap's smart contract and give it the ability to take tokens from your wallet in order to execute trades.
It's important to keep in mind that a token approval is an on-chain transaction and therefore requires a gas fee to be paid. Revoking a token approval is also an on-chain transaction and also requires a fee.
When confirming a token approval, you will have the ability to specify a spending cap, which is the limit of how many tokens the DApp can access before it has to ask for your approval again.
Signing smart contract permissions is a necessary step for interacting with many types of decentralized applications, but comes with serious risks. If you give approval to a malicious smart contract, it could steal tokens from your wallet.
It's very important to note that there is a difference between revoking a smart contract / token approval and disconnecting your wallet from a DApp. If you want to remove a decentralized application's ability to access your tokens, you need to revoke its approval - simply disconnecting your wallet from the DApp is not enough.
Periodically checking your smart contract or token approvals is a good practice - you can revoke approvals for smart contracts you no longer intend to use or don't trust anymore.
How to revoke permissions on MetaMask?
We'll show you how you can easily revoke smart contract or token permissions using the MetaMask Portfolio feature.
Let's start off by going to the MetaMask Portfolio app and connecting our wallet. In the "Overview" section, you should be able to see the token balances of the accounts you have connected.
Then, head over to the "Spending Caps" tab. As we can see, we have approved two smart contracts to spend tokens from our wallet. One is related to the decentralized exchange aggregator 1inch, while the other is related to the dYdX decentralized trading platform.
Let's say that we want to revoke the approval of the dYdX smart contract. Click the "Revoke" button next to the contract you wish to revoke.
Then, approve the transaction to revoke the permission. Please keep in mind that revoking a token or smart contract approval is an on-chain transaction and you will need to pay a gas fee to do it.
Other methods of revoking smart contract / token permissions
There are also multiple other ways of revoking smart contract or token permissions that you might find more useful than MetaMask portfolio. We'll show you how you can revoke permissions using a block explorer or the revoke.cash website.
Use a block explorer such as Etherscan or BscScan
The Etherscan block explorer has a very handy feature that allows you to check your existing approvals and revoke them if you wish to do so.
First, head over to Etherscan's token approval tool. Then, click "Connect to Web3" to connect your wallet. We'll be using our MetaMask wallet in this example.
Then, Etherscan will display your existing token approvals. You can sort the list by ERC-20, ERC-721 and ERC-1155 token approvals.
In order to revoke an approval, simply click "Revoke" next to the approval you want to revoke. Then, your MetaMask browser extension will pop up with a screen where you will be able to sign the transaction. Keep in mind that you will have to pay a gas fee if you want to revoke a token approval.
Use revoke.cash
Another popular way to revoke token / smart contract approvals is revoke.cash. Go to the revoke.cash website and connect your wallet. The platform supports a wide range of wallets, including MetaMask.
點擊您想要撤銷的批准旁邊的“撤銷”,您的 MetaMask 錢包將彈出批准交易的選項。然後,您可以透過MetaMask撤銷合約。
revoke.cash 的一個方便功能是,它會向您顯示每個代幣批准的時間。這是快速查找您不再使用並因此可能想要撤銷的令牌批准的好方法。
Revoke.cash 也會告訴
The above is the detailed content of How to Check and Revoke Token & Smart Contract Approvals on MetaMask. For more information, please follow other related articles on the PHP Chinese website!