Part of CertiK’s retainer series
CertiK reviewed WEMIX (Wemix Retainer 74 (DIOSV3)) on 16 Aug 2024: 10 findings, 0 critical; 4 marked fixed, 6 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 | 1 | 0 | 1 |
| Low | 3 | 0 | 3 |
slot0 returns the current tick of the price position of the pool, which can be manipulated easily in the same block if the liquidity in the pool is low or through flash loans. ```solidity=390 (uint160 sqrtPriceX96, int24 tick, , , , , ) = pair.slot0(); ```
The smart contract has hardcoded the fee amount as `WEMIX_FEE_AMOUNT = 0.08 ether`. This design choice lacks flexibility and does not allow for dynamic adjustments based on changing network conditions or economic factors. Furthermore, the constant nature of this variable implies that once the smart contract is deployed, this fee cannot be changed. ```solidity=26 // The fixed fee amount specific to WEMIX, set at 0.08 ether. uint256 public constant override WEMIX_FEE_AMOUNT = 0.08 ether; ```
Addresses are not validated before assignment or external calls, potentially allowing the use of zero addresses and leading to unexpected behavior or vulnerabilities. For example, transferring `operatorManager` to a zero address can result in a permanent loss of access to the privileged functions. ```solidity=66 operatorManager = _newOperatorManager; ``` - `_newOperatorManager` is not zero-checked before being used.
The function `_distributeReward()` is unconditionally called even when rewardAmount is explicitly set to zero. The scenario under which this occurs is when `wemixDfeeAmount` is greater than the difference between `finalWemixDBalance` and `initialWemixDBalance`. In such a case, the variable rewardAmount is explicitly set to zero, but the function `_distributeReward(rewardAmount)` is still executed. Every unnecessary call to `_distributeReward()` consumes more gas than needed, leading to a financial cost for the callers. ```solidity=212 uint256 rewardAmount; if (wemixDfeeAmount > finalWemixDBalance - initialWemixDBalance) { _transferFee(finalWemixDBalance - initialWemixDBalance, path); rewardAmount = 0; } else { _transferFee(wemixDfeeAmount, path); rewardAmount = finalWemixDBalance - initialWemixDBalance - wemixDfeeAmount; } _distributeReward(rewardAmount); ```
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (2)
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