Platform: Code4rena
Start Date: 27/04/2022
Pot Size: $50,000 MIM
Total HM: 6
Participants: 59
Period: 5 days
Judge: 0xean
Id: 113
League: ETH
Rank: 31/59
Findings: 2
Award: $120.79
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0x1337, 0x1f8b, 0xDjango, 0xf15ers, AuditsAreUS, BowTiedWardens, CertoraInc, Funen, GimelSec, MaratCerby, Ruhum, WatchPug, antonttc, berndartmueller, bobi, bobirichman, broccolirob, catchup, cccz, defsec, delfin454000, gs8nrv, gzeon, horsefacts, hubble, hyh, ilan, jah, joestakey, kebabsec, kenta, kenzo, m9800, mics, oyc_109, pauliax, reassor, robee, samruna, sikorico, simon135, throttle, unforgiven, z3s
75.7132 MIM - $75.71
This was typo comment, it should be calculateinterest
instead of calculateIntest
.
##Tool Used Manual Review
since this worse params
was used, it can be used like below :
##Tool Used Manual Review
##Recommended Mitigation
require( params.duration >= cur.duration && params.valuation <= cur.valuation && params.annualInterestBPS <= cur.annualInterestBPS, "NFTPair: worse params" );
#0 - cryptolyndon
2022-05-13T05:11:06Z
The "bad params" and "worse params" messages are different checks. Why make the revert string the same?
🌟 Selected for report: BowTiedWardens
Also found by: 0x1f8b, 0xNazgul, 0xf15ers, 0xkatana, CertoraInc, Funen, GimelSec, Hawkeye, IllIllI, Kulk0, NoamYakov, Tadashi, Tomio, TrungOre, antonttc, catchup, defsec, delfin454000, fatherOfBlocks, gzeon, horsefacts, joestakey, kenta, oyc_109, pauliax, reassor, robee, samruna, simon135, slywaters, sorrynotsorry, z3s
45.0789 MIM - $45.08
Using i++ instead ++i for all the loops, the variable i is incremented using i++. It is known that implementation by using ++i costs less gas per iteration than i++.
Manual Review, Remix
main/contracts/NFTPair.sol#L494 main/contracts/NFTPair.sol#L631
uint256 i = 0
into uint i
for saving more gasusing this implementation can saving more gas for each loops.
##Tool Used Manual Review & Remix
##Recommended Mitigation Change it
##Occurances
main/contracts/NFTPair.sol#L631
= 0
If a variable was not set/initialized, it is assumed to have default value to 0
this implementation was used for saving more gas by removing = 0
##TOOLS USED Remix, Manual Review
##Mitigation Step
Remove = 0