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

Verify contract using creation tx input/int tx init code #3106

Merged
merged 4 commits into from
May 18, 2020

Conversation

vbaranov
Copy link
Member

@vbaranov vbaranov commented May 13, 2020

#3105 #3108 #3110 #3111

Motivation

BlockScout verifies contracts by checking deployed bytecode stored at address, but in some cases it doesn't match deployed_byte_code_from_the_comilation + encoded_constructor_arguments. The suggestion is to compare init bytecode with the code from transaction input or from internal transaction init code.

Changelog

Checklist for your Pull Request (PR)

@vbaranov vbaranov added the wip label May 13, 2020
@vbaranov vbaranov self-assigned this May 13, 2020
@coveralls
Copy link

coveralls commented May 13, 2020

Pull Request Test Coverage Report for Build b151b2a7-0c5a-4045-a89a-2e2687c994d0

  • 46 of 62 (74.19%) changed or added relevant lines in 4 files are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.04%) to 75.151%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/explorer/lib/explorer/smart_contract/verifier.ex 19 26 73.08%
apps/explorer/lib/explorer/smart_contract/verifier/constructor_arguments.ex 16 25 64.0%
Files with Coverage Reduction New Missed Lines %
apps/explorer/lib/explorer/smart_contract/verifier/constructor_arguments.ex 1 83.7%
apps/block_scout_web/lib/block_scout_web/controllers/chain/market_history_chart_controller.ex 2 71.43%
Totals Coverage Status
Change from base Build 2a6e8361-e441-441c-b2a6-093b2b57b776: 0.04%
Covered Lines: 5710
Relevant Lines: 7598

💛 - Coveralls

@vbaranov vbaranov force-pushed the vb-immutable-constant-verification-fix branch 16 times, most recently from 96dfa73 to bee72d9 Compare May 14, 2020 19:29
@vbaranov vbaranov changed the title Verify contract using creation tx input Verify contract using creation tx input/int tx init code May 14, 2020
@vbaranov vbaranov force-pushed the vb-immutable-constant-verification-fix branch from bee72d9 to 88c61f2 Compare May 14, 2020 20:06
@vbaranov vbaranov removed the wip label May 14, 2020
@vbaranov vbaranov merged commit db4fa25 into master May 18, 2020
@vbaranov vbaranov deleted the vb-immutable-constant-verification-fix branch May 18, 2020 10:24
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

Successfully merging this pull request may close these issues.

None yet

2 participants