CertiK reviewed XShares on 5 Sep 2023: 9 findings, 1 critical; 2 marked fixed, 7 acknowledged.
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 | 1 |
| High | 0 | 3 | 0 |
| Medium | 0 | 1 | 0 |
| Low | 0 | 3 | 1 |
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; } ```
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.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (1)
1,044 projects reviewed · 1,375 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