Quantstamp reviewed OasisSwap on 8 Aug 2023: 15 findings, 0 critical; 6 marked fixed, 7 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 | 1 |
| Low | 2 | 6 | 5 |
The `swapCalculatingRebate` function within the `OasisSwapPair` contract creates an opportunity for third-party contracts to execute swaps on behalf of Oasis users, utilizing the rebate fee of the caller. This flexibility creates a scenario, where malicious users might abuse this system by leveraging the more favorable rebate rates of one user to conduct less expensive swaps for others. Consequently, they could potentially generate profit from such actions what will have a negative impact on the Oasis protocol. Moreover, this logic incentivizes any user with a lower fee rebate to participate in such a scheme, rendering the entire rebate incentivization strategy ineffective. One of the require checks in `OasisSwapPair.swapCalculatingRebate()` function verifies that controlled `feeController` function argument can be equal to `tx.origin`. This arrangement permits any contract to leverage the fee rebate of the transaction initiator, even under the following circumstances: - Funds don't belong to the `feeController` - Funds are not authorized to be spent by the `feeController` - Funds are not intended to be sent to the `feeController`. Similarly, if a contract can be granted a fee rebate, it can implement a service to enable other users or contracts to benefit from its rebate, not only through the usage of `OasisSwapPair.swapCalculatingRebate()`, but also `swapWithRebate.swapWithRebate()`.
The clone-and-own approach involves copying and adjusting open source code at one's own discretion. From the development perspective, it is initially beneficial as it reduces the amount of effort. However, from the security perspective, it involves some risks as the code may not follow the best practices, may contain a security vulnerability, or may include intentionally or unintentionally modified upstream libraries.
When performing swaps through the `OasisSwapPair` contract, two events will always get emitted upon successful execution: `Swap` and `SwapWithFee`. This could lead to confusion and potential misinterpretation of the platform's events and operations, since both events reference the same swap.
The `OasisSwapPair.mint()` function allows the migrator address (if set) to set the initial liquidity to any desired value. This value is obtained from the `migrator` contract by calling `migrator.desiredLiquidity()`. This represents a risk as the liquidity can be manipulated or mistakenly set, leading to precision loss calculations for future liquidity providers.
The `mevControl` modifier is implemented and added to multiple functions in both the `OasisSwapPair` and `OasisSwapRouter` contracts. However, due to this duplication, the pre and post MEV control functions are executed twice in some cases.
If the owner renounces their ownership, all ownable contracts will be left without an owner. Consequently, any function guarded by the `onlyOwner` modifier will no longer be able to be executed.
As security standards develop, so does the Solidity language. In order to stay up to date with current practices, it's important to use a recent version of Solidity and recent conventions. As an example, one of the main advantages of newer solidity version is the integrated safe math arithmetics that do not require the use of the SafeMath library.
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