Panoptic - twcctop's results

Permissionless, perpetual options trading on any token, any strike, any size.

General Information

Platform: Code4rena

Start Date: 01/04/2024

Pot Size: $120,000 USDC

Total HM: 11

Participants: 55

Period: 21 days

Judge: Picodes

Total Solo HM: 6

Id: 354

League: ETH

Panoptic

Findings Distribution

Researcher Performance

Rank: 46/55

Findings: 1

Award: $32.96

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

32.9585 USDC - $32.96

Labels

bug
downgraded by judge
grade-b
QA (Quality Assurance)
satisfactory
:robot:_61_group
duplicate-501
Q-30

External Links

Lines of code

https://github.com/code-423n4/2024-04-panoptic/blob/58dda1b3b74e48f4d924731ec5da14096043fde0/contracts/CollateralTracker.sol#L420

Vulnerability details

Impact

due to the improper check, system is possible to mint more token than it should, and the maxMint limit may not work

Proof of Concept

we have maxMint check function defined :

    function maxMint(address) external view returns (uint256 maxShares) {
       unchecked {
           return (convertToShares(type(uint104).max) * DECIMALS) / (DECIMALS + COMMISSION_FEE);
       }
   }

but in actual mint function, we do not use this function:

function mint(uint256 shares, address receiver) external returns (uint256 assets) {
        assets = previewMint(shares);
@>        if (assets > type(uint104).max) revert Errors.DepositTooLarge();

 ...

we just use type(uint104).max instead of maxMint,which makes the maxmint check not work properly

Tools Used

manual

change to maxMint check

Assessed type

Invalid Validation

#0 - c4-judge

2024-04-25T20:49:16Z

Picodes marked the issue as duplicate of #553

#1 - c4-judge

2024-04-29T21:39:56Z

Picodes marked the issue as satisfactory

#2 - c4-judge

2024-05-09T19:15:20Z

Picodes changed the severity to QA (Quality Assurance)

#3 - c4-judge

2024-05-10T00:08:54Z

Picodes 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