Phuture Finance contest - minhquanym's results

Crypto index platform, that simplifies your investments through automated, themed index products.

General Information

Platform: Code4rena

Start Date: 19/04/2022

Pot Size: $30,000 USDC

Total HM: 10

Participants: 43

Period: 3 days

Judges: moose-code, JasoonS

Total Solo HM: 7

Id: 90

League: ETH

Phuture Finance

Findings Distribution

Researcher Performance

Rank: 23/43

Findings: 2

Award: $98.79

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

69.53 USDC - $69.53

Labels

bug
QA (Quality Assurance)

External Links

1. ManagedIndex can be initialize with totalWeight not equal to MAX_WEIGHT

Impact

Proof of concept

Check for sum of _weights[] equal to MAX_WEIGHT

2. Should add Router to help users mint and burn index token

Impact

  • In mint and burn function, contract assumes users had already deposit required tokens.
  • But if users transfer tokens in another transaction before mint, anyone can front-run and call mint to claim that minted index token.
  • Besides that, users cannot figure out exactly how many tokens they should transfer in, and can loss the left over if the amounts transferred in is not weighted correctly.

Proof of concept

  • Add Router contract to help users transfer token in, call mint and burn all in one transaction.

Awards

29.2584 USDC - $29.26

Labels

bug
G (Gas Optimization)

External Links

1. Cache assets.at(i) and inactiveAssets.at(i) can save gas

Details

  • In IndexLogic, each time assets.at(i) is called, at least 1 storage read operation (100 gas). Should cache it to memory variables to save gas.
  • Similarly in reweight function of ManagedIndexReweightingLogic, TrackedIndexReweightingLogic, TopNMarketCapReweightingLogic

Occurences

Cache assets.at(i), for example

address asset = assets.at(i);
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