Redacted Cartel contest - jadezti's results

Boosted GMX assets from your favorite liquid token wrapper, Pirex - brought to you by Redacted Cartel.

General Information

Platform: Code4rena

Start Date: 21/11/2022

Pot Size: $90,500 USDC

Total HM: 18

Participants: 101

Period: 7 days

Judge: Picodes

Total Solo HM: 4

Id: 183

League: ETH

Redacted Cartel

Findings Distribution

Researcher Performance

Rank: 61/101

Findings: 1

Award: $53.49

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

[NC-1]  A fixed version of solidity compiler is preferred

Link to code

File: src/vaults/PirexERC4626.sol 2: pragma solidity >=0.8.0;

To replace pragma solidity >=0.8.0; with pragma solidity 0.8.17; so as to be consistent with other smart contract files.

[NC-2] Comment messages inconsistent with code

Instances (2)

Instance 1:

File: src/PirexRewards.sol 336: @return rewardAmounts ERC20[] Reward token amounts 343: uint256[] memory rewardAmounts

The above Line 336 should be: @return rewardAmounts int256[] Reward token amounts, with reference to Line 343.

Instance 2:

File: src/vaults/AutoPxGlp.sol 86: // Approve the Uniswap V3 router to manage our base reward (inbound swap token) 87: gmxBaseReward.safeApprove(address(_platform), type(uint256).max);

The above Line 86 Approve the Uniswap V3 router to manage our base reward (inbound swap token) should be Approve the platform (e.g. PirexGmx) to manage our base reward (inbound swap token)

[NC-3] State variable owner is shadowed by function parameter

Instances (6)

Contract AutoPxGmx and AutoPxGlp are owned contracts which inherit the state variable owner. However, several functions of the contracts shadow the state variable owner. This may confuse users. The suggestion is to change the function parameter to address _owner and make correspoding changes in the function body.

Instance 1: File: src/vaults/AutoPxGmx.sol Line 342: address owner

Instance 2: File: src/vaults/AutoPxGmx.sol Line 318: address owner

Instance 3: File: src/vaults/AutoPxGlp.sol Line 439: address owner

Instance 4: File: src/vaults/AutoPxGlp.sol Line 452: address owner

Instance 5: File: src/vaults/AutoPxGlp.sol Line 488: address owner

Instance 6: File: src/vaults/AutoPxGlp.sol Line 502: address owner

[NC-4] AutoPxGmx.compound() function should be refactored

Function setPoolFee() set the state variable poolFee. So, function AutoPxGmx.compound() can use the poolFee directly and remove the fee parameter from its input parameters. Removing fee parameter also (1) reduces the risk of setting it to an inappropriate value by a user when calling the compound() function, (2) saves gas.

Changes to make: 1 Remove Line 243: uint24 fee, 2 Replace Line 272: fee: fee, with fee: poolFee,

Other relevant changes: Replace Line 321, Line 345, and Line 227 with compound(1, 0, true);

#0 - c4-judge

2022-12-04T20:34:11Z

Picodes marked the issue as grade-a

#1 - c4-sponsor

2022-12-09T07:44:24Z

drahrealm marked the issue as sponsor confirmed

#2 - c4-judge

2023-01-01T10:27:45Z

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