I'm developing a contract in hardhat project. But now I want to write test by foundry. My problem is I'm using create2
, but when running contract by hardhat and foundry they gave different addresses. I found the reason is the bytecode
of contract from hardhat and foundry are different (10 ~ 20 bytes close the end). Here is my hardhat config + foundry toml.
hardhat.config.js
config = {
solidity: {
version: "0.8.18",
evmVersion: "london",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
...
}
foundry.toml
evm_version = 'london'
optimizer = true
optimizer_runs = 200
solc_version = '0.8.18'
via_ir = false
This is how they different, they have the same length, but different near the end What reasons affect to bytecode?