Debt DAO contest - emrekocak'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: 106/120

Findings: 1

Award: $49.23

Gas:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

49.2315 USDC - $49.23

Labels

bug
G (Gas Optimization)
grade-b
G-04

External Links

USE A MORE RECENT VERSION OF SOLIDITY

Use a solidity version of at least 0.8.10 to have external calls skip contract existence checks if the external call has a return value

Including all files in the scope.

REPLACE MODIFIER WITH FUNCTION

Modifiers make code more elegant, but cost more than normal functions.

Instances include: contracts/modules/credit/LineOfCredit.sol:78 contracts/modules/credit/LineOfCredit.sol:83 contracts/modules/credit/LineOfCredit.sol:88 contracts/modules/credit/LineOfCredit.sol:98 contracts/modules/interest-rate/InterestRateCredit.sol:25 contracts/utils/MutualConsent.sol:31

Always put your require statement on top in the function

Instances include: contracts/modules/credit/LineOfCredit.sol:259

Use assembly to check for address(0)

Saves 6 gas per instance if using assembly to check for address(0)
e.g.

assembly {  if iszero(_addr) {   mstore(0x00, "zero address")   revert(0x00, 0x20)  } }

Instances include: contracts/modules/credit/LineOfCredit.sol:445 contracts/modules/factories/LineFactory.sol:27 contracts/modules/factories/LineFactory.sol:30 contracts/modules/factories/LineFactory.sol:33 contracts/modules/factories/LineFactory.sol:141 contracts/modules/factories/LineFactory.sol:146 contracts/utils/LineLib.sol:42 contracts/utils/LineLib.sol:67 contracts/utils/LineLib.sol:81 contracts/utils/SpigotLib.sol:189 contracts/utils/SpigotLib.sol:201

Use selfbalance()

Use selfbalance() instead of address(this).balance when getting your contract's balance of ETH to save gas. Instances include: contracts/utils/LineLib.sol:84

#0 - c4-judge

2022-11-17T22:51:37Z

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