Epoch Island - LP Pool

QuantstampFiles named in the report

Quantstamp reviewed Epoch Island (Epoch Island - LP Pool) on 7 Nov 2023: 14 findings, 0 critical; 6 marked fixed, 6 acknowledged, 2 open.

No open critical findings
Open the reportOpen Epoch Island’s security record

Report hosted on certificate.quantstamp.com.

Trustblock does not review code.

Findings14

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High000
Medium012
Low254
MediumLack of Economic Incentive for TakerFixed

The taker has no economic incentive to act upon desired positions immediately. The reason is that the protocol and LP decrease towards the position end. As a result, the conditions for the positions become better for the taker over time. If a taker acts ideally in terms of game theory, they would wait with the trade as long as possible. Therefore, their ideal strategy would be to observe the mempool until they see a transaction that would prevent their transaction and front-run it. A transaction prevents the takers transaction if it reduces the available `downsideToken` amount below the desired amount.

MediumPossible Reentrancy AttacksFixed

The following functions are violating the "Checks-Effects-Interactions"-pattern and/or do not employ any reentrancy mitigating modifers, making them susceptible to reentrancy: 1. `EpochUpsidePoolV1.supply()`. 1. `EpochUpsidePoolV1.remove()`. 1. `EpochUpsidePoolV1.take()`. 1. `EpochUpsidePoolV1.untake()`. 1. `EpochUpsidePoolV1.claimProtocolFees()`. 1. `EpochUpsidePoolV1.claimPositionFees()`.

LowInconsistency in Token Amount Calculations for Large Input Amounts Relative to LiquidityFixed

In the revised `take()` function, there is an issue concerning the calculation of token amounts when the provided `_maxDownsideTokenIn` is larger than the available liquidity. This situation triggers a reverse calculation to adjust the amount of downside tokens after fees (`_downsideTokenBalanceAfterFees`). However, the current implementation may lead to a scenario where the sum of `_downsideTokenBalanceAfterFees`, `protocolFee`, and `lpFee` does not equal the initial `_maxDownsideTokenIn`. This discrepancy can result in users unintentionally committing a higher amount of downside tokens than intended, especially when liquidity is low, leading to unexpected financial implications.

LowInefficient gas usageFixed

We could identify an incident of inefficient gas usage: `lpPositions` is a mapping, although it is treated like an array. It is more expensive to store new values in a mapping as opposed to an array.

LowUnlocked PragmaFixed

Every Solidity file specifies in the header a version number of the format `pragma solidity (^)0.8.*`. The caret (`^`) before the version number implies an unlocked pragma, meaning that the compiler will use the specified version _and above_, hence the term "unlocked".

LowUse of unsafe ERC20 transfer functions and not checking return valuesFixed

The following lines are using the 'unsafe' ERC20 interface functions (`transfer()`): 1. `EpochUpsidePoolV1.sol#L87`. 1. `EpochUpsidePoolV1.sol#L91`. 1. `EpochUpsidePoolV1.sol#L136`. 1. `EpochUpsidePoolV1.sol#L156`. 1. `EpochUpsidePoolV1.sol#L180`. 1. `EpochUpsidePoolV1.sol#L191`. Further, their return values were not checked, which, depending on token, could lead to failed transactions but continued code execution, incorrect accounting within the `EpochUpsidePoolV1.sol` contract and ultimately to loss of funds for the protocol/participants. Since [some ERC20 tokens do not return a value on above mentioned functions/behave non-uniformly](https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca) it is advised to use a secure wrapping interface around said functions, like for example OpenZeppelins [SafeERC20](https://docs.openzeppelin.com/contracts/2.x/api/token/erc20#SafeERC20), which implicitly checks for the different error cases.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (1)

  • EpochUpsidePoolV1.sol

Part of Epoch Island’s security record

Epoch Island
Audits2 audits by 1 firmLast audit Nov 2023, by Quantstamp.
Critical findingsNo open critical findingsAcross 2 reports.
Open Epoch Island’s security record

Security firm

Quantstamp

236 projects reviewed · 332 reports · latest Oct 2026

See Quantstamp’s audits

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us