Olympus DAO contest - PPrieditis's results

Version 3 of Olympus protocol, a decentralized floating currency.

General Information

Platform: Code4rena

Start Date: 25/08/2022

Pot Size: $75,000 USDC

Total HM: 35

Participants: 147

Period: 7 days

Judge: 0xean

Total Solo HM: 15

Id: 156

League: ETH

Olympus DAO

Findings Distribution

Researcher Performance

Rank: 105/147

Findings: 1

Award: $54.31

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

Lines of code

https://github.com/code-423n4/2022-08-olympus/blob/main/src/modules/TRSRY.sol#L104-L119

Vulnerability details

TRSRY.sol alows only loan owner to repay loan

It should be allowed that that everyone can repay the loan. There could be a situation that loan owner is not able to repay the loan but a different address could repay in his place. It seems as unnecessary restriction that only the owner can repay his loan.

Recommendation: Allow everyone to repay any loan. Context: TRSRY.sol#L104-L119

-    function repayLoan(ERC20 token_, uint256 amount_) external nonReentrant {
-        if (reserveDebt[token_][msg.sender] == 0) revert TRSRY_NoDebtOutstanding();

        // Deposit from caller first (to handle nonstandard token transfers)
        uint256 prevBalance = token_.balanceOf(address(this));
        token_.safeTransferFrom(msg.sender, address(this), amount_);

        uint256 received = token_.balanceOf(address(this)) - prevBalance;

        // Subtract debt from caller
-        reserveDebt[token_][msg.sender] -= received;
        totalDebt[token_] -= received;

-        emit DebtRepaid(token_, msg.sender, received);
    }

#0 - ind-igo

2022-09-08T03:27:37Z

Confirmed. Although I think the severity is not accurate, and instead is a QA issue.

#1 - 0xean

2022-09-19T18:46:45Z

agreed, QA.

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