Redacted Cartel contest - karanctf'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: 87/101

Findings: 1

Award: $39.65

Gas:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

39.6537 USDC - $39.65

Labels

bug
G (Gas Optimization)
grade-b
sponsor confirmed
G-24

External Links

  • Declare vairable outside of loop in functions as it gets relocated and consume more gas
  • Remove block.timestamp and block.number as they are added to event information by default so adding them manually wastes gas.
src/vaults/PxGmxReward.sol:61: emit GlobalAccrue(block.timestamp, totalSupply, rewards); src/vaults/PxGmxReward.sol:83: emit UserAccrue(user, block.timestamp, balance, rewards); src/PirexRewards.sol:297: emit UserAccrue(producerToken, user, block.timestamp, balance, rewards);
  • Use immutable rather than constant for keccak256() calls
src/PxERC20.sol:9: bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); src/PxERC20.sol:10: bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
  • Declare p and r outside for loop
src/PirexRewards.sol-351- for (uint256 i; i < pLen; ++i) { src/PirexRewards.sol:352: ERC20 p = _producerTokens[i]; src/PirexRewards.sol-353- uint256 r = rewardAmounts[i];
  • use unchecked in ++i in for loops

#0 - c4-judge

2022-12-05T11:16:36Z

Picodes marked the issue as grade-b

#1 - drahrealm

2022-12-09T07:02:48Z

First finding considered for implementation

#2 - c4-sponsor

2022-12-09T07:02:53Z

drahrealm marked the issue as sponsor confirmed

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