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

Clarify Deposit Contract Bytecode Generation #2052

Closed
q9f opened this issue Sep 11, 2020 · 4 comments · Fixed by #2056
Closed

Clarify Deposit Contract Bytecode Generation #2052

q9f opened this issue Sep 11, 2020 · 4 comments · Fixed by #2056

Comments

@q9f
Copy link
Contributor

q9f commented Sep 11, 2020

The deposit contract hosted by @axic had a version of the byte-code that was formally verified.

I was able to deploy the contract bytecode to Goerli for the Medalla testnet launch and publish/verify the source-code on Etherscan: https://goerli.etherscan.io/address/0x07b39F4fDE4A38bACe212b546dAc87C58DfE3fDC#code

Now we have the contract and some bytecode in this respository as version r2 (#2019) but I cannot figure out which solidity version and parameters were used to compile the give bytecode.

I tried solidity compiler version 0.6.11 with 5000000 optimizations but ended up with a bytecode mismatch.

https://goerli.etherscan.io/address/0x48b597f4b53c21b48ad95c7256b49d1779bd5890#code

If possible, could we add these parameters to the contract subdirectory readme file? Is this bytecode the final one for the deposit contract?

@axic
Copy link
Member

axic commented Sep 11, 2020

The original source had a Makefile showing all the settings. I believe what you may be missing is --metadata-literal. I'm not sure if these are not present in the main makefile of eth2.0-specs, but I see it is not in the contract repository.

@hwwhww
Copy link
Contributor

hwwhww commented Sep 12, 2020

@hwwhww
Copy link
Contributor

hwwhww commented Sep 12, 2020

If possible, could we add these parameters to the contract subdirectory readme file? Is this bytecode the final one for the deposit contract?

Good point. I will update the subdirectory README.

@q9f
Copy link
Contributor Author

q9f commented Sep 14, 2020

Yes, I found the parameters, but which solidity version was used?

Edit, apparently, I set the optimization runs to 5000000 but forgot to check "Optimized: Yes." 🤦

Sorry for the buzz. So the answer is:

    Compiler Version: v0.6.11+commit.5ef660b1
    Optimization Enabled: 1
    Runs: 5000000

Edit - verified: https://goerli.etherscan.io/address/0x48b597f4b53c21b48ad95c7256b49d1779bd5890#code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants