Timeswap contest - Iurii3's results

Like Uniswap, but for lending & borrowing.

General Information

Platform: Code4rena

Start Date: 20/01/2023

Pot Size: $90,500 USDC

Total HM: 10

Participants: 59

Period: 7 days

Judge: Picodes

Total Solo HM: 4

Id: 206

League: ETH

Timeswap

Findings Distribution

Researcher Performance

Rank: 58/59

Findings: 1

Award: $48.54

Gas:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

48.5424 USDC - $48.54

Labels

bug
G (Gas Optimization)
grade-b
G-18

External Links

[G-01] Sequence of tests.

Comparison operations are match cheaper that loading. In case of wrong zero address or amount it will revert with less gas consumption.

Consider moving hasLiquidity check lower then zero checks: TimeswapV2Pool.sol#152

Consider moving hasInteracted check lower then zero checks: TimeswapV2Option.sol#97


[G-02] Token0/token1 comparison

While creating and getting the option pair there are two places with the checkCorrectFormat check that will revert transaction in case token0 < token1.

TimeswapV2OptionFactory.sol#L30 TimeswapV2OptionFactory.sol#L46

Consider using Uniswap v2 code in both instances to be sure that transaction wouldn't fail

(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);

[G-03] Two NoDelegateCall.sol contracts.

There are two same NoDelegateCall.sol contracts. One in pool folder, another in options. Consider moving it to v2-library and use same for both parts of the product and thus save gas on deployments.

#0 - c4-judge

2023-02-02T12:30:36Z

Picodes marked the issue as grade-b

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