Chancer - Audit

CertiKFiles named in the report

CertiK reviewed Chancer (Chancer - Audit) on 30 May 2023: 10 findings, 0 critical; 6 marked fixed, 1 acknowledged, 3 open.

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

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings10

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

SeverityOpenAcknowledgedFixed
Critical000
High302
Medium001
Low013
HighMissing important checks on the function `rescueEFixed

The function `rescueERC20()` can be called to transfer any ERC20 tokens to any address. According to the function name, this function is supposed to send trapped ERC20 tokens. Hence a validation is necessary to prevent the owner transfer the sale token balance of CHRPresale contract to an arbitrary user: `_tokenAddress != saleToken`.

HighPrivileged Function Allows Owner to mint TokensFixed

In the contract CHRToken, the role `owner` has the authority over the following function: - `mint()` Any compromise to the `owner` account may allow the hacker to take advantage of this and mint tokens.

MediumIncorrect Decimals UsageFixed

In line 198, the `amount` is multiplied by 1e18. Consequently, the auditors presume that the input parameters `_amount` used in both `buyWithBnb` and `buyWithBUSD` functions, also lack decimal places. This particular design choice gives rise to an issue in the price calculation process. The variable `priceInBUSD` is computed without considering any decimals and subsequently utilized in the calculation of `priceInBNB`. Notably, the `priceInBNB` solely undergoes multiplication by 1e8 and thus lacks decimal places altogether. Consequently, if the value of `priceInBNB` does not exceed 1 BNB, it will become 0 since it is type uint256. Furthermore, in line 166, the calculation involves subtracting `priceInBNB` from `msg.value`. Considering that the `msg.value` contains 18 decimal places, this calculation would yield an incorrect result. Additionally, the comments in lines 227-228 refers that `priceInBNB` has a decimal of 18 and `priceInBUSD` has a decimal of 6, which are inconsistent with the implementation. `priceInBUSD` also shouldn't have a decimal of 6.

LowIncorrect commentsFixed

The comments for `_limitPerStage ` and `_pricePerStage` are not correct.

LowMissing Emit EventsFixed

There should always be events emitted in the sensitive functions that are controlled by centralization roles.

LowNo Limit On `claimStartTime` and `saleEndTime`Fixed

There are no limits on `claimStartTime` and `saleEndTime` setting in the constructor, function `configureSaleTimeframe`, and function `configureClaim`. Due to the lack of documentation, the auditors are not sure if the system design allows the `claimStartTime` to be smaller than `saleEndTime`. If users are allowed to buy tokens after `claimStartTime`, we recommend replacing the `hasClaimed[_msgSender()]` check to `purchasedTokens[_msgSender()] = 0` in function `claim`. Otherwise, we recommend adding checks to ensure `saleEndTime` will always be smaller than `claimStartTime`.

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 (2)

  • contracts/CHRPresale.sol
  • contracts/CHRToken.sol

Part of Chancer’s security record

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

Security firm

CertiK

1,044 projects reviewed · 1,375 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