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

Partial Incompatibility with Blockscout #21

Open
ckoopmann opened this issue Dec 17, 2023 · 0 comments
Open

Partial Incompatibility with Blockscout #21

ckoopmann opened this issue Dec 17, 2023 · 0 comments
Milestone

Comments

@ckoopmann
Copy link
Contributor

While trying to implement a cast command to migrate a contract verification from on explorer to another (specifically from etherscan to blockscout), I encountered the issue that the contract_source_code and submit_contract_verification methods fail when run against blockscout. (more specifically against "https://eth.blockscout.com/api".

I created tests reproducing the issue for contract_source_code and submit_contract_verification.

Judging from the error messages (see screenshots), the former issue seems to be a pretty strait forward deserialziation issue whereas the latter has a pretty cryptic error message.
image
image

Evalir added a commit that referenced this issue Dec 21, 2023
…lockscout (#22)

[Blockscouts](eth.blockscout.com) response upon requesting a contracts
source code diverges from that of etherscan and is thereby incompatible
with the current serde deserialization schema:
1. Use "true" / "false" instead of "1"/"0" for various binary fields
(e.g. "OptimizationUsed")
2. Different naming of certain fields (e.g. "IsProxy" vs. "Proxy")
3. Omitting fields entirely when data would be empty instead of
returning an empty string (e.g. "ConstructorArguments").

For reference compare the
[blockscout](https://eth.blockscout.com/api?module=contract&action=getsourcecode&address=0x00000000219ab540356cBB839Cbe05303d7705Fa)
and
[etherscan](https://api.etherscan.io/api?module=contract&action=getsourcecode&address=0x00000000219ab540356cbb839cbe05303d7705fa)
example response for the ETH deposit contract.

This PR fixes that by adjusting the serde deserialization options
accordingly.

This partially addresses
#21

---------

Co-authored-by: Enrique Ortiz <[email protected]>
@zerosnacks zerosnacks added this to the v1.0.0 milestone Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants