ethereum / sourcify

Decentralized Solidity contract source code verification service
https://sourcify.dev
MIT License
780 stars 395 forks source link

Fix verification logic #1594

Closed kuzdogan closed 2 months ago

kuzdogan commented 2 months ago

This PR adds two changes:

  1. https://github.com/ethereum/sourcify/commit/2bf7168edc30416d38b5576552902141c9015373 fixes the incorrect return when a different auxdata was found in the creation bytecode. This became apparent when debugging the "cannot generate artifacts" error in #1562. Here the contract has a different auxdata at the end of the creation code because it returns raw bytecode of the factory contract. The verification logic incorrectly stops when it finds different auxdata, whereas it should've continued to find the auxdatas by editing the contract and recompiling.
  2. Fixes the wrong match check (match.creationBytecode instead of match.runtimeBytecode) in the verification logic.

Also adds small modifications to logs during fetching traces for clarity.