bitsCrunch

CertiKFiles named in the report

CertiK reviewed bitsCrunch on 12 Dec 2023: 21 findings, 0 critical; 12 marked fixed, 3 acknowledged, 6 open.

No open critical findings
Open the reportOpen bitsCrunch’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings21

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High030
Medium001
Low6011
LowDiscussion For Function `bill()`Open

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); } ```

LowDiscussion on `dueBalance`Open

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); } ```

LowDiscussion on `scheme` SelectionOpen

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.

LowIncompatibility With Deflationary TokensOpen

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.

LowNo Thresholds when changing rewards and feesOpen

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_`.

LowThird-Party Dependency UsageOpen

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`.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (27)

  • contracts/Epochs/EpochManager.sol
  • contracts/Bitscrunch/Coin/Storage.sol
  • contracts/Bitscrunch/Swapping/Swap.sol
  • contracts/Bitscrunch/Payments/Storage.sol
  • contracts/Bitscrunch/Storage.sol
  • contracts/Epochs/IEpochManager.sol
  • contracts/Bitscrunch/Coin/CoinManagement.sol
  • contracts/Bitscrunch/Context/Context.sol
  • contracts/Bitscrunch/Governance/Controller.sol
  • contracts/Utils/TokenUtils.sol
  • contracts/Bitscrunch/Bitscrunch.sol
  • contracts/Operator/Storage.sol
  • contracts/Bitscrunch/Customer/Billing.sol
  • contracts/Epochs/EpochManagerStorage.sol
  • contracts/Token/BCUTToken.sol
  • contracts/Staking/Staking.sol
  • contracts/Bitscrunch/Customer/Storage.sol
  • contracts/Bitscrunch/Payments/Payments.sol
  • contracts/Operator/IOperator.sol
  • contracts/Operator/Operator.sol
  • contracts/Bitscrunch/Payments/OperatorPayout.sol
  • contracts/Bitscrunch/Customer/Customer.sol
  • contracts/RewardManager/RewardManager.sol
  • contracts/Utils/MathUtils.sol
  • contracts/Bitscrunch/Customer/Staking.sol
  • contracts/RewardManager/Storage.sol
  • contracts/Bitscrunch/Payments/CustomerPayout.sol

Part of bitsCrunch’s security record

bitsCrunch
Audits1 audit by 1 firmLast audit Dec 2023, by CertiK.
Critical findingsNo open critical findingsIn 1 report.
Open bitsCrunch’s security record

Security firm

CertiK

1,045 projects reviewed · 1,376 reports · latest May 2025

See CertiK’s audits

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