Closed alan890104 closed 1 year ago
Just an FYI, the documentation you are referring to is for v3 but this repo is for v2. The v3 repo can be found here.
Your test is behaving as expected for v3. Using MaxUint256
as the amount for withdraw
will withdraw all of the user's base balance (the amount of USDC supplied). In this case, Bob has not supplied any USDC so his base balance is 0.
Greatly appreciate your explanation!
Reproduce (on block height
17228670
)type(uint256).max
instead ofusdc.balanceOf(address(compound))
, the balance of usdc in compound does not change.This line in my code is the place where error occurs.
The document says
A value of MaxUint256 will withdraw all of the src’s base balance.