Platform: Code4rena
Start Date: 24/07/2023
Pot Size: $100,000 USDC
Total HM: 18
Participants: 73
Period: 7 days
Judge: alcueca
Total Solo HM: 8
Id: 267
League: ETH
Rank: 70/73
Findings: 1
Award: $15.29
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: immeas
Also found by: 0x70C9, 0xAnah, 0xArcturus, 0xComfyCat, 0xWaitress, 0xackermann, 0xkazim, 2997ms, 33audits, Arz, Aymen0909, ChrisTina, JP_Courses, John_Femi, Jorgect, Kaysoft, LosPollosHermanos, MohammedRizwan, Nyx, Rolezn, Sathish9098, Stormreckson, T1MOH, Tendency, Topmark, Udsen, Vagner, albertwh1te, ast3ros, banpaleo5, berlin-101, catellatech, cats, codetilda, cryptonue, eeshenggoh, fatherOfBlocks, hals, jamshed, jaraxxus, josephdara, kankodu, kodyvim, kutugu, lanrebayode77, mert_eren, nadin, naman1778, niki, petrichor, ravikiranweb3, said, solsaver, souilos, twcctop, wahedtalash77
15.2931 USDC - $15.29
./src/core/Comptroller.sol:1075: modifier nonReentrant() {
modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_locked != 1, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _locked = 1; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _locked = 0; }
2. The redeemAllowed function is marked as public and view, which suggests that it should be a read-only function that doesn't modify the contract state. However, it calls updateCompSupplyIndex and distributeSupplierComp, both of which can modify the contract state.
function redeemAllowed(address mToken, address redeemer, uint redeemTokens) public view returns (uint) { if (!markets[mToken].isListed) { return uint(Error.MARKET_NOT_LISTED); } // Check if redemption is paused if (redeemGuardianPaused[mToken]) { return uint(Error.REDEEM_GUARDIAN_PAUSED); } // Keep the flywheel moving Exp memory borrowIndex = Exp({mantissa: MToken(mToken).borrowIndex()}); updateCompSupplyIndex(mToken); distributeSupplierComp(mToken, redeemer, false, borrowIndex.mantissa); return uint(Error.NO_ERROR); }
#0 - alcueca
2023-08-12T18:04:48Z
The first one is correct, but unfortunately there is no reference as to where the second finding happens.
#1 - c4-judge
2023-08-12T18:04:52Z
alcueca marked the issue as grade-b