You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was getting the Deploying the contract * failed (revert, out-of-gas, sending ether to an non-payable constructor, etc.) error in my project. Unfortunately this error is quite hard to debug. After long time changing my code and commenting out stuff I realized the problem was in the execution of abi.encodePacked in my setup function.
My foundry.toml file includes the following:
evm_version = "cancun"solc = "0.8.25"
Commenting out the evm_version or lowering solc to 0.8.24 removed the issue. So the problem seems to be using abi.encodePacked in the constructor when I am using cancun evm version and solc 0.8.25.
Same error appears if I use abi.encode.
Code example to reproduce the issue:
// SPDX-License-Identifier: UNLICENSEDpragma solidity^0.8.0;
contractTester {
constructor() payable {
bytesmemory b =bytes("foo");
abi.encodePacked(b);
}
function foo() public {}
}
Version:
2.2.4
Relevant log output:
echidna: Deploying the contract 0x00a329c0648769A73afAc7F9381E08FB43dBEA72 failed (revert, out-of-gas, sending ether to an non-payable constructor, etc.):
The text was updated successfully, but these errors were encountered:
Hi! Echidna 2.2.4 does not have full support for Cancun, and seeing that you don't experience the same issue if you run with solc 0.8.24, it's possible you're hitting one of the limitations there (eg missing MCOPY support). For the time being, either use 0.8.24 which works, or alternatively, try updating to a newer echidna build from the master branch; we recently updated hevm and that should hopefully mean it supports Cancun fully now.
Describe the issue:
I was getting the
Deploying the contract * failed (revert, out-of-gas, sending ether to an non-payable constructor, etc.)
error in my project. Unfortunately this error is quite hard to debug. After long time changing my code and commenting out stuff I realized the problem was in the execution ofabi.encodePacked
in my setup function.My foundry.toml file includes the following:
Commenting out the evm_version or lowering solc to 0.8.24 removed the issue. So the problem seems to be using
abi.encodePacked
in the constructor when I am using cancun evm version and solc 0.8.25.Same error appears if I use
abi.encode
.Code example to reproduce the issue:
Version:
2.2.4
Relevant log output:
The text was updated successfully, but these errors were encountered: