CertiK reviewed Kroma (Spectrum Protocol - Audit(Addendum)) on 13 May 2024: 18 findings, 0 critical; 3 marked fixed, 2 acknowledged, 13 open.
Report hosted on skynet.certik.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 | 2 | 0 |
| Medium | 1 | 0 | 1 |
| Low | 12 | 0 | 2 |
The contract `EcoERC4626Upgradeable` inherits `ERC4626Upgradeable`, which is a token vault. Within the `ERC20RebasedUpgradeable` contract, users can stake underlying tokens to acquire shares, functioning as a token vault. When the vault, whether it's `EcoERC4626Upgradeable` or `ERC20RebasedUpgradeable`, is empty or close to empty, deposits are at high risk of being stolen through front-running. This occurs when a donation to the vault inflates the price of a share, a situation also known as a donation or inflation attack. Essentially, this is a problem of slippage. Reference: https://github.com/OpenZeppelin/openzeppelin-contracts/issues/3706
The `_findIndex()` functions are internal and not called by the contract. ```solidity=191 function _findIndex(EnumerableSet.AddressSet storage $, address item) internal view returns (uint256 i) { i = $._inner._positions[bytes32(uint256(uint160(item)))]; if (i == 0) revert Spectrum(SpectrumErrors.NotExist); } function _findIndex(address[] memory addrs, address item) internal pure returns (uint256 i) { unchecked { for (; i < addrs.length; i++) { if (addrs[i] == item) return i; } } revert Spectrum(SpectrumErrors.NotExist); } ```
The contract's constructor is designed to accept an `initialOwner` parameter intended to designate the owner of the contract. The constructor transfers ownership to the specified `initialOwner` and subsequently calls the `grantSelectorRole()` function, which is an `onlyAdmin` function. If the `initialOwner` parameter provided is not the same as the deployer's address, the deployer is not the contract owner when calling `grantSelectorRole()`, resulting in a failed contract deployment, limiting the flexibility intended by transferring the ownership at the deployment phase. The root cause is that the ownership transfer to `initialOwner` happens before `grantSelectorRole()` is called, and since the deployer no longer has ownership permission, the deployer cannot execute the `onlyAdmin` function `grantSelectorRole()`.
`_proxyAdmin()` do not require modifying the contract state, nor do they need to receive Ether. However, these functions are not labeled with `pure` or `view` modifiers.
When 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.
- Contract ·`ERC20MetadataUpgradeable`· extends `ERC20Upgradeable` - contract `EcoERC20Upgradeable`· extends `ERC20PermitUpgradeable` - contract `ERC20MintableUpgradeable`· extends `ERC20Upgradeable` and `ERC20BurnableUpgradeable` - contract `WETH`· extends `ERC20BurnableUpgradeable` - contract `EcoOwnable` extends `Ownable2StepUpgradeable` - contract `SelectorRoleControlUpgradeable` extends `PausableUpgradeable` and `AccessControlEnumerableUpgradeable` - contract `EcoProxyAdmin` extends `MulticallUpgradeable` - contract `EcoERC1155Upgradeable` extends `ERC1155PausableUpgradeable`, `ERC1155BurnableUpgradeable` and `ERC1155SupplyUpgradeable` - contract `NFT_Mintable`· extends `PausableUpgradeable`, `ERC721BurnableUpgradeable` and `ERC721EnumerableUpgradeable` - contract `ERC721PausableUpgradeable` extends `PausableUpgradeable` - contract `ERC20RebasedUpgradeable`· extends `ERC20PermitUpgradeable` - contract `EcoERC4626Upgradeable`· extends `ERC20PermitUpgradeable` and `ERC20BurnableUpgradeable` but these extended contracts are not initialized by the current contracts. Generally, the initializer function of a contract should always call all the initializer functions of the contracts that they extend.
The functions marked as 'view' or 'pure' are unnecessarily restricted by the 'restrict' modifier. These functions are designed to be read-only, meaning they do not modify the state on the blockchain. However, they are restricted so that only a specific address can call them. It's important to note that even private state variables can be read off-chain, rendering the access restriction on these functions ineffective.
HTTP/HTTPS should not be used for token metadata because the domain and web server owner can change token metadata at will to dramatically affect token value. See https://docs.openzeppelin.com/contracts/4.x/erc721. The function doesn't verify if the supplied `_baseURI` is a valid IPFS location. The function doesn't verify if the supplied `_baseURI` is a valid IPFS location.
Performing division by zero would raise an error and revert the transaction. ```solidity=48 ethValue = (gSnap.spSnap.evalValue * spAmount) / gSnap.info.spETH.totalSupply(); ``` --- ```solidity=53 spAmount = (gSnap.info.spETH.totalSupply() * ethValue) / gSnap.spSnap.evalValue; ```
When a loop allows an arbitrary number of iterations or accesses state variables in its body, the function may run out of gas and revert the transaction. ```solidity=60 while (start < stop) { ``` Function `ERC721QueryableUpgradeable.tokensOfOwnerIn` contains a loop and its loop condition depends on parameters: `start`, `stop`.
The contract serves 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 assumes 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=12 import { IweETH } from "../vendor/etherfi.sol"; ``` - The contract `SpectrumCoreUtils` interacts with the third-party contract with `etherfi` interface via `assetEvaluator`. ```solidity=13 import { IeETH, IweETH, ILiquidityPool, ILiquifier } from "../vendor/etherfi.sol"; import { IstETH, IwstETH } from "../vendor/lido.sol"; ``` - The contract `SpectrumHubUtils` interacts with the third-party contract with `etherfi` interface via `actionForStake`. - The contract `SpectrumHubUtils` interacts with the third-party contract with `lido` interface via `actionForStake`. ```solidity=7 import { IKromaBridge } from "../../eco-libs/kroma/interfaces.sol"; ``` - The contract `SpectrumHubLogic` interacts with the third-party contract with `IKromaBridge` interface via `info.bridge`.
The `SelectorRoleControlUpgradeable` contract does 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.
The return value `resultAmount` is declared but never used in the function body.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (41)
1,044 projects reviewed · 1,375 reports · latest May 2025
See CertiK’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