Xshares

CertiKFiles named in the report

CertiK reviewed XShares on 5 Sep 2023: 9 findings, 1 critical; 2 marked fixed, 7 acknowledged.

1 critical finding, fixed
Open the reportOpen XShares’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings9

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

SeverityOpenAcknowledgedFixed
Critical001
High030
Medium010
Low031
CriticalAttacker can drain the contract by modifying "curFixed

The contract allows users to buy and sell shares, and the price of the share is related to the value of "curveIndex". When the user purchases a share, the native token, such as ETH, that pays for the share, will be stored in the contract. The "sharesSubject" address can modify the "curveIndex" value of the share at any time, and it will result in a change in the share price. If the "sharesSubject" purchases shares when the price is low(ex. the curveIndex equals 10), then modifies the curveIndex to cause the price to increase, and sell the shares, he can drain the native tokens from the contract. ```sol function getPrice(uint256 supply, uint256 amount, uint256 curveIndex) public pure returns (uint256) { uint256 sum1 = supply == 0 ? 0 : ((supply - 1 )* (supply) * (2 * (supply - 1) + 1) * 1 ether ) / (curveIndex * 6); uint256 sum2 = supply == 0 && amount == 1 ? 0 : ((supply - 1 + amount) * (supply + amount) * (2 * (supply - 1 + amount) + 1) * 1 ether )/ (curveIndex * 6); uint256 summation = sum2 - sum1; // ((x ** 2 - 1) / p) + 1 / 16000 return summation / 16000; } ```

LowRedundant Modifier "payable"Fixed

The function `sellShares()` is defined as a payable function; however, the function body does not address the received native token specified by `msg.value`. This could lead to inadvertent behavior where native token is sent to the function but not appropriately managed or refunded, potentially causing a fund lock.

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

  • XShares.sol

Part of XShares’s security record

XShares
Audits1 audit by 1 firmLast audit Sep 2023, by CertiK.
Critical findingsNo open critical findingsIn that report, 1 critical finding was reported. It is marked fixed by the firm that reported it.
Open XShares’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