Cyfrin / foundry-defi-stablecoin-cu

250 stars 117 forks source link

Update Makefile - Cyfrin instead of ChanAccelOrg #34

Closed ChefAharoni closed 1 year ago

ChefAharoni commented 1 year ago

Updated the name of the repo to install foundry-devops from; name changed from ChainAccelorg to Cyfrin.

ChefAharoni commented 1 year ago

Seems like this test is failing:

  [22636] StopOnRevertHandler::redeemCollateral(9333727928527111674595329096 [9.333e27], 892) 
    ├─ [2805] DSCEngine::getCollateralBalanceOfUser(0x0000000000000000000000000000000000000026, ERC20Mock: [0xBb2180ebd78ce97360503434eD37fcf4a1Df61c3]) [staticcall]
    │   └─ ← 3056820747 [3.056e9]
    ├─ [0] console::log(Bound Result, 892) [staticcall]
    │   └─ ← ()
    ├─ [7830] DSCEngine::redeemCollateral(ERC20Mock: [0xBb2180ebd78ce97360503434eD37fcf4a1Df61c3], 892) 
    │   └─ ← "Arithmetic over/underflow"
    └─ ← "Arithmetic over/underflow"

I don't think it's related to this change though.

usmanfarooq91 commented 1 year ago

@ChefAharoni you are getting this error because you are calling DSCEngine::redeemCollateral(ERC20Mock: [0xBb2180ebd78ce97360503434eD37fcf4a1Df61c3], 892) by not the same user you called DSCEngine::getCollateralBalanceOfUser(0x0000000000000000000000000000000000000026, ERC20Mock: [0xBb2180ebd78ce97360503434eD37fcf4a1Df61c3]) by. Call both functions by the same user and it will resolve.

Prank redeemCollateral with msg.sender.

ChefAharoni commented 1 year ago

@ChefAharoni you are getting this error because you are calling DSCEngine::redeemCollateral(ERC20Mock: [0xBb2180ebd78ce97360503434eD37fcf4a1Df61c3], 892) by not the same user you called DSCEngine::getCollateralBalanceOfUser(0x0000000000000000000000000000000000000026, ERC20Mock: [0xBb2180ebd78ce97360503434eD37fcf4a1Df61c3]) by. Call both functions by the same user and it will resolve.

Prank redeemCollateral with msg.sender.

Thanks, but I'm not getting this error in my contract, I meant GitHub actions shows this error while checking if this pull request can be merged easily.

usmanfarooq91 commented 1 year ago

@ChefAharoni you are getting this error because you are calling DSCEngine::redeemCollateral(ERC20Mock: [0xBb2180ebd78ce97360503434eD37fcf4a1Df61c3], 892) by not the same user you called DSCEngine::getCollateralBalanceOfUser(0x0000000000000000000000000000000000000026, ERC20Mock: [0xBb2180ebd78ce97360503434eD37fcf4a1Df61c3]) by. Call both functions by the same user and it will resolve. Prank redeemCollateral with msg.sender.

Thanks, but I'm not getting this error in my contract, I meant GitHub actions shows this error while checking if this pull request can be merged easily.

I see.

PatrickAlphaC commented 1 year ago

Yep! This is a fuzz test that is known to fail (intentionally)