Overlay Protocol contest - cmichel's results

A protocol for trading #DeFi data streams.

General Information

Platform: Code4rena

Start Date: 16/11/2021

Pot Size: $50,000 ETH

Total HM: 11

Participants: 17

Period: 7 days

Judge: LSDan

Total Solo HM: 8

Id: 49

League: ETH

Overlay Protocol

Findings Distribution

Researcher Performance

Rank: 1/17

Findings: 4

Award: $9,592.02

🌟 Selected for report: 3

🚀 Solo Findings: 1

Findings Information

🌟 Selected for report: cmichel

Labels

bug
3 (High Risk)
sponsor confirmed

Awards

1.6578 ETH - $7,659.53

External Links

Handle

cmichel

Vulnerability details

The OverlayV1UniswapV3Market.fetchPricePoint tries to compute the market depth in OVL terms as marketLiquidity (in ETH) / ovlPrice (in ETH per OVL). To get the market liquidity in ETH (and not the other token pair), it uses the ethIs0 boolean.

_marketLiquidity = ethIs0
    ? ( uint256(_liquidity) << 96 ) / _sqrtPrice
    : FullMath.mulDiv(uint256(_liquidity), _sqrtPrice, X96);

However, ethIs0 boolean refers to the ovlFeed, whereas the _liquidity refers to the marketFeed, and therefore the ethIs0 boolean has nothing to do with the market feed where the liquidity is taken from:

// in constructor, if token0 is eth refers to ovlFeed
ethIs0 = IUniswapV3Pool(_ovlFeed).token0() == _eth;

// in fetchPricePoint, _liquidity comes from different market feed
( _ticks, _liqs ) = IUniswapV3Pool(marketFeed).observe(_secondsAgo);
_marketLiquidity = ethIs0
    ? ( uint256(_liquidity) << 96 ) / _sqrtPrice
    : FullMath.mulDiv(uint256(_liquidity), _sqrtPrice, X96);

Impact

If the ovlFeed and marketFeed do not have the same token position for the ETH pair (ETH is either token 0 or token 1 for both pairs), then the market liquidity & depth is computed wrong (inverted). For example, the OverlayV1Market.depth() function will return a wrong depth which is used in the market cap computation.

It seems that marketFeed.token0() == WETH should be used in fetchPricePoint to compute the liquidity instead of ovlFeed.token0() == WETH.

#0 - commercium-sys

2021-12-03T16:27:24Z

Yeah, was aware of this, just hadn't finalized it in the code as of yet.

Findings Information

🌟 Selected for report: gpersoon

Also found by: WatchPug, cmichel, defsec, harleythedog, hubble, xYrYuYx

Labels

bug
duplicate
2 (Med Risk)

Awards

0.0378 ETH - $174.45

External Links

Handle

cmichel

Vulnerability details

The OverlayToken has a transferMint and transferBurn function which is supposed to act like a transfer followed by a mint/burn. However, a mint/burn updates the _totalSupply (see _mint/_burn) but these functions do not.

The transferMint and transferBurn should have the same semantics as a transfer followed by a mint/burn.

#0 - mikeyrf

2021-12-06T23:46:18Z

duplicate #59

Findings Information

🌟 Selected for report: defsec

Also found by: WatchPug, cmichel, gzeon, nathaniel, pauliax

Labels

bug
duplicate
2 (Med Risk)

Awards

0.0489 ETH - $226.14

External Links

Handle

cmichel

Vulnerability details

The Overlayv1Mothership.adjustGlobalParams function allows setting a fee and feeBurn that is greater than 100%.

Validate that fee and feeBurn is less than ONE = 1e18.

#0 - mikeyrf

2021-12-06T23:29:29Z

duplicate #77 - bounds on governance params

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