Cubiswap has 1 public audit report from CertiK; dated 15 Sep 2023; no critical findings reported.
Last updated . It holds audits and findings, contracts and incidents up to Nov 2026. Trustblock does not review code.
Statuses are the security firms’ own
12 findings are still open or acknowledged in the firms’ reports: 4 high, 2 medium, 6 low (6 open, 6 acknowledged).
Centralization Risks in CubiSwapFactory.sol
CubiSwap-Audit · CertiK · 15 Sep 2023 · Report ↗
Centralization Risks in CubiToken.sol
CubiSwap-Audit · CertiK · 15 Sep 2023 · Report ↗
Centralization Risks in MasterChef.sol
CubiSwap-Audit · CertiK · 15 Sep 2023 · Report ↗
Centralized Control of Contract Upgrade
CubiSwap-Audit · CertiK · 15 Sep 2023 · Report ↗
Potential Loss of Pool Rewards
CubiSwap-Audit · CertiK · 15 Sep 2023 · Report ↗
State Variables in Upgradeable Contracts are Init
CubiSwap-Audit · CertiK · 15 Sep 2023 · Report ↗
Divide Before Multiply
CubiSwap-Audit · CertiK · 15 Sep 2023 · Report ↗
Incompatibility with Deflationary Tokens
CubiSwap-Audit · CertiK · 15 Sep 2023 · Report ↗
log info should be removed
CubiSwap-Audit · CertiK · 15 Sep 2023 · Report ↗
Potential Cross-Chain Replay Attack
CubiSwap-Audit · CertiK · 15 Sep 2023 · Report ↗
Newest first
| Report | Security firm | Date | Scope | Critical findings | Findings | Source |
|---|---|---|---|---|---|---|
| CubiSwap-Audit | Security firm: CertiK | Date: | Scope: Files listed | None open | Findings: 4 high · 2 medium · 6 low 6 acknowledged · 6 open | skynet.certik.com ↗ |
Statuses are the security firm’s own, from each report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 0 | 4 | 0 |
| Medium | 0 | 2 | 0 |
| Low | 6 | 0 | 0 |
Performing integer division before multiplication truncates the low bits, losing the precision of calculation. ```solidity=166 uint256 cubiReward = multiplier.mul(cubiPerBlock).mul(pool.allocPoint).div(totalAllocPoint); ``` ```solidity=167 accCubiPerShare = accCubiPerShare.add(cubiReward.mul(1e12).div(lpSupply)); ``` --- ```solidity=192 uint256 cubiReward = multiplier.mul(cubiPerBlock).mul(pool.allocPoint).div(totalAllocPoint); ``` ```solidity=195 pool.accCubiPerShare = pool.accCubiPerShare.add(cubiReward.mul(1e12).div(lpSupply)); ```
Open the reportWhen transferring deflationary ERC20 tokens, the input amount may not be equal to the received amount due to the charged transaction fee. For example, if a user sends 100 deflationary tokens (with a 10% transaction fee), only 90 tokens actually arrived to the contract. However, a failure to discount such fees may allow the same user to withdraw 100 tokens from the contract, which causes the contract to lose 10 tokens in such a transaction. Reference: https://thoreum-finance.medium.com/what-exploit-happened-today-for-gocerberus-and-garuda-also-for-lokum-ybear-piggy-caramelswap-3943ee23a39f ```solidity=214 pool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount); ``` - Transferring tokens by `_amount`. ```solidity=215 user.amount = user.amount.add(_amount); ``` - This function call executes the following operation. - In `SafeMath.add`, - `uint256 c = a + b;` - The `_amount` appears to be used for bookkeeping purposes without compensating the potential transfer fees. --- ```solidity=233 pool.lpToken.safeTransfer(address(msg.sender), _amount); ``` - Transferring tokens by `_amount`. ```solidity=232 user.amount = user.amount.sub(_amount); ``` - This function call executes the following operation. - In `SafeMath.sub`, - `return a - b;` - The `_amount` appears to be used for bookkeeping purposes without compensating the potential transfer fees.
Open the reportThere are some console.log arguments within the codebase, this seems to only be used for development purposes and is not useful for users.
Open the reportSigned messages are not properly verified with the current chain ID, thus allowing attackers to perform replay attacks across chains. Hardcoded or cached chain ID values are also vulnerable since a hard fork may occur and change the chain ID in the future. ```solidity=98 abi.encodePacked( '\x19\x01', DOMAIN_SEPARATOR, keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline)) ) ``` - Reading a state variable `DOMAIN_SEPARATOR`, which seems to be a cached chain ID value. - Encoding the cached chain ID value `DOMAIN_SEPARATOR`. ```solidity=104 address recoveredAddress = ecrecover(digest, v, r, s); ``` - Calling `ecrecover` with a hash that does not properly include the chain ID.
Open the reportOne or more logic contracts do not protect their initializers. An attacker can call the initializer and assume ownership of the logic contract, whereby she can perform privileged operations that trick unsuspecting users into believing that she is the owner of the upgradeable contract. ```solidity=22 contract MasterChef is OwnableUpgradeable { ``` - `MasterChef` is an upgradeable contract that does not protect its initializer. ```solidity=77 function initialize( ``` - `initialize` is an unprotected initializer function.
Open the reportThe owner of the contract `Cubitoken` can add users to whitelist utilizing function `addWhiteList`. Once a user is added to the whitelist, he cannot be removed.
Open the reportThe reports name a repository or files. Open a report to see its scope.
Trustblock holds 1 public audit report for Cubiswap, dated 15 Sep 2023. The latest is by CertiK (“CubiSwap-Audit”).
CertiK wrote the report Trustblock holds for Cubiswap.
12 findings are still open or acknowledged in the firms’ reports: 4 high, 2 medium, 6 low (6 open, 6 acknowledged). No critical finding is reported. Statuses are the security firms’ own.
Is this your project? Show this record on your own website. The label states what the record holds, links to this page and updates by itself. It is free and needs no sign-in.
Automatic: the three strongest facts of this project’s own record (its last audit and two more), highlighted. They update with the record. Picking a fact turns Automatic off.
<head><script src="https://widget.trustblock.run/project-widget.min.js" defer></script></head><body><divdata-tb-project-widgetdata-tb-project-slug="cubiswap"></div></body>
Paste the code where the label should appear. It uses no API credit and updates by itself.
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