RevokeCash / revoke.cash

❌ Revoke or update your token approvals
https://revoke.cash
MIT License
678 stars 237 forks source link

Delegations Dashboard #188

Open rkalis opened 9 months ago

rkalis commented 9 months ago

This suggestion came from WiiMee:

There are several services used for "wallet delegations", such as Delegate.xyz and Warm.xyz. It would be useful to have a "Delegations" tab next to Approvals and Signatures which displays a list of delegations for a wallet with the option to revoke the delegations.

I don't know enough about how these delegations work in particular to know how viable this is, but I think it is definitely a good idea to explore it.

rkalis commented 2 months ago

Delegate.xyz v1 has contract view functions that return lists of given delegations (cold -> hot wallet): https://etherscan.io/address/0x00000000000076a84fef008cdabe6409d2fe638b#readContract

Delegate.xyz v2 has view functions that return lists of given and received delegations (cold <> hot wallet): https://etherscan.io/address/0x00000000000000447e69651d841bd8d104bed493#readContract

Warm.xyz has view functions that return a single given delegation or a list of received delegations (cold <> hot wallet): https://etherscan.io/address/0xc3aa9bc72bd623168860a1e5c6a4530d3d80456c#readProxyContract

So it looks like we can definitely display given delegations for all of these platforms with just a few smart contract calls. We should also be able to display received delegations for Delegate v2 and Warm easily, but not for Delegate v1. From a security perspective, inspecting / revoking given delegations is the important part in any case.

If we wanted full support for given + received delegations and/or if we wanted to display delegations/revokals in a future "History" tab, then we may need to look at Delegation events as well.

rkalis commented 2 months ago

My idea around implementation for this would be that we create a "DelegationsPlatform" class similar to the "Chain" class, which can be instantiated with a "name" and a "getter" function. Alternatively we could also create it in a way that looks closer to the PriceStrategy, where each platform gets its own subclass.