Dopex - piyushshukla's results

A rebate system for option writers in the Dopex Protocol.

General Information

Platform: Code4rena

Start Date: 21/08/2023

Pot Size: $125,000 USDC

Total HM: 26

Participants: 189

Period: 16 days

Judge: GalloDaSballo

Total Solo HM: 3

Id: 278

League: ETH

Dopex

Findings Distribution

Researcher Performance

Rank: 124/189

Findings: 1

Award: $24.08

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

24.0823 USDC - $24.08

Labels

bug
3 (High Risk)
partial-25
upgraded by judge
sufficient quality report
duplicate-2083

External Links

Lines of code

https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/perp-vault/PerpetualAtlanticVault.sol#L576

Vulnerability details

Impact

roundUp function results in incorrect rounding behavior when the remainder is greater than the _strike value. This issue may lead to incorrect calculations

Proof of Concept

The roundUp function in the contract does not correctly round up the _strike value when the remainder is greater than _strike. This leads to incorrect results in cases where the remainder is greater than _strike

https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/perp-vault/PerpetualAtlanticVault.sol#L576C3-L584C1

function roundUp(uint256 _strike) public view returns (uint256 strike) { uint256 remainder = _strike % roundingPrecision; if (remainder == 0) { return _strike; } else { return _strike - remainder + roundingPrecision; } }

Tools Used

mannual

Modify the roundUp function to handle cases where the remainder is greater than _strike by adding the difference between roundingPrecision and the remainder to _strike

Assessed type

Math

#0 - c4-pre-sort

2023-09-09T10:10:57Z

bytes032 marked the issue as duplicate of #2083

#1 - c4-pre-sort

2023-09-12T04:43:50Z

bytes032 marked the issue as sufficient quality report

#2 - c4-judge

2023-10-20T14:12:53Z

GalloDaSballo marked the issue as partial-25

#3 - c4-judge

2023-10-21T07:54:11Z

GalloDaSballo changed the severity to 3 (High Risk)

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