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

Fix verification of contracts created from factory #3115

Merged
merged 1 commit into from
May 18, 2020

Conversation

vbaranov
Copy link
Member

@vbaranov vbaranov commented May 18, 2020

Fixes #3108

Motivation

2020-05-18T12:30:39.169 [error] Task #PID<0.9944.1> started from #PID<0.11593.4> terminating
** (Ecto.MultipleResultsError) expected at most one result but got 2 in query:

from i0 in Explorer.Chain.InternalTransaction,
  where: i0.created_contract_address_hash == ^"0x5933331BB25aAc7fF7BBb22e4E35F65D5882e621",
  select: i0.init

    (ecto 3.3.1) lib/ecto/repo/queryable.ex:104: Ecto.Repo.Queryable.one/3
    (explorer 0.0.1) lib/explorer/chain.ex:2743: Explorer.Chain.smart_contract_creation_tx_bytecode/1
    (explorer 0.0.1) lib/explorer/smart_contract/verifier.ex:95: Explorer.SmartContract.Verifier.compare_bytecodes/6
    (elixir 1.10.2) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
    (explorer 0.0.1) lib/explorer/smart_contract/publisher.ex:29: Explorer.SmartContract.Publisher.publish/3
    (explorer 0.0.1) lib/explorer/smart_contract/publisher_worker.ex:13: Explorer.SmartContract.PublisherWorker.perform/1
    (elixir 1.10.2) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
    (stdlib 3.9) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: #Function<3.104694414/0 in Que.Job.perform/1>

Changelog

Find contract creation internal transactions only from success transaction

Checklist for your Pull Request (PR)

@vbaranov vbaranov self-assigned this May 18, 2020
@vbaranov vbaranov force-pushed the vb-fix-verification-from-int-txs branch 2 times, most recently from 8b9bddc to 253557e Compare May 18, 2020 13:24
@coveralls
Copy link

coveralls commented May 18, 2020

Pull Request Test Coverage Report for Build d1595d59-0662-41fa-9469-d086d165137d

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.05%) to 75.151%

Files with Coverage Reduction New Missed Lines %
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 2c071f50-d19d-4090-beb4-aef851452080: 0.05%
Covered Lines: 5710
Relevant Lines: 7598

💛 - Coveralls

@vbaranov vbaranov force-pushed the vb-fix-verification-from-int-txs branch from 253557e to a1e9e6f Compare May 18, 2020 13:35
@vbaranov vbaranov merged commit 192318c into master May 18, 2020
@vbaranov vbaranov deleted the vb-fix-verification-from-int-txs branch May 18, 2020 14:15
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.

Verification of contracts with constructor arguments created from factory doesn't work
2 participants