prePO contest - minhquanym's results

Gain exposure to pre-IPO companies & pre-token projects.

General Information

Platform: Code4rena

Start Date: 17/03/2022

Pot Size: $30,000 USDC

Total HM: 8

Participants: 43

Period: 3 days

Judge: gzeon

Total Solo HM: 5

Id: 100

League: ETH

prePO

Findings Distribution

Researcher Performance

Rank: 27/43

Findings: 2

Award: $80.30

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

51.8842 USDC - $51.88

Labels

bug
QA (Quality Assurance)

External Links

1. Variable _initialAmount in function hook is unused.

Impact

  • Function hook in DepositHook.sol had an input variable _initialAmount but didn’t use anywhere in the function. Same issue with _initialAmount in WithdrawHook.sol

Proof of concept

  • Remove variable _initialAmount

#0 - ramenforbreakfast

2022-03-22T22:44:23Z

duplicate of #5

Awards

28.4169 USDC - $28.42

Labels

bug
G (Gas Optimization)

External Links

1. Gas savings by remove unnecessary variable when calculate _amountToDeposit or _amountWithdrawn

Impact

Variable _valueAfter is unnecessary to keep in memory when we only use it to calculate _amountToDeposit once.

Proof of concept

https://github.com/code-423n4/2022-03-prepo/blob/f63584133a0329781609e3f14c3004c1ca293e71/contracts/core/Collateral.sol#L75-L79 https://github.com/code-423n4/2022-03-prepo/blob/f63584133a0329781609e3f14c3004c1ca293e71/contracts/core/Collateral.sol#L151-L155

For example, change line 78-79 to

_amountToDeposit = _strategyController.totalValue() - _valueBefore;

#0 - ramenforbreakfast

2022-03-22T22:43:37Z

Disputable suggestion, there is value in readability in keeping valueAfter separate. Marking this as duplicate since #41 covers this and is a higher quality submission imo.

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