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: 30/59
Findings: 2
Award: $127.73
🌟 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
83.1217 MIM - $83.12
uint256(loan.startTime) + tokenLoanParams[tokenId].duration
is supposed to be the last time that the borrower can repay the loan, so it needs to be <
instead of <=
in the removeCollateral
function and >=
instead of >
in the repay
function
require( // Addition is safe: both summands are smaller than 256 bits uint256(loan.startTime) + tokenLoanParams[tokenId].duration <= block.timestamp, "NFTPair: not expired" ); require( // Addition is safe: both summands are smaller than 256 bits uint256(loan.startTime) + loanParams.duration > block.timestamp, "NFTPair: loan expired" );
constructor
- write initialized
instead of initialised
requestLoan
, lend
, requestAndBorrow
and takeCollateralAndLend
functions - write transferred
instead of transfered
calculateInterest
function - write inequality
instead of inquality
#0 - cryptolyndon
2022-05-12T05:05:34Z
Can't argue with the duration business; that does go against what it says.
Why do so many of these typo reports include non-American, but legitimate, spelling? (Yes I know "transfered" is still wrong, and the other is an actual, well, typo)
🌟 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
44.6123 MIM - $44.61
uint8 private constant LOAN_INITIAL = 0;
in NFTPair
- variables in solidity are automatically initialized to zero (and this actually costs more gas than initializing to zero)#0 - cryptolyndon
2022-05-14T01:10:56Z
Seen, thanks. Only one to mention the switch