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 |
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.
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.
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) */ ```
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.
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