CertiK reviewed Klink Finance on 7 Feb 2025: 11 findings, 0 critical; 3 marked fixed, 2 acknowledged, 6 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 | 3 | 0 | 0 |
| Medium | 0 | 2 | 1 |
| Low | 3 | 0 | 2 |
When a user attempts to withdraw, the contract checks whether its `rewardBalance` is sufficient to cover both the user’s staked principal and the calculated reward. If the `rewardBalance` is too low, the entire withdrawal transaction reverts, preventing the user from retrieving any funds—including their principal. In this scenario, the user’s only option is to perform an `emergencyWithdraw`, which forfeits all accumulated rewards. ```solidity=419 function _withdraw(address from) private returns (bool) { uint256 reward = _calculate(from, deposits[from].endTime); reward = reward.add(deposits[from].rewards); uint256 amount = deposits[from].depositAmount; require(reward <= rewardBalance, "Not enough rewards"); ```
The contract interacts with an external ERC-20 token contract at `tokenAddress_`, assumed in this context to be `KlinkToken`. Although the audit treats external contracts as black boxes and presumes they operate correctly, in reality, third-party contracts may be vulnerable or malicious if compromised. Specifically, the function `_payto` and `_hasAllowance` modifier (shown below) depends on the externally provided tokenAddress without validating its authenticity or security: ```solidity modifier _hasAllowance(address allower, uint256 amount) { // Make sure the allower has provided the right allowance. ERC20Interface = IERC20(tokenAddress); uint256 ourAllowance = ERC20Interface.allowance(allower, address(this)); require(amount <= ourAllowance, "Make sure to add enough allowance"); _; } function _payTo( address allower, address receiver, uint256 amount ) private _hasAllowance(allower, amount) returns (bool) { ERC20Interface = IERC20(tokenAddress); ERC20Interface.safeTransferFrom(allower, receiver, amount); return true; } ``` Because the contract assumes that the external token behaves according to the ERC-20 standard, any breach, misimplementation, or malicious update to that third-party token could lead to loss of user funds. For example, if the ERC-20 contract is compromised to always return a high allowance or to trigger harmful callbacks, the staking contract would be unaware of this abnormal behavior and could execute logic with unintended consequences.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (2)
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