LI.FI contest - tchkvsky's results

Bridge & DEX Aggregation.

General Information

Platform: Code4rena

Start Date: 24/03/2022

Pot Size: $75,000 USDC

Total HM: 15

Participants: 59

Period: 7 days

Judge: gzeon

Id: 103

League: ETH

LI.FI

Findings Distribution

Researcher Performance

Rank: 46/59

Findings: 2

Award: $175.12

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

113.5781 USDC - $113.58

Labels

bug
resolved
QA (Quality Assurance)

External Links

Declared event in WithdrawFacet.sol doesn't match emitted event

Handle

tchkvsky

Vulnerability details

Declared event in #L12 of WithdrawFacet.sol doesn't match emitted event (called parameters) in #L37

Impact

This could lead to logging incorrect transactions

Proof of Concept

WithdrawFacet.sol#L12

event LogWithdraw(address indexed _assetAddress, address _from, uint256 amount);

and

WithdrawFacet.sol#L37

emit LogWithdraw(sendTo, _assetAddress, _amount);

does not match

Tools Used

Manual review

Recommendation

Consider changing (#L12)

event LogWithdraw(address indexed _assetAddress, address _from, uint256 amount);

to

event LogWithdraw(address indexed _assetAddress, address _to, uint256 _amount);

AND (#L37)

emit LogWithdraw(sendTo, _assetAddress, _amount);

to

emit LogWithdraw(_assetAddress, sendTo, _amount);

Useful links:

Awards

61.5429 USDC - $61.54

Labels

bug
G (Gas Optimization)
resolved

External Links

Prefix increments are cheaper than postfix increments.

Handle

tchkvsky

Vulnerability details

These functions use not using prefix increments (++x)

Impact

Using prefix increment is more gas efficient

Proof of Concept

DexManagerFacet.sol

#L33

#L52

#L65

Swapper.sol

#L14

Tools Used

Manual review

Recommendation

Consider using prefix increments (++i) to save gas

#0 - H3xept

2022-04-01T10:03:07Z

We internally decided to ignore prefix increments for now.

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