OasisSwap

QuantstampFiles named in the report

Quantstamp reviewed OasisSwap on 8 Aug 2023: 15 findings, 0 critical; 6 marked fixed, 7 acknowledged, 2 open.

No open critical findings
Open the reportOpen OasisSwap’s security record

Report hosted on certificate.quantstamp.com.

Trustblock does not review code.

Findings15

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

SeverityOpenAcknowledgedFixed
Critical000
High000
Medium011
Low265
LowMissing Input ValidationOpen

It is important to validate inputs, even if they only come from trusted addresses, to avoid human error. The following inputs could benefit from additional validation: * In `OasisSwapFactory` * `setFeeManager()`, `manager` should be validated to be a non-zero address. * `setMigrator()`, `migrator` should be validated to be a non-zero address. * `setRebateApprovedRouter()`, `router` should be validated to be a non-zero address. * `setRebateManager()`, `_rebateManager` should be validated to be a non-zero address. * `setFeeTo()`, `_feeTo` should be validated to be a non-zero address. * `createPair `, `token1 ` should be validated to be a non-zero address. * In `OasisSwapPair` * `withdrawFee()`, `_to` should be validated to be a non-zero address. The following functions do not validate the `to` address: * OasisSwapPair: * `_swap()` * `burn()` * OasisSwapERC20: * `mint()` * `burn()` * `transfer()` * OasisSwapRouter: * `addLiquidity()` * `addLiquidityETH()` * `removeLiquidity()` * `removeLiquidityETH()` * `removeLiquidityWithPermit()` * `removeLiquidityETHWithPermit()` * `swapExactTokensForTokens()` * `swapTokensForExactTokens()` * `swapExactETHForTokens()` * `swapTokensForExactETH()` * `swapExactTokensForETH()` * `swapETHForExactTokens()`

LowPrivileged Roles and OwnershipOpen

If the contract's owner account is compromised an attacker could modify key variables that may affect users of the platform. This includes changing the fee structure, migrator address, fee manager, rebate manager, and approved routers. There is a couple of detailed examples: - `setFee()`: - `fee`: In our analysis of Oasis Swap's fee structure, we noted that the contract owner possesses the ability to reconfigure fees through the `setFee` function. During deployment and initialization, this fee is derived from the factory contract, which is initially set at 1%. However, the `setFee` function comes with an upper limit of 100%, implying the fee can be adjusted up to 100%. A configuration of the fee to this extent would allow for the contract owner to accrue all swapped amounts for later collection and user would not receive the swapped token amounts. - `setFee()`: - `oasisFeeProportion`: `OasisSwap`, as a fork of Uniswap v2, has inherited the fee distribution mechanism to Liquidity Providers (LPs). However, the distribution of the Oasis fee is implemented prior to the LPs receiving their fees. The ratio of distribution between the Oasis project and LPs is governed by the `oasisFeeProportion` variable, which can be adjusted through the `setFee` function by the contract owner. Presently, OasisSwap diverts 50% of the fee to the project and distributes the remaining 50% to LPs. Nonetheless, the `setFee` function is designed with an upper limit of 100%, implying that the contract owner could potentially receive 100 percent of fees to the project, thereby leaving the LPs without their deserved portion. - The Oasis team provides a fee rebate for certain users. For example: If a standard swap fee is 1% and a user is qualified for a 10% discount, the total fee would then be 0.9% for that swap. This is managed through the `rebate` parameter, which is derived from the `RebateEstimator` contract. Though the `RebateEstimator` contract was not part of this assessment, it's assumed that varying rebate rates will apply to different users. At present, the `OasisSwapPair` contract doesn't impose a fee rebate limit for the `swapCalculatingRebate` function, but it does enforce a 100% discount cap within the `swapWithRebate` function. Overly generous or full fee discounts could disincentivize LPs from providing liquidity. Implementing a non-modifiable upper limit would offer LPs a means to assess their risk in terms of potential impermanent loss. - `setRebateEstimator()`: Allows the owner to set the `rebateEstimator` address, which may have the following impact: - Changing the fee rebate calculation logic, which may result in users receiving more or less of a fee rebate than before. - Introducing potential security vulnerabilities if the new implementation has not been properly audited or contains bugs. - `setFeeTo()`: Allows the owner to set the `feeTo` address. - `setMigrator()`: Allows the owner to set the `migrator` address. - `setFeeManager()`: Allows the owner to set the `isFeeManager_` mapping for a given manager address. - `setRebateApprovedRouter()`: Allows the owner to set the `rebateApprovedRouters` mapping for a given router address. Rebate approved router addresses are allowed calling the `OasisSwapPair.swapWithRebate()` with any rebate value. - `setRebateManager()`: Allows the owner to set the `rebateManager` address.

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)

  • contracts/*

Part of OasisSwap’s security record

OasisSwap
Audits1 audit by 1 firmLast audit Aug 2023, by Quantstamp.
Critical findingsNo open critical findingsIn 1 report.
Open OasisSwap’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