Managing Contract Privileges
Just as it is important to know how to give permissions to smart contracts to access your funds, it’s equally, if not more important to know how much of your funds you are giving the smart contract access to.
When an attempt is made to approve a particular smart contract’s access to funds, you should see the following window. In this window, we can see that the website is attempting to gain access to our CRYSTL.
When this page first loads up, the “Permission” menu is pulled up. If you expand "View Transaction details" this will drop down another menu that will let you see how much of your funds the contract is asking for access to (it’s usually infinite for convenience sake).
Let’s say however, one wants to limit the amount of tokens that the contract has access to, what would we have to do then? It’s quite simple.
By dropping down the menu and seeing the full transaction details, one can edit the permission to a finite amount. You can see this button on the image below
When you click edit, the menu to adjust the permission will appear, and you can change it to any value of your choosing. It is worth noting that withdrawals are subject to the same permission, so if you set the amount too low, you may need to re-approve the contract to withdraw your funds.
Once you’ve connected your wallet to the platform by clicking the “Connect Wallet” button in the center, you can navigate to the more tab and activate the drop down menu, then select “Token Approvals”
This will take you to a list of all of the contracts that have the rights to spend your tokens, and whether or not the permission is limited, or unlimited.
Above, you can see that I have both a limited and an unlimited spend amount for two different tokens, TITAN and SLP. It is as simple as clicking “revoke” and confirming this action in your wallet to remove this contract's ability to spend your tokens.
It’s worth noting, that if you enter the transaction ID or “hash” on Polygon (MATIC) Blockchain Explorer, and click “Click to see more”, and decoding the input data of the transaction, one can see the following, which shows the given smart contract, and its approved amount set to “0”.
This guide is for everyone, both beginners and experienced, especially if you dabble in new farms or projects that have launched recently, where you might not get the best feeling about the legitimacy of the project. Revoking the rights to spend your tokens allows you to minimize the ability for Smart Contracts on those less than legit platforms to act maliciously, while having access to all of the allowed tokens in your wallet.