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
MediumRisk of supporting "arbitrary" tokensFixed

According to the current implementation, the `pay` function plans to support arbitrary types of ERC20 tokens. The `pay` function takes the user input `token`, and the contract performs multiple external calls to the token address. One of the most dangerous behaviors in smart contracts is performing an external call to an untrusted contract. An attacker can deploy a contract and implement the contract logic whatever they want. When the contract performs the external call to a malicious contract, the attacker-defined code will be executed.

Low`path`, `amountInMax` and `charge` arguments areFixed

The `abi.encodePacked()` function encodes the given arguments into bytes using tightly packed, contiguous encoding. However, the arguments `path`, `amountInMax` and `charge` are not included as part of the signature message, leading to insufficient checks on these arguments. Additionally, the `path` should be checked to ensure its length is greater than 1.

LowRedundant CommentFixed

The comments from lines 110 to 120 are the same as those from lines 121 to 131. ```solidity=110 /** * @dev External function to pay token * Allow the user to pay for the product by spending the token they have * @param token address of token contract be sepend * @param service service name of registered platform * @param product product for payment * @param column column for payment * @param user user address * @param amount product price * @param refundable status of refund (true: refundable, false: non-refundable) */ /** * @dev External function to pay token * Allow the user to pay for the product by spending the token they have * @param token address of token contract be sepend * @param service service name of registered platform * @param product product for payment * @param column column for payment * @param user user address * @param amount product price * @param refundable status of refund (true: refundable, false: non-refundable) */ ```

LowSafeTransfer should be used in place of transferFixed

SafeTransfer should be used in place of Transfer for Solidity contracts to ensure robust security and error handling. Unlike the basic Transfer function, SafeTransfer incorporates safeguards against potential smart contract vulnerabilities, such as unexpected token loss. By automatically validating the recipient's ability to receive tokens and reverting transactions in case of failures.

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