CertiK reviewed bitsCrunch on 12 Dec 2023: 21 findings, 0 critical; 12 marked fixed, 3 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 | 0 | 3 | 0 |
| Medium | 0 | 0 | 1 |
| Low | 6 | 0 | 11 |
The user can invoke the `bill()` function to make a bill payment. The passed-in parameter `_schemeId` is required to be greater than 0. Thus the if statement of `_schemeId != 0` will always be entered each time the function is invoked. That is to say, the users are required to switch the scheme each time they call this function. ```solidity=101 if(_schemeId != 0){ require(userAccounts_[_accountId].discountScheme != _schemeId,"CPay:ERR8"); _switchScheme(_accountId,_schemeId); } ```
The variable `dueBalance` represents the amount of assets owed by the customer, and we notice that the function `addFunds()` can be called to recharge when the user has insufficient assets, but if the user doesn't recharge, calls `unstakeBCUT()` to exit, and re-creates a new account, there may be a large amount of bad debt in the protocol. File CustomerPayout.sol: ```solidity=131 userAccounts_[_accountId].dueBalance += (discountedAmount - userAccounts_[_accountId].balance); ``` File Staking.sol: ```solidity=152 function unstakeBCUT(uint _accountId) external nonReentrant { address _user = _msgSender(); require(userAccounts_[_accountId].owner == _user,"CS:ERR6"); uint256 stakedAmount = discountSchemes_[userAccounts_[_accountId].discountScheme].stakeAmount; require(stakedAmount > 0,"CS:ERR8"); userAccounts_[_accountId].discountScheme = 0; TokenUtils.pushTokens(bcutToken_, _user, stakedAmount); emit Unstaked(_accountId, stakedAmount); } ```
The function `selectScheme()` can be called to select a new discount scheme for the customer in the bill. The customer can then choose the scheme with the largest discount. Our understanding is that, a larger discount is bonded with a larger staking amount and/or a longer lock period. The available scheme options is not found in the current smart contracts.
When transferring standard ERC20 deflationary tokens, the input amount may not be equal to the received amount due to the charged transaction fee. As a result, an inconsistency in the amount will occur and the transaction may fail due to the validation checks. For example, if a user sends 100 deflationary tokens (with a 10% transaction fee) to the target contract, only 90 tokens actually arrive to the contract. In the `Billing` contract, the `addFunds()` function calls `TokenUtils.pullTokens()` to transfer `userAccounts_[_accountId].coin` from the `_user` to the contract. The `coin` is set by the owner address of the `Customer` contract in the `createAccount()` function.
In the Operator contract, there are two functions `setMaximumReward()` and `setMinFee()`, callable by the owner address, that can change the maximum reward and the minimum fee. We noticed that the only restriction for the owner address to set the `operatorFees_.minFee` and `operatorFees_.maxReward` is that the fee and the reward should be greater than 0 and less than `percentage_`.
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 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=16 ISwapRouter public swapRouter; ``` - The contract `SwapTokens` interacts with third party contract with `ISwapRouter` interface via `swapRouter`.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (27)
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