Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proxies: Load additional candidates from recent transactions? #84

Open
SonOfMosiah opened this issue Jan 30, 2024 · 4 comments
Open

proxies: Load additional candidates from recent transactions? #84

SonOfMosiah opened this issue Jan 30, 2024 · 4 comments
Labels
bug Something isn't working soon Planned, targeting a near-future release

Comments

@SonOfMosiah
Copy link
Contributor

Failed to get function selector from proxy: 0x54e3f31b

@SonOfMosiah
Copy link
Contributor Author

@shazow shazow added the soon Planned, targeting a near-future release label Jan 31, 2024
@shazow
Copy link
Owner

shazow commented Jan 31, 2024

Nice, thank you! I'm going to be sprinting on these next week I think, but might get to it earlier.

@shazow shazow added the bug Something isn't working label Jan 31, 2024
@shazow
Copy link
Owner

shazow commented Feb 2, 2024

Okay, had some time to investigate what's going on here: They have their own custom proxy, selectors are set in setImplementation but the selector gets stored in an internal mapping(bytes4 => address) internal selectorVsRouter and unlike DiamondProxy there is no array of registered selectors that we can enumerate.

Which is to say, aside from the ABI uploaded to Etherscan, there's no plain-RPC way to determine which selectors have been registered (unless we have an archival node then we could try to find all of the calls to setImplementation).

That is to say, I don't think whatsabi will be able to resolve these proxy selectors blind, but whatsabi should be capable of fetching the uploaded ABI.

Looks like the mistake is when whatsabi.autoload detects that there's a proxy, it goes into code-based detection rather than still checking if there's an ABI to fetch. (Are uploaded ABIs always include the proxy? I feel like they often don't? What's the correct behaviour here for autoload?)

@shazow
Copy link
Owner

shazow commented Feb 2, 2024

Actually, the proxy selectors aren't in the ABI (since otherwise it would violate the verification).

So Etherscan must be grabbing selectors from recent transactions. I could add a helper for that, but not sure if it's a good idea for default behaviour?

@shazow shazow changed the title bug test case: arb: 0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57 proxies: Load additional candidates from recent transactions? Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working soon Planned, targeting a near-future release
Projects
None yet
Development

No branches or pull requests

2 participants