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

Different bytecode Hardhat vs Sourcify #1065

Closed
kuzdogan opened this issue Jun 16, 2023 · 5 comments
Closed

Different bytecode Hardhat vs Sourcify #1065

kuzdogan opened this issue Jun 16, 2023 · 5 comments
Labels
🪲 bug Something isn't working

Comments

@kuzdogan
Copy link
Member

kuzdogan commented Jun 16, 2023

We were reported a case when the compiled bytecodes end up different when compiled with Hardhat and with Sourcify. I suspect this is a case of ethereum/solidity#14250

meter-2707667c8a3e7035bf25c34ad0a1ec81.json.txt

Chain: Meter (82) Address: 0x07FfD62571b586dCA7eA1DC71C10a6270e078F01 Contract: N2MERC721

Onchain vs recompiled runtime bytecodes: 82-0x07FfD62571b586dCA7eA1DC71C10a6270e078F01-recompiled-deployed.txt 82-0x07FfD62571b586dCA7eA1DC71C10a6270e078F01-onchain-deployed.txt

They are different in many places:

git diff --word-diff --word-diff-regex=. 82-0x07FfD62571b586dCA7eA1DC71C10a6270e078F01-onchain-deployed.txt 82-0x07FfD62571b586dCA7eA1DC71C10a6270e078F01-recompiled-deployed.txt

image

View in Huly HI-479

@kuzdogan
Copy link
Member Author

I can confirm this gets resolved with useAllSources i.e. using all other sources provided alongside the contract.

However the bad news is this is not the ethereum/solidity#14250 case because I was able to reproduce the issue in 0.8.21 whereas the above issue must have been fixed in 0.8.21.

This looks similar to #618 because the metadata hashes are identical but the bytecodes are different. However, that specific case must also have been fixed in 0.7.1. So I suspect this is yet another bug in Solidity

@kuzdogan
Copy link
Member Author

Opened an issue in Solidity ethereum/solidity#14494

@marcocastignoli
Copy link
Member

I'm handling this cases in this way, if you also think is enough we can close this:

Screenshot 2023-11-22 alle 10 26 39

@kuzdogan
Copy link
Member Author

Does this handle the example case above? Does the test pass?

@marcocastignoli
Copy link
Member

fixed with f1be629

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@marcocastignoli @kuzdogan and others