Closed touqeerShah closed 9 months ago
Ahhhh I See what you're doing here! Thank you!
So this is good, but we are just depositing and then withdrawing right away. I think a better play would be to only redeem collateral from users who have deposited. What do you think?
Let suppose it call function randomly if it call redeemCollateral
first without depositing it give following error that why I add deposit in the test
[FAIL. Reason: Arithmetic over/underflow]
[Sequence] sender=addr=[test/fuzz/failOnRevert/StopOnRevertHandler.t.sol:StopOnRevertHandler]calldata=mintAndDepositCollateral(uint256,uint256),
args=[47409767332275032229872235448 [4.74e28], 23614243684831295026004535944408119379691892249249472724442933517775913615360 [2.361e76]]
Right, but we could improve this even more by keeping track of all the people who have deposited collateral, and then call redeem collateral with only people who have deposited.
In any case, I like your addition
Going to close as we are now pranking msg.sender to fix the issues here
redeemCollateral have problem in getCollateralBalanceOfUser function argument so it was never call that why it never give issue it define as user address then contract collateral address but pass swap of it so that why it never run and revert from if conditions