CertiK reviewed Starfish Finance (Starfish Finance Ⅲ) on 9 Dec 2022: 15 findings, 0 critical; 8 marked fixed, 7 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 | 2 | 0 | 0 |
| Medium | 0 | 0 | 2 |
| Low | 5 | 0 | 6 |
In the contract `LiquidStaking.sol` 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: * Set the contract's staking/unstaking transaction fee to any value with function `setTransactionFee()`. An extremely high transaction fee could cause staking to transfer a majority of the `dot` tokens to the `feeCollector` address, and prevent user's from staking/unstaking.  --- In the contract `LiquidStaking.sol` the role `operator` has authority over the following functions: * `withdrawPendingBond()` - Withdraws all staked `dot` out of contract. * `depositUnbonded()` Any compromise to the `operator` account may allow the hacker to take advantage of this authority and: * Transfer all of the staking `dot` tokens out of the contract to the `operator` address.
`LiquidStaking.sol` is an upgradeable contract and the owner can upgrade the contract without the community's commitment. If an attacker compromises the account, they can change the implementation of the contract and drain tokens from the contract.
The implementation of contract `DataTypes` is unknown and not in the audit scope. The scope of this audit would treat the external dependency entity as black boxes and assume functional correctness.
When transferring deflationary ERC-20 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. --- - The `pendingBondUser[]` array is used for bookkeeping purposes without compensating for the potential transfer fees. ```solidity=120 DataTypes.PendingBondUser memory pendingBondUser = DataTypes.PendingBondUser(_msgSender(), _amountMinusFee); pendingBondUsers.push(pendingBondUser); ``` - Transferring `dot` token amount `_amountMinusFee` into the contract. ```solidity=129 dot.transferFrom(_msgSender(), address(this), _amountMinusFee); ``` --- - The amount to unstake is then retrieved from the `pendingBondUser[]` array, which did not compensate for the potential transfer fees. ```solidity function unstake(uint256 _amount) public { ... uint256 instantUnstakeAmount = pendingBondUsers[i].amount; ... dot.transfer(_msgSender(), instantUnstakeAmount); ... ``` Reference: https://thoreum-finance.medium.com/what-exploit-happened-today-for-gocerberus-and-garuda-also-for-lokum-ybear-piggy-caramelswap-3943ee23a39f
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=39 IERC20Plus public dot; ``` - The contract `LiquidStaking.sol` interacts with a third party contract with the `IERC20Plus` interface via address `dot`.
The return value of the `transfer()`/`transferFrom()` calls are not checked. ```solidity=129 dot.transferFrom(_msgSender(), address(this), _amountMinusFee); ``` --- ```solidity=131 dot.transferFrom(_msgSender(), feeCollector, dotTransactionFee); ``` --- ```solidity=191 dot.transfer(_msgSender(), instantUnstakeAmount); ``` --- ```solidity=203 dot.transfer(_msgSender(), _amount); ``` --- ```solidity=230 dot.transfer(_msgSender(), currClaimableUnbondedAmount); ``` --- ```solidity=262 dot.transfer(_msgSender(), lastTotalPendingBondAmount); ``` --- ```solidity=279 dot.transferFrom(_msgSender(), address(this), _amountMinusFee); ``` --- ```solidity=281 dot.transferFrom(_msgSender(), feeCollector, dotTransactionFee); ```
The linked variables assigned in the constructor can be declared as `immutable`. Immutable state variables can be assigned during contract creation but will remain constant throughout the lifetime of a deployed contract. A big advantage of immutable variables is that reading them is significantly cheaper than reading from regular state variables since they will not be stored in storage.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (1)
1,045 projects reviewed · 1,376 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