Y2k Finance contest - WilliamAmbrozic's results

A suite of structured products for assessing pegged asset risk.

General Information

Platform: Code4rena

Start Date: 14/09/2022

Pot Size: $50,000 USDC

Total HM: 25

Participants: 110

Period: 5 days

Judge: hickuphh3

Total Solo HM: 9

Id: 162

League: ETH

Y2k Finance

Findings Distribution

Researcher Performance

Rank: 107/110

Findings: 1

Award: $16.18

🌟 Selected for report: 0

🚀 Solo Findings: 0

Gas Optimization Report

17/09/2022 14:59 Y2K Finance Note: Contracts are ordered as they appear in the repo. Suggestions are ordered by the line they occurred. Tools Used: Remix, Manual Analysis


PegOracle.sol

Require statements under 32 characters save on gas

  • line(s) in question: 23, 24

StakingRewards.sol

Making public variables immutable saves on gas

id is only defined in the constructor; therefore can be changed to immutable.

  • line(s): 41

uint != 0 saves gas relative to uint > 0

  • line(s) in question: 134

Suggestion: Change if (reward > 0) to if (reward != 0).

Require statements under 32 characters save on gas

  • line(s) in question: 219, 228

SemiFungibleVault.sol

Require statements under 32 characters save on gas

  • line(s) in question: 118

Vault.sol

Modifiers only used once

  • epochHasNotStarted: line 87
  • epochHasNotStarted: line 95

Suggestion: in-line the modifiers per function.


VaultFactory.sol

i += 1 uses more gas than ++i

  • line(s) in question: 195

Suggestion: change line 195 from marketIndex += 1 to ++marketIndex.


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