veRWA - RHaO-sec's results

Incentivization Primitive for Real World Assets on Canto

General Information

Platform: Code4rena

Start Date: 07/08/2023

Pot Size: $36,500 USDC

Total HM: 11

Participants: 125

Period: 3 days

Judge: alcueca

Total Solo HM: 4

Id: 274

League: ETH

Canto

Findings Distribution

Researcher Performance

Rank: 65/125

Findings: 1

Award: $9.82

QA:
grade-a

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2023-08-verwa/blob/main/src/VotingEscrow.sol#L129-L136

Vulnerability details

Impact

There are couple of instance of using result of a division for multiplication while can cause larger values of bias.

Proof of Concept

The VotingEscrow.sol consists of the following code at VotingEscrow.sol#L129-L136

if (_oldLocked.end > block.timestamp && _oldLocked.delegated > 0) { userOldPoint.slope = _oldLocked.delegated / int128(int256(LOCKTIME)); userOldPoint.bias = userOldPoint.slope * int128(int256(_oldLocked.end - block.timestamp)); } if (_newLocked.end > block.timestamp && _newLocked.delegated > 0) { userNewPoint.slope = _newLocked.delegated / int128(int256(LOCKTIME)); userNewPoint.bias = userNewPoint.slope * int128(int256(_newLocked.end - block.timestamp)); }

in the above case the user01dPoint.slope value is calculated by dividing _oldLocked.delegated by int128(int256(LOCKTIME)).

Later the userOldPoint.slope value is used to calculate the userOldPoint.slope by multiply further which make the bias value or y co-ordinate value more big.

Tools Used

Manual

First Multiply all the numerators and then divide it by the product of all the denominator.

Assessed type

Math

#0 - c4-pre-sort

2023-08-12T12:33:29Z

141345 marked the issue as primary issue

#1 - c4-pre-sort

2023-08-14T01:48:56Z

141345 marked the issue as duplicate of #299

#2 - c4-judge

2023-08-24T05:37:15Z

alcueca changed the severity to QA (Quality Assurance)

#3 - c4-judge

2023-08-25T22:47:50Z

alcueca marked the issue as grade-a

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