Cyfrin / foundry-defi-stablecoin-cu

249 stars 117 forks source link

:white_check_mark: fixed : Handler-burnDsc, adding approve #65

Closed ibourn closed 8 months ago

ibourn commented 8 months ago

Update StopOnRevertHandler.t.sol - fixing burnDsc (as a follow-up to https://github.com/Cyfrin/foundry-defi-stablecoin-f23/pull/35 )

burnDsc reverts due to a ERC20InsufficientAllowance error.

The burnDsc function ends up calling _burnDsc where a dsc transfer is made. An 'approve' is therefore necessary before. To perform this we must also 'prank' the msg.sender