Wemix Retainer 122 TokenPayment

CertiKFiles named in the report

Audit

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.

No open critical findings
Open the reportOpen WEMIX’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
Critical000
High200
Medium001
Low303
HighCentralization Related RisksOpen

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

HighCentralized Control of Contract UpgradeOpen

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.

LowIncompatibility with Deflationary TokensOpen

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.

LowOut-of-Scope DependenciesOpen

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.

LowRisks of `abi.encodePacked()` in User-ControlledOpen

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.

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

  • contracts/Payment/TokenPayment/ITokenPayment.sol
  • contracts/Payment/core/TokenPaymentCore.sol
  • contracts/Payment/TokenPayment/TokenPaymentLogic.sol
  • contracts/Payment/core/ITokenPaymentCore.sol
  • contracts/NightCrow/util/NightCrowFTExchanger.sol
  • contracts/Payment/TokenPayment/TokenPayment.sol

Part of WEMIX’s security record

WEMIX
Audits75 audits by 1 firmLast audit Feb 2025, by CertiK.
Critical findingsNo open critical findingsAcross the 75 reports, 17 critical findings were reported. Each is marked fixed by the firm that reported it.
Open WEMIX’s security record

Security firm

CertiK

1,045 projects reviewed · 1,376 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