Platform: Code4rena
Start Date: 09/09/2022
Pot Size: $42,000 USDC
Total HM: 2
Participants: 101
Period: 3 days
Judge: hickuphh3
Total Solo HM: 2
Id: 161
League: ETH
Rank: 94/101
Findings: 1
Award: $33.58
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: GalloDaSballo
Also found by: 0x040, 0x1f8b, 0x4non, 0x52, 0x85102, 0xNazgul, 0xSky, 0xSmartContract, Aymen0909, Bnke0x0, CertoraInc, Chandr, Chom, CodingNameKiki, Deivitto, Diana, Funen, JC, Jeiwan, Junnon, KIntern_NA, Lambda, Mohandes, Noah3o6, Ocean_Sky, Picodes, R2, Randyyy, RaymondFam, ReyAdmirado, Rohan16, Rolezn, Samatak, Sm4rty, SnowMan, SooYa, StevenL, Tagir2003, Tointer, TomJ, Tomo, V_B, Waze, _Adam, __141345__, a12jmx, ajtra, ak1, asutorufos, bharg4v, bobirichman, brgltd, c3phas, cccz, cryptonue, cryptostellar5, cryptphi, csanuragjain, d3e4, datapunk, delfin454000, dipp, djxploit, durianSausage, erictee, fatherOfBlocks, gogo, got_targ, hansfriese, horsefacts, hyh, ignacio, innertia, izhuer, karanctf, ladboy233, leosathya, lucacez, lukris02, mics, oyc_109, pashov, pauliax, prasantgupta52, rbserver, ret2basic, rfa, robee, rokinot, rotcivegaf, rvierdiiev, sach1r0, scaraven, sikorico, simon135, smiling_heretic, sorrynotsorry, unforgiven, wagmi, yixxas
33.5774 USDC - $33.58
In previewRedeem() from TribeRedeemer.sol file, a for loop operates on a Dynamic array. If the array is that much big then it could lead to a DoS condition. Again this previewRedeem() used inside redeem() so this function also vulnerable to this condition.
In TribeRedeemer.sol Zero address checks absent for reedmeToken and uint condition check absent for redeemBase variable.
In whole code base there are some require error messages that could be more than 32bytes To Optimize those use error functions
It is better to use one Solidity compiler version across all contracts instead of different versions with different bugs and security checks. RariMerkleRedeemer.sol , MerkleRedeemerDripper.sol both use 0.8.10 solidity version where, SimpleFeiDaiPSM.sol and TribeRedeemer.sol use floating pragma
In RariMarkleRedeemer.sol same require() statement used in line-125 and 138 To save gas, require() that use multiple time should convert to a modifier
In function _configureExchangeRates() and _configureMerkleRoots() _cToken.length calculated multiple time, so it should be cached first then used in loop
Here i notice that each loop which are used whole code base could be optimized as follow . Do not assign 0 to uint, by doing so you save some gas. it's default value is 0 . first cach the <Array>.length to a stack variable and then use it in loop condition, so that it will not repeatedly calculate corresponding array's length . use ++i instead of i++
In SimpleFeiDaiPSM.sol from line - 92 to 98 constant variables are declared in smaller case Should declared in Capitilized SNAKE_CASE
#0 - HickupHH3
2022-10-08T08:07:10Z
gas findings were ignored