Part of CertiK’s retainer series
CertiK reviewed WEMIX (Wemix Retainer 122 TokenPayment) on 13 Aug 2024: 9 findings, 0 critical; 4 marked fixed, 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 | 2 | 0 | 0 |
| Medium | 0 | 0 | 1 |
| Low | 3 | 0 | 3 |
In the contract `NightCrowFTExchanger` the role `setterRole` has authority over the functions - setRecipientRole() - registFunctionSelector() Any compromise to the `setterRole` account may allow the hacker to take advantage of this authority and set recipient role and register function selectors. ----- In the contract `TokenPaymentLogic` the role `DEFAULT_ADMIN_ROLE` has authority over the function `_authorizeUpgrade`. Any compromise to the `DEFAULT_ADMIN_ROLE` account may allow the hacker to take advantage of this authority and upgrade the contract. In the contract `TokenPaymentLogic` the role `paymentSetter` has authority over the functions - removeService() - removeVault() Any compromise to the `paymentSetter` account may allow the hacker to take advantage of this authority and remove service and remove vault of the service. ----- In the contract `TokenPaymentCore` the role `paymentSetter` has authority over the functions - setDeadLine() - setRouter() - setSlippage() - registService() - removeService() - registVault() - changeServiceExecutability() - changeRoleManager() - changeExecuteManager() - changeRecipientRole() - changeListManager() - registToken() - registTokens() - removeToken() - removeTokens() Any compromise to the `paymentSetter` account may allow the hacker to take advantage of this authority and - set swap deadline - set router - set slippage - register service - remove service - register vault - change status of service's selector - change role manager address - change execute manager address - change recipient role address - change black or whitelist address - regist token address - remove token address
In the contract `TokenPaymentLogic`, the role `DEFAULT_ADMIN_ROLE` (owner) has the authority to update the implementation contract behind the proxy contract. Any compromise to the `DEFAULT_ADMIN_ROLE` (owner) account may allow a hacker to take advantage of this authority and change the implementation contract which is pointed by proxy and therefore execute potential malicious functionality in the implementation contract.
When transferring deflationary ERC20 tokens, the input amount may not be equal to the received amount due to the charged transaction fee. For example, if a user sends 100 deflationary tokens (with a 10% transaction fee), only 90 tokens actually arrived to the contract. However, a failure to discount such fees may allow the same user to withdraw 100 tokens from the contract, which causes the contract to lose 10 tokens in such a transaction. If a user uses the `pay()` function to provide a certain `amount` of deflationary tokens for a product, the token payment contract receives fewer tokens than the user-provided `amount`. However, the contract still transfers the full `amount` of tokens to the `recipientRole`, which exceeds the amount received from the user.
The audited code base interacts with several out-of-scope contracts, including `VerifyKeyUpgradeable`, `PaymentStorage`, `roleManager`, `executeManager`, `recipientRole`, `listManager`, `INightCrowFT` etc. The scope of the audit treats out-of-scope entities as black boxes and assumes their functional correctness. However, in the real world, those dependencies can be compromised and this may lead to lost or stolen assets.
Encoding through `abi.encodePacked()` is used with at least two dynamic type inputs controlled by the user. This type of encoding is susceptible to malleability when used with strings, bytes, or other dynamic types. As such, it is not a good choice for signature verification with the input used, since users can change the input and potential get the same bytes output from `abi.encodePacked`. Moreover, note that uints and other variable types do not need to be converted to strings before being encoded.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (6)
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