LI.FI contest - Hawkeye'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: 42/59

Findings: 2

Award: $177.72

🌟 Selected for report: 0

🚀 Solo Findings: 0

Check that the array lengths are the same since it's the string that is the key that maps to the specific configs:

https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Facets/HopFacet.sol#L49

Consider emitting events for addDex() & removeDex(). Useful for user to be timely updated about the available Dexes:

https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Facets/DexManagerFacet.sol#L17

https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Facets/DexManagerFacet.sol#L44

Ensure that there's enough balance before making a swap:

(https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Facets/GenericSwapFacet.sol#L28)

For the aforementioned, require (postBalance>0, ‘’)

Check that the length of the array is >0:

https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Facets/NXTPFacet.sol#L87

https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Facets/NXTPFacet.sol#L152

the check in _executeSwap() is invalidated as there's no condition available since the array is empty.

#0 - H3xept

2022-04-01T09:20:56Z

Enough balance before swap is fixed by lifinance/lifi-contracts@91870a578e8dd315b057acc5eb3370ffa0186208

#1 - H3xept

2022-04-11T11:44:29Z

Re Ensure that there's enough balance before making a swap

Duplicate of #76

Awards

61.5429 USDC - $61.54

Labels

bug
G (Gas Optimization)
resolved
sponsor acknowledged

External Links

(https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Facets/AnyswapFacet.sol#L103)

can use unchecked block since the prior ‘require ‘statement ensures that there is no underflow.

#0 - H3xept

2022-04-01T09:50:03Z

We internally decided to avoid unchecked statements 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