Debt DAO contest - saneryee'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: 55/120

Findings: 2

Award: $110.58

QA:
grade-b
Gas:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Low Risk

IssueInstances
[L-001]approve should be replaced with safeIncreaseAllowance() or safeDecreaseAllowance()1
[L-002]Events not emitted for important state changes / Missing event for critical parameter changes1

[L-001] approve should be replaced with safeIncreaseAllowance() or safeDecreaseAllowance()

Description:

approve is subject to a known front-running attack. Consider using safeIncreaseAllownce() or safeDecreaseAllowance() instead

Findings:

Total:1

SpigotedLineLib.sol#L134

134: IERC20(sellToken).approve(swapTarget, amount);

[L-002] Events not emitted for important state changes / Missing event for critical parameter changes

Description:

When changing state variables events are not emitted. Emitting events allows monitoring activities with off-chain monitoring tools.

Findings:

Total:1

InterestRateCredit.sol#L74

74: function setRate(

#0 - c4-judge

2022-12-06T21:46:33Z

dmvt marked the issue as grade-b

Awards

49.2315 USDC - $49.23

Labels

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

External Links

Gas Optimization

IssueInstances
[G-001]Functions guaranteed to revert when called by normal users can be marked payable2
[G-002]Use Assembly to check for address(0)4
[G-003]internal function only called once can be inlined to save gas1

[G-001] Functions guaranteed to revert when called by normal users can be marked payable

Description:

If a function modifier such as onlyOwner is used, the function will revert if a normal user tries to pay the function. Marking the function as payable will lower the gas cost for legitimate callers because the compiler will not include checks for whether a payment was provided.

Findings:

Total:2

InterestRateCredit.sol#L38

38: ) external override onlyLineContract returns (uint256) {

InterestRateCredit.sol#L78

78: ) external onlyLineContract returns (bool) {

[G-002] Use Assembly to check for address(0)

Description:

Saves 6 gas per instance if using assemlby to check for address(0)

Findings:

Total:4

LineOfCredit.sol#L445

445: if(credits[id].lender != address(0)) { revert PositionExists(); }

SpigotLib.sol#L180

180: require(newOwner != address(0));

SpigotLib.sol#L189

189: require(newOperator != address(0));

SpigotLib.sol#L201

201: require(newTreasury != address(0));

[G-003] internal function only called once can be inlined to save gas

Description:

Not inlining costs 20 to 40 gas because of two extra JUMP instructions and additional stack operations needed for function calls.

Findings:

Total:1

EscrowedLine.sol#L25

25: function _init() internal virtual returns(LineLib.STATUS) {

#0 - c4-judge

2022-11-17T22:58: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