Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: adaseb on March 17, 2023, 08:28:20 PM



Title: Defi - How do I remove the "Approve to spend" contract
Post by: adaseb on March 17, 2023, 08:28:20 PM
I am playing around with certain defi's like Uniswap. When I want to swap a token, it asks me to approve a function which allows spending for a certain token such as "USDT". So I approve this and then I can make a swap with another token such as swapping USDT for WBTC.

However for security issues, is it possible to remove this "Approve to spend all my USDT"? Or is it not possible?

Do I just send all my left over USDT to a new address or do I need to make a completely new wallet and send it there?


Title: Re: Defi - How do I remove the "Approve to spend" contract
Post by: logfiles on March 17, 2023, 10:43:28 PM
I believe you are using Metamask, Right?

If so, then this article might be helpful - https://support.metamask.io/hc/en-us/articles/6055177143579-How-to-customize-token-approvals-with-a-spending-cap

Do I just send all my left over USDT to a new address or do I need to make a completely new wallet and send it there?
This won't be necessary if you set the spending cap as instructed.


Title: Re: Defi - How do I remove the "Approve to spend" contract
Post by: dzungmobile on March 18, 2023, 08:23:40 AM
I am playing around with certain defi's like Uniswap. When I want to swap a token, it asks me to approve a function which allows spending for a certain token such as "USDT". So I approve this and then I can make a swap with another token such as swapping USDT for WBTC.

However for security issues, is it possible to remove this "Approve to spend all my USDT"? Or is it not possible?

Do I just send all my left over USDT to a new address or do I need to make a completely new wallet and send it there?
You can revoke smart contract access with https://app.unrekt.net/


Title: Re: Defi - How do I remove the "Approve to spend" contract
Post by: dansus021 on March 18, 2023, 10:45:05 AM
You can revoke smart contract access with https://app.unrekt.net/

This guy was right if you want to revoke smart contract access is using that website or this https://allowance.beefy.finance/

If you play with DeFi you can actually limit before approving the smart contract or do any transcation the example is here

https://i.ibb.co/44D85MY/1.png (https://imgbb.com/)
Click edit permission and

https://i.ibb.co/RSdQTQw/1.png (https://imgbb.com/)

and fill desired amount of token

Although if the cap is filled you need to reapprove the contract before make any transaction and you know approving contract need a fee

and yes make sure the website of DeFi and the smart contract because there is fake site and fake smart contract out there


Title: Re: Defi - How do I remove the "Approve to spend" contract
Post by: dzungmobile on March 18, 2023, 11:56:01 AM
You can revoke smart contract access with https://app.unrekt.net/

This guy was right if you want to revoke smart contract access is using that website or this https://allowance.beefy.finance/

If you play with DeFi you can actually limit before approving the smart contract or do any transcation the example is here
Some DeFi projects build their revoke tool for their users but the site I shared is the first one I knew about that feature.

Today one member shared https://revoke.cash/ but I never used it and I am curious about its safety. I don't want to put myself at risk by curiously trying new websites.


Title: Re: Defi - How do I remove the "Approve to spend" contract
Post by: joniboini on March 19, 2023, 12:38:59 AM
Today one member shared https://revoke.cash/ but I never used it and I am curious about its safety. I don't want to put myself at risk by curiously trying new websites.
If I remember correctly features like this already exist on Etherscan. You can access the guide at https://info.etherscan.com/tokenapprovals/. So, there is no need to use another third-party website as long as you visit the right Etherscan website.

That being said, as long as the website is open source and you can verify/build it on your own, I think it is fine to use them if you don't find any malicious code. Relying too much on Etherscan is also not a good idea in the long run, but at the same time, trusting some new random websites is not a good idea either.

Hopefully, there is a better solution other than manually removing approval, such as automatic revoke that cost nothing other than a signature to prevent token draining or something similar. Spending a lot of gas to approve and re-approve is such a pain if you use ETH regularly.


Title: Re: Defi - How do I remove the "Approve to spend" contract
Post by: dzungmobile on March 20, 2023, 06:52:01 AM
A decent practical guide on coinmarmetcap.

https://coinmarketcap.com/alexandria/article/3-minute-tips-how-to-revoke-token-approval-following-opensea-s-latest-security-episode

It references to
https://etherscan.io/tokenapprovalchecker
https://revoke.cash/
https://app.unrekt.net/


Title: Re: Defi - How do I remove the "Approve to spend" contract
Post by: adaseb on March 20, 2023, 04:47:20 PM
Thanks everybody that replied. I actually tried googling the topic but came out with nothing. I did it the old fashion way and just sent everything to a new wallet to be safe.

I think the best way to do this is to limit how much the smart contract can spend, because allowing it to spend all the tokens is a security risk. Either way in the future I will check out those links and revoke any contracts that I signed.