The github issue page can be found in here
.
ID | Description | Severity |
---|---|---|
M-01 | OrigamiOToken::circulatingSupply will underflow when users burn their tokens. | Medium |
OrigamiOToken::circulatingSupply will underflow when users burn their tokens.
OrigamiOToken::circulatingSupply will underflow when users burn their tokens.
Add the following test to OrigamiOToken.t.sol
:
function test_circulatingSupplyUnderflow() public {
address exploiter = makeAddr("EXPLOITER");
vm.prank(origamiMultisig);
oToken.amoMint(exploiter, 100);
console.log(oToken.circulatingSupply());
vm.prank(exploiter);
oToken.burn(100);
console.log(oToken.circulatingSupply());
}
Foundry Result:
Running 1 test for test/foundry/unit/investments/OrigamiOToken.t.sol:OrigamiOTokenTestAccess
[PASS] test_circulatingSupplyUnderflow() (gas: 70396)
Logs:
0
115792089237316195423570985008687907853269984665640564039457584007913129639836
Test result: ok. 1 passed; 0 failed; 0 skipped; finished in 4.06ms
Ran 1 test suites: 1 tests passed, 0 failed, 0 skipped (1 total tests)
overrides ERC20Burnable
functions if not used.