CertiK reviewed MetaDex on 7 Feb 2023: 23 findings, 0 critical; 17 marked fixed, 1 acknowledged, 5 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 | 1 | 0 |
| Medium | 0 | 0 | 0 |
| Low | 5 | 0 | 17 |
When calculating the amount that each ticket can claim or the amount that may be auto injected it is rounded down. This can cause the `amountToShareToWinners` to be larger than the amount that can actually be claimed/auto-injected. In this case the difference will be locked in the contract forever as there is no way to recover the tokens.
The contract is serving as the underlying entity to interact with third party VRF. The scope of the audit treats 3rd party entities as black boxes and assume their functional correctness. However, in the real world, 3rd parties can be compromised and this may lead to lost or stolen assets. In addition, upgrades of 3rd parties can possibly create severe impacts, such as increasing fees of 3rd parties, migrating to new LP pools, etc.
Literals with many digits are difficult to read and review. ```solidity=168 require((thisTicketNumber >= 1000000) && (thisTicketNumber <= 1999999), "Outside range"); ``` --- ```solidity=170 _numberTicketsPerLotteryId[_lotteryId][1 + ((thisTicketNumber / 100000) % 10)]++; ``` --- ```solidity=174 _numberTicketsPerLotteryId[_lotteryId][11111 + ((thisTicketNumber / 10) % 100000)]++; ``` --- ```solidity=175 _numberTicketsPerLotteryId[_lotteryId][111111 + ((thisTicketNumber / 1) % 1000000)]++; ``` --- ```solidity=669 uint32 transformedWinningNumber = _bracketCalculator[_bracket] + ((winningTicketNumber / (100000 / (uint32(10)**_bracket)) ) % (uint32(10)**(_bracket + 1))); ``` --- ```solidity=672 uint32 transformedUserNumber = _bracketCalculator[_bracket] + ((userNumber / (100000 / (uint32(10)**_bracket)) ) % (uint32(10)**(_bracket + 1))); ``` --- ```solidity=16 constructor() ERC20("METADEX", "METADEX") ERC20Capped(1000000000 * (10**uint256(18))) { ```
In `release()` function, the address `vestingSchedule.beneficiary` is casted to `address payable` type, but no base currency tokens are transferred in or out from that address. So it is an unnecessary casting operation.
The `SafeMath` library is used unnecessarily in `TokenVesting.sol`. 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 (3)
1,045 projects reviewed · 1,376 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