Inverse Finance contest - cducrest's results

Rethink the way you borrow.

General Information

Platform: Code4rena

Start Date: 25/10/2022

Pot Size: $50,000 USDC

Total HM: 18

Participants: 127

Period: 5 days

Judge: 0xean

Total Solo HM: 9

Id: 175

League: ETH

Inverse Finance

Findings Distribution

Researcher Performance

Rank: 82/127

Findings: 1

Award: $36.73

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

C4 audit contest: 2022-10-inverse

Low Risk: dbr approve does not check initial allowance

Description: If there is an existing allowance from Alice to Bob of x, and Alice wants to update it to y, she will call approve(Bob, y). If before transaction execution (e.g. via front-running) Bob calls transferFrom(Alice, Bob, x), he will be able to withdraw x before the approval and y again after the execution of Alice's approve. The same reasoning applies to the permit function.

Suggestion: Add a require(allowance[msg.sender][spender] == 0) in approve and require(allowance[owner][spender] == 0) in permit.

Reference: https://github.com/code-423n4/2022-10-inverse/blob/main/src/DBR.sol#L159 https://github.com/code-423n4/2022-10-inverse/blob/main/src/DBR.sol#L224

Non-Critical: dbr.replenishmentPriceBps must be >= 100%

Description: The protocol makes no sense and is vulnerable if dbr.replenishmentPriceBps is lower than 10_000. It would mean the replenishment costs are lower than the amount minted to users on replenishment (i.e. the market operates at a loss).

Suggestion: Add require(replenishmentPriceBps >= 10_000) in constructor and setReplenishmentPriceBps of DolaBorrowingRights

Reference: https://github.com/code-423n4/2022-10-inverse/blob/main/src/DBR.sol#L330

Non-Critical: Inconsistencies in between constructor and setter functions

Description: In market.sol setLiquidationFactorBps and setReplenismentIncentiveBps cannot set the liquidationFactorBps and replenishmentIncentiveBps to 0 while the constructor can.

Suggestion: Use similar requirements in the constructor and setters function

Reference: https://github.com/code-423n4/2022-10-inverse/blob/main/src/Market.sol#L161 https://github.com/code-423n4/2022-10-inverse/blob/main/src/Market.sol#L172

#0 - c4-judge

2022-11-08T00:31:12Z

0xean 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