-
Notifications
You must be signed in to change notification settings - Fork 15
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
Enable to call implementation contract from a proxy contract #964
Comments
For proxies that respect EIP-1967 the storage slot at which the implementation contract address(or Logic contract as referred to in the EIP doc) is stored at For example the proxy contract curl https://mainnet.hashio.io/api \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getStorageAt","params":["0xb177cf10f4382f671e5923c6c06f7b601d5a04e2", "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc", "latest"],"id":1,"jsonrpc":"2.0"}' {
"result": "0x0000000000000000000000000e44f5cdabefe34d5b729acfa0a79971ffbc0e7e",
"jsonrpc": "2.0",
"id": 1
} Also, the proxy admin contract address storage slot is curl https://mainnet.hashio.io/api \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getStorageAt","params":["0xb177cf10f4382f671e5923c6c06f7b601d5a04e2", "0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103", "latest"],"id":1,"jsonrpc":"2.0"}' {
"result": "0x00000000000000000000000051803f621c5e90011de58b57fd5b7a92e0e39b08",
"jsonrpc": "2.0",
"id": 1
} IMU the mirror node explorer is stateless so this might be a feature to implement on sourcify(or hedera's fork of it), i.e. expose an endpoint to determine and register an EIP-1967 compliant proxy and its logic, beacon and admin contracts. |
created an issue on sourcify |
@mshakeg thanks for the technical insight 👍 |
Note that mirror node provides |
@ericleponner yes, but you'll have to make a mirror node call for every contract to check if it is an ERC-1967 proxy contract which isn't the case for almost all contracts which is a bit wasteful. A cleaner solution imo would be for a backend service(say sourcify) to add some contract metadata for proxy information, then when the mirror node explorer makes a request to sourcify to get a contract that proxy metadata if present is returned, similar to what was described in my sourcify issue, this will probably take a while for the sourcify team to implement, so your approach will work for a quick resolution. |
@mshakeg |
@ericleponner no it does not, the admin contract updates the implementation address in the proxy contract. |
Hi @ericleponner and @svienot can you also please add auto-verification(and view&write calls) support for minimal clone proxies(provided the implementation is verified)? The implementation contract for a minimal clone proxy can be extracted as follows: curl -X POST -H "Content-Type: application/json" --data '{
"jsonrpc":"2.0",
"method":"eth_getCode",
"params":["0xc0f4d92437d6549ac5ac6544b21dee9903fd4c74", "latest"],
"id":1
}' https://mainnet.hashio.io/api response:
The address can be extracted from the result as follows:
i.e. |
@ericleponner @svienot just a friendly nudge on my last reply regarding clone proxies |
Hi @mshakeg |
@ericleponner I already did over here The proxy is:
The implementation(extracted from the above proxy) is:
|
@mshakeg |
Problem
This is a follow-up of this request.
Solution
There are some ways to:
but these are both heuristic and need to be investigated.
May be a first approach could be to rely on user's knowledge:
user could be asked to provide id/address of the implementation contract before calling implementation methods from the proxy. Feedback is welcome.
Alternatives
No response
The text was updated successfully, but these errors were encountered: