Skip to content

Commit

Permalink
test: 2 more mint tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisGD committed Oct 22, 2024
1 parent 6dd488b commit 6644279
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/MorphoTokenTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,25 @@ contract MorphoTokenEthereumTest is BaseTest {
assertEq(newMorpho.balanceOf(to), amount);
}

function testMintOverflow(address to, uint256 amount) public {
vm.assume(to != address(0));
amount = bound(amount, type(uint256).max - newMorpho.totalSupply() + 1, type(uint256).max);

vm.prank(MORPHO_DAO);
vm.expectRevert();
newMorpho.mint(to, amount);
}

function testMintAccess(address account, address to, uint256 amount) public {
vm.assume(to != address(0));
vm.assume(account != MORPHO_DAO);
amount = bound(amount, MIN_TEST_AMOUNT, MAX_TEST_AMOUNT);

vm.expectRevert();
vm.prank(account);
newMorpho.mint(to, amount);
}

function testBurn(address from, uint256 amountMinted, uint256 amountBurned) public {
vm.assume(from != address(0));
amountMinted = bound(amountMinted, MIN_TEST_AMOUNT, MAX_TEST_AMOUNT);
Expand Down

0 comments on commit 6644279

Please sign in to comment.