Database with shared contract information
chainId
and contractAddress
arguments are typically required, as source codes for already verified contracts are stored based on the chain and address where these contracts are deployed. This is how most source code databases are designed (e.g., Sourcify, Etherscan, Blockscout).
With this new service, our main goal was not just to return source codes for verified contracts (since that data is already stored and processed internally within Blockscout’s main storage), but also to search for source codes for unverified contracts. To do this, we realized we could eliminate chainId
and contractAddress
and gain some advantages.
chainId
and contractAddress
are not needed, only the bytecode
-sourceCode
correspondence if required. This is similar to what 4bytes or sigEth does. However, instead of looking for the function signature based on its identifier, we look for the contracts’ source code based on its bytecode.
chainId
and contractAddress
—only raw bytecodes are important.
smart-contract-verifier
service. If a chain wants to start saving verified bytecodes into a database, the only required change is to point RUST_VERIFICATION_SERVICE_URL
to the eth-bytecode-db
service instead of the verifier. The service will proxy all requests to the underlying verifier internally.
Eth-bytecode-db
service is implemented with both contract verification proxy and database search functionality (https://github.com/blockscout/blockscout-rs/tree/main/eth-bytecode-db).
eth-bytecode-db
instead of the original smart-contract-verifier; all newly verified bytecodes and corresponding sources are now stored directly in the database.
eth-bytecode-db
database (should expand the current database up to ~100-150k contracts).