CertiK reviewed Onyx Protocol (XCN Swap - Audit) on 18 Aug 2022: 5 findings, 0 critical; 4 marked fixed, 1 open.
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 | 0 |
| High | 0 | 0 | 1 |
| Medium | 0 | 0 | 0 |
| Low | 1 | 0 | 3 |
In the contract `Swap.sol`, the role `Owner` has authority over the following functions: - withdraw() - setPrice() Any compromise to the `Owner` account may allow a hacker to take advantage of this authority and withdraw all the MDT tokens and modify the critical configuration in the contract.
The comment in line 18 and the formula in line 38 show exchange ratio for XCN and MDT is 1 to 1. ```sol= uint256 public mdtPrice = 1000000000000000000; // 1 XCN = 1 MDT ... uint256 _xcnAmount = _amount.mul(mdtPrice).div(10**PRICE_DECIMALS); ``` However, the comment in line 38 shows the ratio is `MDT = 0.5 XCN`. ```sol uint256 _xcnAmount = _amount.mul(mdtPrice).div(10**PRICE_DECIMALS); // Same decimals, and MDT = 0.5 XCN ``` The exchange ratio is inconsistent across the codebase.
Literals with many digits are difficult to read and review.
The `SafeMath` library is used unnecessarily. With Solidity compiler versions 0.8.0 or newer, arithmetic operations will automatically revert in case of integer overflow or underflow.
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,393 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