Content pfp
Content
@
0 reply
0 recast
0 reaction

Paul Cowgill pfp
Paul Cowgill
@paulcowgill
to test a new contract under development and an old contract with a solidity version older than forge supports (without using fork tests): deploy the bytecode of the old contract using assembly in the test file. uniswap v2 makes forge test and forge script sad, but this fixes it.
1 reply
1 recast
4 reactions

horsefacts pfp
horsefacts
@horsefacts.eth
You can probably use vm.etch as well!
1 reply
0 recast
1 reaction

Paul Cowgill pfp
Paul Cowgill
@paulcowgill
very cool, thanks! hadn't seen that one yet. do you know how i can pass arguments to the constructor with that approach?
1 reply
0 recast
0 reaction

horsefacts pfp
horsefacts
@horsefacts.eth
As far as I know, etch just sets static bytecode at an address, so it's useful if you have access to the already compiled bytecode for a known contract. If you need to do something more sophisticated, the assembly trick might be better.
0 reply
0 recast
1 reaction