ToucanProtocol / dynamic-fee-pools

Fee calculator contracts for Toucan Protocol pools
2 stars 3 forks source link

Remove the need to run with `--via-ir` #53

Open 0xmichalis opened 6 months ago

0xmichalis commented 6 months ago

Currently one of the fuzz tests will fail to compile due to a stack too deep error which forces us to always compile and test with --via-ir which is much slower than the normal mode. We should fix the stack too deep issue in the fuzz test if possible and remove the need to run everything with --via-ir.

$ forge build
[⠆] Compiling...
[⠊] Compiling 66 files with 0.8.19
[⠢] Solc 0.8.19 finished in 3.60s
Error: 
Compiler run failed:
Error: Compiler error (/solidity/libsolidity/codegen/LValue.cpp:52):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.
CompilerError: 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.
   --> test/FeeCalculatorFuzzy/FeeCalculatorERC1155.fuzzy.t.sol:114:33:
    |
114 |         for (uint256 i = 0; i < numberOfRedemptions; i++) {