0

I have two contracts Pool and PoolConfiguration, when deploying them to goerli test they both deploy successfully but when verifying on etherscan PoolConfiguration fail to verify and drops this error :

Verification complete. Result: Fail - Unable to verify. Compiled contract runtime bytecode does NOT match the on-chain runtime bytecode.

here is the python/brownie script to deploy and verify :

from scripts.utils import get_account
from brownie import PoolConfiguration, Pool, PoolLogic, ReservesManager, config, network

account = get_account()


def main():
    deploy_pool_configuration()


def deploy_pool():
    pool = Pool.deploy(
        {"from": account},
        publish_source=True,
    )
    return pool


def deploy_pool_configuration():
    pool = Pool[-1]
    pool_configuration = PoolConfiguration.deploy(
        pool,
        {"from": account, "priority_fee": "5 gwei"},
        publish_source=True,
    )
    return pool_configuration

has anyone any idea one why this error occurs and how to fix it ? or what it means by runtime bytecode ?

1 Answer 1

2

Let me first explain you how does smart contract verification works

So there are 2 types of Smart Contract Verification method

  1. Source Code match
  2. Full Verification

In Source Code Verification the Bytecode of Smart Contract You Entered and the Deployed Bytecode of Smart Contract in the Blockchain is Matched.

In Full Verifcation not only Bytecode is matched but also meta data is checked .

and the error that you faced

Verification complete. Result: Fail - Unable to verify. Compiled contract runtime bytecode does NOT match the on-chain runtime bytecode.

It means that the Bytecode of the Smart Contract you entered and the Smart Contract you deployed in the blockchain are different.

This can cause due to difference in Smart Contract, Different Version of Solidity Compiler

To resolve the issue please check the settings of the Compiler and Version of the Complier

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.