stdError.arithmeticError
Last updated
Last updated
testUserCannotWithdraw and testUserCannotWithdrawExcessDeposit should revert because of underflow in , not because of ERC20 properties.
Alberto said he wanted to see this revert because of the underflow, not because of the erc20 balance. so u can:
make sure the user has an balance of the token
change this to vm.assume
(amount > 0 && amount < wmd.balanceOf(user))
the user has some wmd tokens.
he will attempt to withdraw some tokens within the range (0, amount), from the vault
since he does not have any deposits to begin with, we run into an underflow error, resulting from:
balances[msg.sender] -= amount;
as this is going to work out to subtracting a positive figure (amount) from 0 -> hence underflow.
instead of expectRevert -- use forge-std standard errors