SuperBots

CertiKFiles named in the report

CertiK reviewed Superbots on 31 Mar 2023: 25 findings, 0 critical; 15 marked fixed, 10 open.

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

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings25

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

SeverityOpenAcknowledgedFixed
Critical000
High401
Medium003
Low6011
HighCentralization Risks in master_vault.solOpen

In the contract `MasterSuperVault` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and users' assets may suffer loss. ![](https://accelerator-tasks-prod.acc.corp.certik.com/40a6f86ef5b04ea0b2fdd3c12b1322c2/diagrams/centralization_master_vault-MasterSuperVault-_owner.svg)

HighCentralization Risks in vault.solOpen

In the contract `Vault` the role `strategist` has authority over the functions shown in the diagram below. The `strategist` is specified by the `addrGenerator` when the vault is generated. The `addrGenerator` is specified by the owner of the vault factory. Any compromise to the `strategist` account may allow the hacker to take advantage of this authority and users' assets may suffer loss. ![](https://accelerator-tasks-prod.acc.corp.certik.com/40a6f86ef5b04ea0b2fdd3c12b1322c2/diagrams/centralization_vault-Vault-strategist.svg)

HighPotential Flashloan AttackOpen

Flash loans are a way to borrow large amounts of money for a certain fee. The requirement is that the loans need to be returned within the same transaction in a block. If not, the transaction will be reverted. An attacker can use the borrowed money as the initial funds for an exploit to enlarge the profit and/or manipulate the token price in the decentralized exchanges. We find that the contracts `MasterSuperVault` and `Vault` use `UniswapRouterV2(pancakeRouter).getAmountsOut()` which relies on price calculations that are based on-chain, meaning that they would be susceptible to flash-loan attacks by manipulating the price of given pairs to the attacker's benefit and getting more share tokens. The issue VAU-02 describes the situation when flash loan attacks can happen on `Vault.poolSize()` function. The `MasterSuperVault.poolSize()` can always be attacked by flash loan.

HighToken MismatchOpen

The function `deposit()` will transfer the `capitalToken` from the depositor, but directly call the function `depositQuote()` in the contract `VaultV2` to transfer `quoteToken` without swapping the `capitalToken` to the `quoteToken`. Similarly, the function `withdraw()` will call the function `withdrawQuote()` in the contract `VaultV2` to get the `quoteToken`, but directly transfer the `capitalToken` to the withdrawer without swapping the `quoteToken` back to the `capitalToken`. These two functions will fail because of the missing swap logic.

LowFinancial modelsOpen

The SuperBots protocol is acting as an investment project, where the users deposit different tokens into the different `vaults`. Then the `strategist` and `whiteListed user` of each `vaults` will swap between two given tokens `quoteToken` and `baseToken`. The users will get a number of share tokens based on the deposit amount, total shares, vault balance, and get the corresponding amount of tokens according to the share amount. In the contract `MasterSuperVault`, the users will invest `capitalToken` and the protocol will divide the investment fund into 5 equal portions and invest into 5 vaults. The user gets a different share token and can use it to withdraw the investment principle and profit. And then, there are some questions: 1. The only investment strategy of the contract `Vault` is swapping between `quoteToken` and `baseToken` in two different platforms `UniswapRouterV2` or `IOneInchAggregationRouterV4`. The swapping amount is always the total balance. Plus that the protocol will also charge deposit, withdraw, trade and perf(profit) fees. Why do the users not use the platform `UniswapRouterV2` or `IOneInchAggregationRouterV4` directly for token swap? 2. In the contract `Vault`, there are two kinds of tokens: `quoteToken` and `baseToken`. When the value of `position` is 0, `quoteToken` is used and the user deposited `baseToken` will be swapped to the `quoteToken`. When the value of `position` is 1, `baseToken` is used and the user deposited `quoteToken` will be swapped to the `baseToken`. Thus, although the users can choose which token to invest in, they cannot control which token they will get in the `withdraw()` function. The users will get `quoteToken` when `position` is 0 and `baseToken` when `position` is 1. This difference between invest and harvest tokens may be against the users' intention. In addition, the function `buy()` and `sell` can just inverse the current `Vault` by changing the `position` value and swapping all the `quoteToken/baseToken` to `baseToken/quoteToken`. The contract `MasterSuperVault` may provide a better way, in which the user will invest `capitalToken` and harvest `capitalToken`. 3. The above-mentioned `capitalToken` `quoteToken` and `baseToken` are unknown. Thus, their implementation is uncertain and may not support the current functionality well. In version 2, most of the swap operations use Chainlink as a price reference to set a maximum slippage. The profit is also accumulated by token swapping with the `0x Aggregator` instead of the `One Inch Aggregator`. Also, the current `_activeVaults` can be updated and the investment assets at old vaults will be distributed equally to the new `_activeVaults`.

LowGas OptimizationOpen

In the contract `Vault` and `MasterSuperVault`, each function may swap tokens multiple times and charges fees. Also, some of the fee charging functions like `takeTradingFees()`, `takePerfFees()`, `takePerfFeesFromBaseToken()` may also perform token swap. Some of the tokens are swapped and then burned out. This will cost lots of gas and may have gas waste.

LowLack of reasonable boundaryOpen

The variables `pctDeposit`, `pctWithdraw`, `pctTradUpbots`, `pctPerfAlgoDev`, `pctPerfPartners` do not have reasonable boundaries, so they can be given arbitrarily values after deploying.

LowPotential Sandwich AttacksOpen

A sandwich attack might happen when an attacker observes a transaction swapping tokens or adding liquidity without setting restrictions on slippage or minimum output amount. The attacker can manipulate the exchange rate by frontrunning (before the transaction is attacked) a transaction to purchase one of the assets and make profits by back running (after the transaction is attacked) a transaction to sell the asset. The following functions are called without setting restrictions on slippage or minimum output amount, so transactions triggering these functions are vulnerable to sandwich attacks, especially when the input amount is large: - `_swapPancakeswap()` in the contract `MasterSuperVault` and `Vault`, which will call the `UniswapRouterV2(pancakeRouter).swapExactTokensForTokens()` function.

LowThird Party DependencyOpen

The contract is serving as the underlying entity to interact with one or more third party protocols. The scope of the audit treats third party entities as black boxes and assume their functional correctness. However, in the real world, third parties can be compromised and this may lead to lost or stolen assets. In addition, upgrades of third parties can possibly create severe impacts, such as increasing fees of third parties, migrating to new LP pools, etc. ```solidity address public constant pancakeRouter = 0x10ED43C718714eb63d5aA57B78B54704E256024E; ``` - The contracts `MasterSuperVault` and `Vault` interact with third party contract with `UniswapRouterV2` interface via `pancakeRouter`. --- ```solidity address public constant wbnb = 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c; ``` - The contracts `MasterSuperVault` and `Vault` interact with third party contract with `wbnb` token via `wbnb`. --- ```solidity address public constant ubxt = 0xBbEB90cFb6FAFa1F69AA130B7341089AbeEF5811; ``` - The contracts `MasterSuperVault` and `Vault` interact with third party contract with `IERC20` interface via `ubxt`. --- ```solidity address public oneInchRouterAddr; ``` - The contract `Vault` interacts with third party contract with `IOneInchAggregationRouterV4` interface via `oneInchRouterAddr`. --- - The contract `VaultV2` interacts with third party contract `UniswapRouterV2`, `0x aggregator`, `Chainlink`, etc.

LowUnknown tokenOpen

The tokens `capitalToken`, `quoteToken` and `baseToken` are initialized in the functions `MasterSuperVault.constructor()` function and `VaultFactory.generateVault()`. Thus, the correctness of the `token` address and the actual token implementations are all uncertain.

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 (11)

  • contracts/interfaces/uniswapv2.sol
  • contracts/vault.sol
  • contracts/vault_factory.sol
  • contracts/vault_factory_v2.sol
  • contracts/supervault_v2.sol
  • contracts/interfaces/oneinch.sol
  • contracts/interfaces/iparaswap.sol
  • contracts/interfaces/ivault.sol
  • contracts/vault_v2.sol
  • contracts/master_vault.sol
  • contracts/interfaces/lib/utils.sol

Part of Superbots’s security record

Superbots
Audits1 audit by 1 firmLast audit Mar 2023, by CertiK.
Critical findingsNo open critical findingsIn 1 report.
Open Superbots’s security record

Security firm

CertiK

1,045 projects reviewed · 1,376 reports · latest May 2025

See CertiK’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