Skip to content

Commit

Permalink
Add test for burn on transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
QuitCrypto committed Feb 10, 2024
1 parent d6c4ad5 commit 2cc4bab
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/DN404.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,19 @@ contract DN404Test is SoladyTest {

dn.initializeDN404(totalNFTSupply, initialSupplyOwner);

vm.startPrank(initialSupplyOwner);
vm.prank(initialSupplyOwner);
dn.transfer(recipient, 1e18);

assertEq(dn.ownerOf(1), recipient);
}

function testBurnOnTransfer(uint32 totalNFTSupply, address initialSupplyOwner, address recipient) public {
testMintOnTransfer(totalNFTSupply, initialSupplyOwner, recipient);

vm.prank(recipient);
dn.transfer(address(42069), totalNFTSupply + 1);

vm.expectRevert(DN404.TokenDoesNotExist.selector);
dn.ownerOf(1);
}
}

0 comments on commit 2cc4bab

Please sign in to comment.