Closed Nihal-Abedin closed 6 months ago
Can you try git cloning the repo and seeing what happens?
Also, can you give the exact commands you ran to get this error?
@PatrickAlphaC
I have this problem as well after adding deployerKey to the code. Every command containing forge (etc. forge test
) shows the same error message when executing. However, if try with '--via-ir' (forge test --via-ir
), it works normal again.
hmmm... Maybe we should update the foundry.toml
?
The problem occurs after adding deployerKey as a state variable in the RaffleTest contract, this is due to too many state variables.
It can be solved by removing deployerKey from the values returned by the Helperconfig.activeNetworkConfig
and also not creating a state variable for it because it will never be used.
function setUp() external {
DeployRaffle deployer = new DeployRaffle();
(raffle, helperConfig) = deployer.run();
vm.deal(PLAYER, STARTING_USER_BALANCE);
(
entranceFee,
interval,
vrfCoordinator,
gasLane,
subscriptionId,
callbackGasLimit,
link,
// deployerKey - or it can simply be commented
) = helperConfig.activeNetworkConfig();
}
Note: With --via-ir
it works fine, but it takes too long to run all the tests.
forge coverage
also reverts with error Stack too deep
. To run coverage we need to use forge coverage --ir-minimum
because --via-ir
is not supported for coverage.
Going to close this for now... I'm not getting this from the code as written.
gives an compile error on any command without the tag
Compiler error (/solidity/libsolidity/codegen/CompilerUtils.cpp:1430):Stack too deep. Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) while enabling the optimizer. Otherwise, try removing local variables.