Debt DAO contest - 0xRoxas'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: 85/120

Findings: 1

Award: $61.35

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

QA Report

Found NC [5]

[NC-01] Pragma is not Forced (Floating Pragma)

https://swcregistry.io/docs/SWC-103

Findings [4]:

/contracts/modules/credit/LineOfCredit.sol Line(s): 1

1:	pragma solidity ^0.8.9;

/contracts/modules/credit/SpigotedLine.sol Line(s): 1

1:	pragma solidity ^0.8.9;

/contracts/modules/credit/SecuredLine.sol Line(s): 1

1:	pragma solidity ^0.8.9;

/contracts/modules/oracle/Oracle.sol Line(s): 2

2:	pragma solidity ^0.8.9;

[NC-02] Require Statements Missing Error Message

Error messages help with troubleshooting, some require statements are missing error messages.

Findings [18]:

/contracts/modules/credit/LineOfCredit.sol Line(s): 112, 326

112:	require(uint(status) >= uint( LineLib.STATUS.ACTIVE));
326:	require(amount <= credit.principal + credit.interestAccrued);

/contracts/modules/credit/SpigotedLine.sol Line(s): 62, 143, 160, 239

62:	require(defaultRevenueSplit_ <= SpigotedLineLib.MAX_SPLIT);
143:	require(amount <= unusedTokens[credit.token]);
160:	require(msg.sender == borrower);
239:	require(msg.sender == arbiter);

/contracts/modules/credit/EscrowedLine.sol Line(s): 90

90:	require(escrow.updateLine(newLine));

/contracts/utils/EscrowLib.sol Line(s): 91, 105, 161, 198, 216

91:	require(amount > 0);
105:	require(msg.sender == ILineOfCredit(self.line).arbiter());
161:	require(amount > 0);
198:	require(amount > 0);
216:	require(msg.sender == self.line);

/contracts/utils/SpigotLib.sol Line(s): 128, 130, 155, 180, 189, 201

128:	require(revenueContract != address(this));
130:	require(self.settings[revenueContract].transferOwnerFunction == bytes4(0));
155:	require(success);
180:	require(newOwner != address(0));
189:	require(newOperator != address(0));
201:	require(newTreasury != address(0));

[NC-03] Underscore Notation Improves Readability

Solidity allows for the use of _ between every 3 digits of large numbers.

Findings [2]:

/contracts/modules/interest-rate/InterestRateCredit.sol Line(s): 9

9:	uint256 constant BASE_DENOMINATOR = 10000;

/contracts/modules/factories/LineFactory.sol Line(s): 14

14:	uint32 constant defaultMinCRatio = 3000;

[NC-04] Magic Number Used

Findings [4]:

A magic number 18 is used. Consider making a variable in 18's place.

/contracts/utils/EscrowLib.sol Line(s): 113, 137

113:	deposit.assetDecimals = 18;
137:	deposit.assetDecimals = 18;

/contracts/utils/CreditLib.sol Line(s): 140, 145

140:	decimals = 18;
145:	decimals = !passed ? 18 : abi.decode(result, (uint8));

[NC-05] 1157...9935 Used Instead of type(uint256).max / inconsistency

Findings [1]:

/contracts/utils/EscrowLib.sol Line(s): 25-26

Using 115792089237316195423570985008687907853269984665640564039457584007913129639935 instead of type(uint256).max can lead to mistyping and degrades readability. Note also that this is not consistant with L27 of /contracts/utils/SpigotLib.sol

25:	uint256 constant MAX_INT = 
26:		115792089237316195423570985008687907853269984665640564039457584007913129639935;

#0 - c4-judge

2022-12-06T20:54:49Z

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