RevokeCash / revoke.cash

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

Extend the exploit checker to also detect if you were *previously* at risk #211

Closed rkalis closed 1 month ago

rkalis commented 6 months ago

Currently the exploit checker tells you whether you are safe or at risk right now. But it doesn't tell you anything about the past.

Since we know all previous Approval events we can see whether they have ever given an approval to the affected spenders, and then show a separate message in that case.

JeffreyJoel commented 6 months ago

Hi @rkalis, I would love to work on this, but I would need a bit more clarity on how to do this

rkalis commented 6 months ago

Hey @JeffreyJoel, that's awesome. In AddressPageContextProvider.tsx there is a hook called useAddressEvents. This hook makes the results of the useEvents hook available to the application.

The useEvents hook returns a list of event logs for these categories: { transferFrom, transferTo, approval, approvalForAll, permit2Approval }. The logs of type approval, approvalForAll and permit2Approval would need to be checked to see if they give a token approval to any of the exploit's affected addresses. You can take a look at the ABIs in abis.ts file to see how to decode the events.

Let me know if you have any other questions or if it's still unclear!

JeffreyJoel commented 6 months ago

Okay, I will begin working with this.

Dozie2001 commented 3 months ago

@JeffreyJoel are you still on this? want to work on it

rkalis commented 3 months ago

Hey @Dozie2001, it's been a few months since @JeffreyJoel's last reply, so feel free to try to tackle this issue!

JeffreyJoel commented 3 months ago

I'm just seeing this. I'm very sorry I was unable to continue working on this issue due to a few issues on my end. I'm very sorry for holding up the progress.

rkalis commented 3 months ago

I'm just seeing this. I'm very sorry I was unable to continue working on this issue due to a few issues on my end. I'm very sorry for holding up the progress.

No problem at all! Thanks for the initial effort in any case!