diff --git a/src/DefaultInflationManager.sol b/src/DefaultInflationManager.sol index 7c5b8a1..615e9d8 100644 --- a/src/DefaultInflationManager.sol +++ b/src/DefaultInflationManager.sol @@ -22,7 +22,6 @@ contract DefaultInflationManager is using SafeERC20 for IPolygon; error InvalidAddress(); - error NotEnoughMint(); // log2(2%pa continuously compounded inflation per second) in 18 decimals(Wad), see _inflatedSupplyAfter uint256 public constant INTEREST_PER_SECOND_LOG2 = 0.000000000914951192e18; @@ -76,13 +75,8 @@ contract DefaultInflationManager is uint256 newSupply = _inflatedSupplyAfter( block.timestamp - startTimestamp // time elapsed since deployment ); - uint256 amountToMint; - unchecked { - // currentSupply is always less than newSupply because POL token is strictly inflationary, - // _burn method is not exposed - amountToMint = newSupply - currentSupply; - } - if (amountToMint == 0) revert NotEnoughMint(); + uint256 amountToMint = newSupply - currentSupply; + if (amountToMint == 0) return; // no minting required uint256 treasuryAmt = amountToMint / 2; uint256 stakeManagerAmt = amountToMint - treasuryAmt; diff --git a/test/DefaultInflationManager.t.sol b/test/DefaultInflationManager.t.sol index 491f788..da4737d 100644 --- a/test/DefaultInflationManager.t.sol +++ b/test/DefaultInflationManager.t.sol @@ -10,7 +10,6 @@ import {Test} from "forge-std/Test.sol"; contract DefaultInflationManagerTest is Test { error InvalidAddress(); - error NotEnoughMint(); ERC20PresetMinterPauser public matic; Polygon public polygon; @@ -133,7 +132,6 @@ contract DefaultInflationManagerTest is Test { } function test_Mint() external { - vm.expectRevert(NotEnoughMint.selector); inflationManager.mint(); // timeElapsed is zero, so no minting assertEq(polygon.balanceOf(stakeManager), 0); @@ -149,7 +147,6 @@ contract DefaultInflationManagerTest is Test { skip(delay); - if (delay == 0) vm.expectRevert(NotEnoughMint.selector); inflationManager.mint(); inputs[2] = vm.toString(elapsedTime);