Debt DAO contest - jumpdest7d's results

A cryptonative credit marketplace for fully anon and trustless loans to DAOs.

General Information

Platform: Code4rena

Start Date: 03/11/2022

Pot Size: $115,500 USDC

Total HM: 17

Participants: 120

Period: 7 days

Judge: LSDan

Total Solo HM: 1

Id: 174

League: ETH

Debt DAO

Findings Distribution

Researcher Performance

Rank: 97/120

Findings: 1

Award: $61.35

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

QA Report

Suggested Improvements

#FileSuggestionMore Details
1ILineOfCredit.sol L110-111, ILineOfCredit.sol L127In addCredit() and setRates(), rename drate to dRate and frate to fRate.Deposit Rate and Facility Rate parameters are named dRate and fRate elsewhere. Rename these two parameters to make it consistent.
2LineOfCredit.sol L31Rename count to numCreditLines.This variable tracks the number of open lines in this contract. Consider renaming it to numCreditLines make its role more obvious.
3LineOfCredit.sol L33Rename ids to openCreditLines.ids is an ordered list of credit lines that are open. Renaming it to openCreditLines would better reflect its purpose.
4LineOfCredit.sol L241, LineOfCredit.sol L259Remove require in addCredit() and setRates().The require call will always pass, as InterestRate.setRate will always return true. Remove the require statement and keep the call to interestRate.setRate().
5SpigotedLineLib.sol L205, SpigotedLineLib.sol L232Remove return statement from releaseSpigot and sweep.The return statement in both of these functions is unreachable due to the revert statement before it.
6SpigotedLineLib.sol L215NatSpec return value documentation for sweep function is incorrect.The NatSpec for the return value seems to be copied from SpigotedLineLib.releaseSpigot. Consider changing it to @return - whether or not sweep was successful
7ILineFactory.sol L7Rename cratio to cRatio.Keep the parameter names consistent with other uses in the codebase, such as dRate and fRate.

Message Improvements for require Statements

The following table shows usages of require that do not return error messages should the condition fail.

#FileFunctionSuggested Error Message
8EscrowedLine.sol L64_getCollateralValue()"failed to liquidate escrowed collateral"
9EscrowedLine.sol L90_rollover()"failed to transfer line ownership"
10LineOfCredit.sol L112healthcheck()"line not initialized"
11LineOfCredit.sol L241, LineOfCredit.sol L259addCredit(), setRates()"failed to set interest rates"
12LineOfCredit.sol L326depositAndRepay()"repayment amount greater than total debt"
13SpigotedLine.sol L62constructor()"invalid revenue split ratio"
14SpigotedLine.sol L143useAndRepay()"amount exceeds unused token balance"
15SpigotedLine.sol L160claimAndTrade()"only borrower"
16SpigotedLine.sol L239updateWhitelist()"only arbiter"
17EscrowLib.sol L91, EscrowLib.sol L161, EscrowLib.sol L198addCollateral(), releaseCollateral(), liquidate()"zero amount not allowed"
18EscrowLib.sol L105enableCollateral()"only arbiter"
19EscrowLib.sol L216updateLine()"only line"
20SpigotedLineLib.sol L147updateOwner()"failed to update spigot owner"
21SpigotLib.sol L96claimRevenue()"failed to send tokens to treasury"
22SpigotLib.sol L128addSpigot()"only revenue contract"
23SpigotLib.sol L130addSpigot()"spigot already exists"
24SpigotLib.sol L155removeSpigot()"failed to transfer revenue contract ownership"
25SpigotLib.sol L180, SpigotLib.sol L189, SpigotLib.sol L201updateOwner(), updateOperator(), updateTreasury()"invalid target address"

Spelling Errors

The following spelling errors and misplaced characters were found in one or more source files. Search for the Spelling Error term to find occurrences. Consider correcting errors found in NatSpec documentation first since this will improve the developer experience for end callers.

#Spelling ErrorSuggested Fix
26*(@dev priviliegad* @dev privileged
27SecuredlLineSecuredLine
28swithcswitch
29repymentrepayment
30MutualConsentRegistseredMutualConsentRegistered
31renegounknown
32repaisrepaid
33usefulluseful
34non-rentrantnon-reentrant
35priviligesprivileges
36debitordebtor
37diferentdifferent
38demoninateddenominated
39fulyfully
40LineofCreditLineOfCredit
41interferinterfere
42itselgfitself
43transferedtransferred
44thdepositsthe deposits
45forlendersfor lenders
46acrruedaccrued
47revenuContractrevenueContract
48paramteterparameter
49bwithdrawnwithdrawn
50intersetinterest
51sendingtokens/ETHsending tokens/ETH
52adddressaddress
53revenuwrevenue

NatSpec Errors

Any other error found in NatSpec that aren't related to spelling.

#FileError
54ISecuredLine.sol L16Incomplete return value description.

#0 - c4-judge

2022-12-07T17:30:02Z

dmvt marked the issue as grade-b

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter