matter-labs / block-explorer

zkSync Era Block Explorer
Apache License 2.0
124 stars 109 forks source link

Contracts with the exact same deployed bytecode can be verified by hardhat but cannot be verified on explorer #250

Open friday-james opened 6 months ago

friday-james commented 6 months ago

🐛 Bug Report

📝 Description

Contracts with the exact same deployed bytecode can be verified by hardhat but cannot be verified on explorer.

Test contract verified by hardhat: https://sepolia.explorer.zksync.io/address/0x1097f8a418d36e3aB3A1B386A7977F67672Ec4Fc

Contract with the same deployed bytecode: https://sepolia.explorer.zksync.io/address/0x121f49040C4Ed3FA766557b6989B88aa3ea82082

The zksolc version, solc version, contract name and contract code are all copied from https://sepolia.explorer.zksync.io/address/0x1097f8a418d36e3aB3A1B386A7977F67672Ec4Fc , but explorer states that the deployed bytecode is not equal to generated one from given source.

image

Provide a clear and concise description of the bug.

🔄 Reproduction Steps

Deploy a contract using zksolc v1.4.0 and solc 0.8.9. Then try to verify it on explorer.

🤔 Expected Behavior

The contract can be verified.

😯 Current Behavior

The contract cannot be verified.

🖥️ Environment

Any relevant environment details.

📋 Additional Context

Add any other context about the problem here. If applicable, add screenshots to help explain.

📎 Log Output

Paste any relevant log output here.