test of statefulFuzz_testInvariantBreaksHandler keeps failing with unfamiliar error #157
-
I ran Encountered 1 failing test in test/handler/Invariant.t.sol:AttemptedBreakTest
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 16 replies
-
Hello @Shawon-Mandal , can you please push your code to github and share the link with me so that i can set it up on my machine and try debug it. But actually what makes most sense to me considering every single call revert is that you didn't set up your handler properly and the fuzzer is running impossible scenarios either by trying to deposit on a token address that is not supported by the contract, trying to deposit with an address that doesn't have a token et cetera. Push your code to github, i will clone and set it up locally on my machine and maybe i would be able to figure what is wrong |
Beta Was this translation helpful? Give feedback.
-
I ran make command again hoping that everything would work properly after setting up the dependencies but now I am getting this error when running forge test --mt statefulFuzz_testInvariantBreaksHandler
Compiler run failed:
Warning (5159): "selfdestruct" has been deprecated. The underlying opcode will eventually undergo breaking changes, and its use is not recommended.
--> src/mishandling-of-eth/SelfDestructMe.sol:45:9:
|
45 | selfdestruct(payable(address(target)));
| ^^^^^^^^^^^^
Warning (2018): Function state mutability can be restricted to view
--> test/unit/ArithmeticTest.t.sol:39:5:
|
39 | function test_precisionLoss() public {
| ^ (Relevant source part starts here and spans across multiple lines).
Warning (2018): Function state mutability can be restricted to view
--> test/unit/CentralizationTest.t.sol:20:5:
|
20 | function testSetUpCentralization() public {
| ^ (Relevant source part starts here and spans across multiple lines).
Warning (2018): Function state mutability can be restricted to view
--> test/unit/OracleManipulation.t.sol:50:5:
|
50 | function testStartingPrice() public {
| ^ (Relevant source part starts here and spans across multiple lines).
Warning (2018): Function state mutability can be restricted to view
--> test/unit/WeakRandomnessTest.t.sol:16:5:
|
16 | function test_guessRandomNumber() public {
| ^ (Relevant source part starts here and spans across multiple lines).
Error (6243): The "tload" instruction is only available for Cancun-compatible VMs (you are currently compiling for "paris").
--> lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol:237:22:
|
237 | value := tload(slot)
| ^^^^^
Error (8678): Variable count for assignment to "value" does not match number of values (1 vs. 0)
--> lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol:237:13:
|
237 | value := tload(slot)
| ^^^^^^^^^^^^^^^^^^^^
Error (6243): The "tstore" instruction is only available for Cancun-compatible VMs (you are currently compiling for "paris").
--> lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol:247:13:
|
247 | tstore(slot, value)
| ^^^^^^
Error (6243): The "tload" instruction is only available for Cancun-compatible VMs (you are currently compiling for "paris").
--> lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol:257:22:
|
257 | value := tload(slot)
| ^^^^^
Error (8678): Variable count for assignment to "value" does not match number of values (1 vs. 0)
--> lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol:257:13:
|
257 | value := tload(slot)
| ^^^^^^^^^^^^^^^^^^^^
Error (6243): The "tstore" instruction is only available for Cancun-compatible VMs (you are currently compiling for "paris").
--> lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol:267:13:
|
267 | tstore(slot, value)
| ^^^^^^
Error (6243): The "tload" instruction is only available for Cancun-compatible VMs (you are currently compiling for "paris").
--> lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol:277:22:
|
277 | value := tload(slot)
| ^^^^^
Error (8678): Variable count for assignment to "value" does not match number of values (1 vs. 0)
--> lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol:277:13:
|
277 | value := tload(slot)
| ^^^^^^^^^^^^^^^^^^^^
Error (6243): The "tstore" instruction is only available for Cancun-compatible VMs (you are currently compiling for "paris").
--> lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol:287:13:
|
287 | tstore(slot, value)
| ^^^^^^
Error (6243): The "tload" instruction is only available for Cancun-compatible VMs (you are currently compiling for "paris").
--> lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol:297:22:
|
297 | value := tload(slot)
| ^^^^^
Error (8678): Variable count for assignment to "value" does not match number of values (1 vs. 0)
--> lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol:297:13:
|
297 | value := tload(slot)
| ^^^^^^^^^^^^^^^^^^^^
Error (6243): The "tstore" instruction is only available for Cancun-compatible VMs (you are currently compiling for "paris").
--> lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol:307:13:
|
307 | tstore(slot, value)
| ^^^^^^
Error (6243): The "tload" instruction is only available for Cancun-compatible VMs (you are currently compiling for "paris").
--> lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol:317:22:
|
317 | value := tload(slot)
| ^^^^^
Error (8678): Variable count for assignment to "value" does not match number of values (1 vs. 0)
--> lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol:317:13:
|
317 | value := tload(slot)
| ^^^^^^^^^^^^^^^^^^^^
Error (6243): The "tstore" instruction is only available for Cancun-compatible VMs (you are currently compiling for "paris").
--> lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol:327:13:
|
327 | tstore(slot, value)
| ^^^^^^
Error:
Compilation failed |
Beta Was this translation helpful? Give feedback.
-
Good day @Shawon-Mandal , the issue seems to be from your setUp. You should set your handler as a global vairiable instead of in your setUp: https://github.com/Shawon-Mandal/Handler-test/blob/main/test/handler/Invariant.t.sol#L26 Also, |
Beta Was this translation helpful? Give feedback.
-
The error above seems to be from what you added in your toml file maybe. |
Beta Was this translation helpful? Give feedback.
@Chinwuba22 @EngrPips Thank you both of you. I solved my
forge build
command problem by setting evm_version="cancun" .I found this here.
Also, my test error from before is finally resolved by implementing your (@Chinwuba22) suggestions about uncommenting
handlerStatefulFuzzCatches
and setting up my global variable correctly.