Skip to content

Commit

Permalink
I fix edge case testing transfers to null address.
Browse files Browse the repository at this point in the history
  • Loading branch information
SweetmanTech committed Aug 6, 2023
1 parent 0c11d76 commit f6addb2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/hooks/BeforeTokenTransfers.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ contract BeforeTokenTransfersHookTest is DSTest {
uint256 startTokenId,
uint256 quantity
) public {
vm.assume(quantity > 0);
vm.assume(startTokenId > 0);
_assumeGtZero(quantity);
_assumeGtZero(startTokenId);
vm.assume(quantity < 10_000);
vm.assume(quantity >= startTokenId);
_assumeNotBurn(_firstOwner);
_assumeNotBurn(_secondOwner);

// Mint some tokens first
erc721Mock.mint(_firstOwner, quantity);
Expand All @@ -67,6 +68,10 @@ contract BeforeTokenTransfersHookTest is DSTest {
vm.assume(_wallet != address(0));
}

function _assumeGtZero(uint256 _num) internal pure {
vm.assume(_num > 0);
}

function _assertNormalTransfer(
address _from,
address _to,
Expand Down

0 comments on commit f6addb2

Please sign in to comment.