XEN Crypto - Audit

CertiKFiles named in the report

CertiK reviewed XEN Crypto (XEN Crypto - Audit) on 3 Oct 2022: 5 findings, 0 critical; 4 marked fixed, 1 open.

No open critical findings
Open the reportOpen XEN Crypto’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings5

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

SeverityOpenAcknowledgedFixed
Critical000
High000
Medium000
Low104
LowInconsistency between Code and DocumentationFixed

We noticed the following mismatches between the code and the published documentation of XEN crypto. 1. Regarding reward amplifier calculation, the [tokenomics page](https://www.xencrypto.io/what-is-xen-tokenomics/) indicates that "... the reward amplifier (AMP) is a constant amplifying rewards by 3,000 and decreasing by 30 every 30 days until it reaches the plateau of 1."; while the code does not decrease the value at a 30-day interval. In fact, since the `REWARD_AMPLIFIER_STEP` happens to be 30, the reward amplifier should decrease by 1 every day. To bump decrease 30 (approximately) every month, the calculation would need to divide by `SECONDS_IN_MONTH` before multiplying by `REWARD_AMPLIFIER_STEP`. ```solidity = 159 function _calculateRewardAmplifier() private view returns (uint256) { uint256 amplifierDecrease = (REWARD_AMPLIFIER_STEP * (block.timestamp - genesisTs)) / SECONDS_IN_MONTH; if (amplifierDecrease < REWARD_AMPLIFIER_START) { return Math.max(REWARD_AMPLIFIER_START - amplifierDecrease, REWARD_AMPLIFIER_END); } else { return REWARD_AMPLIFIER_END; } } ``` 2. Minor issue with penalty percentage. On the [tokenomics page](https://www.xencrypto.io/what-is-xen-tokenomics/), "Penalties" section, the penalty percentage for 2 days and 5 days seem to be off by 1%. Penalty for minting 2 days late should be 3%, and for 5 days it should be 35%

LowLimitation on Penalty CalculationFixed

The code takes penalty when the user is late for the designated minting time. The bit-wise shift on line 110 would fail if the late days exceeds 252. As a result, any user that's late for more than 252 days won't be able to remove their records in `userMints` or update the `activeMinters` count. ```solidity=107 function _penalty(uint256 secsLate) private pure returns (uint256) { // =MIN(2^(daysLate+3)/window-1,100) uint256 daysLate = secsLate / SECONDS_IN_DAY; uint256 penalty = (uint256(1) << (daysLate + 3)) / WITHDRAWAL_WINDOW_DAYS - 1; return Math.min(penalty, 100); } ```

LowPurpose of Contract `Migrations`Fixed

We'd like to know more about the purpose of contract `Migrations` to better understand the significance of the owner-controlled `setCompleted()` function.

LowVariable That Could Be Declared as ImmutableFixed

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

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

  • contracts/Math.sol
  • contracts/XENCrypto.sol
  • contracts/Migrations.sol

Part of XEN Crypto’s security record

XEN Crypto
Audits1 audit by 1 firmLast audit Oct 2022, by CertiK.
Critical findingsNo open critical findingsIn 1 report.
Open XEN Crypto’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