Inspiration

Current solutions for browsing and revoking ERC20 approvals (e.g. revoke.cash, etherscan’s tool) are quite cumbersome to use, as they require users to:

  • connect manually to each address in their wallet
  • remember to update connections with each new added address
  • switch accounts and approve each transaction separatly when revoking multiple allowances

By leveraging special status of Snaps inside Metamask it should be possible to:

  • present only one prompt to user to get access to all current and future accounts (with notable exception of hardware wallets)
  • revoke all approvals from all current accounts in batch, with no need for separate confirmations and accounts switching
  • actively monitor all user accounts (including those on hardware wallets) for new approvals and display notification to user when detected.

What it does

On installing the RevokeSnap, the web UI will automatically fetch the parent key from users Metamask and generate a number of accounts, perform a check for leftover approvals and, once the search is complete, expose a button to revoke all identified approvals. On the click of a button the snap will issue a series of transactions corresponding to the leftover approval to zero them out one by one. As the Snap already is in possession of the generated wallets private keys this does not require any additional confirmation from the user, beyond the initial one.

Challenges we ran into

  • We would prefer for UI to live inside Metamask popup
  • Hardware wallets can't be used for batch revocation
  • Testing and debugging Snaps is slow due to lack of in-snap log console
  • eth_accounts call was not straightforward to implement
  • only 2 options for Snap execution time (60s or Inf)

What's next for RevokeSnap

  • Active notifications for active monitoring of new token approvals.
  • More robust approval fetchin
  • More robust revoke batching system (multicall / in one block)

Bounties

We're submitting for the following bounties:

  • Metamask Snaps
  • ETHWarsaw Foundation

Github link

https://github.com/SwixJedi/revokesnap

YouTube video

https://youtu.be/z3_Okkp8NHw

Built With

Share this project:

Updates