Venus Prime - 0xTiwa's results

Earn, borrow & lend on the #1 Decentralized Money Market on the BNB chain.

General Information

Platform: Code4rena

Start Date: 28/09/2023

Pot Size: $36,500 USDC

Total HM: 5

Participants: 115

Period: 6 days

Judge: 0xDjango

Total Solo HM: 1

Id: 290

League: ETH

Venus Protocol

Findings Distribution

Researcher Performance

Rank: 110/115

Findings: 1

Award: $4.37

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2023-09-venus/blob/b11d9ef9db8237678567e66759003138f2368d23/contracts/Tokens/Prime/PrimeLiquidityProvider.sol#L118-L126

Vulnerability details

Impact

According to the NATSPEC comments of the initializeTokens(), the main function of the initializeTokens() is to initialize the distributions of tokens in the contract but it does not do that at all. The only thing it does in the function is initialize the tokens for the contract by setting the last accrued block time but if it is meant to initialize the distribution of the tokens it should also call the _setTokenDistributionSpeed() in the function with the appropriate variables.

Proof of Concept

 function initializeTokens(address[] calldata tokens_) external onlyOwner {
        for (uint256 i; i < tokens_.length; ) {
            _initializeToken(tokens_[i]);

            unchecked {
                ++i;
            }
        }
    }

Tools Used

Manual Review

Call the _setTokenDistributionSpeed() in the initializeTokens()

 function initializeTokens(address[] calldata tokens_, uint256[] calldata distributionSpeeds_) external onlyOwner {
        for (uint256 i; i < tokens_.length; ) {
            _initializeToken(tokens_[i]);
     _setTokenDistributionSpeed(tokens_[i], distributionSpeeds_[i]);
          unchecked {
                ++i;
            }
        }
    }

Assessed type

Other

#0 - c4-pre-sort

2023-10-04T23:35:15Z

0xRobocop marked the issue as duplicate of #291

#1 - c4-judge

2023-10-31T19:05:14Z

fatherGoose1 changed the severity to QA (Quality Assurance)

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