Quantstamp reviewed Epoch Island (Epoch Island - LP Pool) on 7 Nov 2023: 14 findings, 0 critical; 6 marked fixed, 6 acknowledged, 2 open.
Report hosted on certificate.quantstamp.com.
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 0 | 0 | 0 |
| Medium | 0 | 1 | 2 |
| Low | 2 | 5 | 4 |
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.
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()`.
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.
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.
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".
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.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (1)
236 projects reviewed · 332 reports · latest Oct 2026
See Quantstamp’s auditsSomething 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