Skip to content

Commit

Permalink
fix: add vm.etch to mock contract
Browse files Browse the repository at this point in the history
  • Loading branch information
dristpunk committed Nov 28, 2023
1 parent 629eebb commit 2d2a24f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions solidity/test/unit/Greeter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ import {Greeter, IGreeter} from 'contracts/Greeter.sol';

abstract contract Base is Test {
address internal _owner = makeAddr('owner');

IERC20 internal _token = IERC20(makeAddr('token'));
string internal _initialGreeting = 'hola';
bytes32 internal _emptyString = keccak256(bytes(''));
Greeter internal _greeter;

function setUp() public virtual {
vm.etch(address(_token), new bytes(0x1)); // etch bytecode to avoid address collision problems
vm.prank(_owner);
_greeter = new Greeter(_initialGreeting, _token);
}
Expand Down

0 comments on commit 2d2a24f

Please sign in to comment.