halmos
halmos copied to clipboard
Error: setUp() failed: ValueError: constructor failed, error=Unsupported cheat code: vm.envAddress
Describe the bug
The constructor of the test contract is making use of vm.envAddress in the following way:
usdc = IERC20Metadata(vm.envAddress("USDC_ADDRESS"));
When running halmos I get the following error:
Error: setUp() failed: ValueError: constructor failed, error=Unsupported cheat code: calldata = 0x350d56bf00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000011544553545f555344545f41444452455353000000000000000000000000000000 returndata=None
Environment:
- OS: macOS Sequoia
- Python version: 3.9.6
- Halmos and other dependency versions:
Package Version
------------------------- -----------
halmos 0.1.13
pip 24.3.1
z3-solver 4.13.3.0
Is there a recommended workaround for this?
until someone implements vm.envAddress(), the recommended approach is to define the variable in the test
supported in #526