0

While deploying a smart contract using Foundry on the Sepolia test network, I'm encountering an issue. The deployment seems successful, but I'm facing a challenge verifying the contract's bytecode. Here is the summary of what I did and the problem I'm facing:

Environment: I'm working with Foundry for smart contract development. The repository for this project is at https://github.com/AryanGodara/foundry-nft.

Deployment Process: I used the following command to deploy my contract, BasicNft, to the Sepolia network:

deploy:
    @forge script script/DeployBasicNft.s.sol:DeployBasicNft $(NETWORK_ARGS)

Issue: The contract seems to deploy successfully to the network, as indicated by the successful transaction hashes and contract addresses provided in the terminal output. However, I encountered a problem during the verification stage. The terminal output states:

We haven't found any matching bytecode for the following contracts: [0x4568d1fb5701c79338b765e00428c875c45a4e34], [0xf05780540786f3351aa5aa8213b97f80924d902f].

This message appears for both deployment attempts I made, each with a different contract address.

Questions:

Why is the bytecode not matching, and what does this mean for my deployed contracts? Do I follow specific steps to ensure the bytecode matches when deploying with Foundry? Could this be an issue related to the compiler version or the way the contract is written? Any insights or suggestions on how to resolve this issue would be greatly appreciated. I'm particularly interested in understanding the cause of this mismatch and how to prevent it in future deployments.

Thank you in advance for your help!

1
  • Have you got solution for this ? I am also facing similar problem .
    – hoBabu
    Apr 14 at 5:47

1 Answer 1

1

I have changed my compiler version to 0.8.21 and it worked for me . I don't Know how , if you are still facing same issue try it out once . If you have another solution please share with me , i don't think changing compiler version is good solution as i was using ^0.8.0 so it would have automatically taken 0.8.21 .

Your Answer

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

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