Part of CertiK’s retainer series
CertiK reviewed WEMIX (Wemix Nile#2 Retainer#13) on 21 Mar 2023: 23 findings, 0 critical; 16 marked fixed, 7 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 | 1 |
| Medium | 0 | 0 | 4 |
| Low | 5 | 0 | 11 |
In the contract **Incinerator**, the role **Editor** has authority over the following functions: - changeDAORouter() - changePurchaseCriteria() - changeAmountPurchase() - changeUnit() Any compromise to the **Editor** account may allow a hacker to take advantage of this authority and change the `_daoRouter` address to a hacker affiliated address, such as when `disposeDT()` is called, the new `_daoRouter` receives max `dt` token approval. In the contract **FundManager**, the role **Editor** has authority over the following functions: - changeWeswapRouter() Any compromise to the **Editor** account may allow a hacker to take advantage of this authority and change the address of `_weswapRouter`. In the contract **NILEComponent**, the role **Editor** has authority over the following functions: - changeFundRouter() Any compromise to the **Editor** account may allow a hacker to take advantage of this authority and change the address of `_fundRouter`. In the contract **ContractFactory**, the role **Editor** has authority over the following functions: - init() - deployDT() - deployGT() Any compromise to the **Editor** account may allow a hacker to take advantage of this authority and deploy DAO/Governance token. In the contract **Payment**, the role **Editor** has authority over the following functions: - changeFundRouter() Any compromise to the **Editor** account may allow a hacker to take advantage of this authority and init addresses for pointing other contracts. In the contract **Governance**, the role **Editor** has authority over the following functions: - _authorizeUpgrade() Any compromise to the **Editor** account may allow a hacker to take advantage of this authority and upgrade the contract. In the contract **MelterRegistry**, the role **Editor** has authority over the following functions: - regist() - deleteMelter() Any compromise to the **Editor** account may allow a hacker to take advantage of this authority and register the address of melter and delete the address of melter. In the contract **PteRegistry**, the role **Editor** has authority over the following functions: - regist() - editPte() Any compromise to the **Editor** account may allow a hacker to take advantage of this authority and register the address of Pte and change/delete the address of Pte. In the contract **SpellRegistry**, the role **Editor** has authority over the following functions: - addSpell() - removeSpell() - changeSpell() Any compromise to the **Editor** account may allow a hacker to take advantage of this authority and add/remove/change the address of Spell. In the contract **EditorRoleUpgradeable**/**EditorRole**, the role **Owner** has authority over the following functions: - addEditor() - removeEditor() Any compromise to the **Owner** account may allow a hacker to take advantage of this authority and add/remove the address of Editor. In the contract **RouterRoleUpgradeable**/**RouterRole**, the role **Editor** has authority over the following functions: - addRouter() - removeRouter() Any compromise to the **Editor** account may allow a hacker to take advantage of this authority and add/remove the address of Router. In the contract **MakerRole**, the role **Editor** has authority over the following functions: - addMaker() - removeMaker() Any compromise to the **Editor** account may allow a hacker to take advantage of this authority and add/remove the address of Maker. In the contract **DAORouter**, the role **Editor** has authority over the following functions: - init() - changeDenominator() - unpause() - pauseAll() - unpauseAll() Any compromise to the **Editor** account may allow a hacker to take advantage of this authority and init addresses for pointing other contracts, change denominator and pause/unpause the DAO. In the contract **FundRouter**, the role **Owner** has authority over the following functions: - init() Any compromise to the **Owner** account may allow a hacker to take advantage of this authority and init addresses for pointing other contract. In the contract **FundRouter**, the role **Melter** has authority over the following functions: - purchaseDT() Any compromise to the **Melter** account may allow a hacker to take advantage of this authority and purchase DAO tokens. In the contract **StakingPool**, the role **Editor** has authority over the following functions: - _authorizeUpgrade() Any compromise to the **Editor** account may allow a hacker to take advantage of this authority and upgrade the contract. In the contract **ReOpen**, the role **Maker** has authority over the following functions: - confirm() Any compromise to the **Maker** account may allow a hacker to take advantage of this authority and check the success or failure of the reopened recruitment. In the contract **ReOpen**, the role **Editor** has authority over the following functions: - changeDenominator() - changeFundRouter() Any compromise to the **
`Governance` and `StakingPool` are upgradeable contracts, the owner can upgrade the contract without the community's commitment. If an attacker compromises the account, he can change the implementation of the contract and drain tokens from the contract.
In the function `cast()`, the input params are `daoId` and `hashed`. However, in the function `isValidParams()`, the input param is struct `PInfo`. Missing check if the business information is valid.
The sender only transfers `Governance` tokens when creating an agenda or vote, and does not transfer voting power to the `Governance` contract. Therefore, the function `getAvailableNum()` does not really reflect the number of votes available to the sender, because the number of votes cannot be transferred and the number of votes already cast is not deducted.
```solidity=33 if (_tokenCollection[id].length > 0) { for(uint i = 0; i < _tokenCollection[id].length; i++) { address token = _tokenCollection[id][i]; uint balance = _balance[id].token[token]; if(balance == 0) { _tokenCollection[id][i] = _tokenCollection[id][_tokenCollection[id].length - 1]; _tokenCollection[id].pop(); } } } ``` The code is intended to remove the token from the array `_tokenCollection` if its balance is 0. However, it doesn't, some tokens are skipped. For example, there are two tokens in the _tokenCollection, both of which have a balance of 0. After the first execution completes, the length of `_tokenCollection` and `i` become 1, so `i` does not satisfy `i < _tokenCollection[id].length`, and the loop ends. The 2nd data is not removed successfully. The new issue with the commit `2c55201c5fb7f8805ace0947e32eed9cae0f9ebf` is that if the first token in the token collection has a zero balance, the code `i -= 1;` will underflow and cause 'liquidate()' to revert unintendedly.
The contract is serving as the underlying entity to interact with one or more third party protocols. The scope of the audit treats third party entities as black boxes and assume their functional correctness. However, in the real world, third parties can be compromised and this may lead to lost or stolen assets. In addition, upgrades of third parties can possibly create severe impacts, such as increasing fees of third parties, migrating to new LP pools, etc. ```solidity=18 address internal _weswapRouter; // address of WeswapRouter ``` - The contract FundManager interacts with third-party contract with IWeswapRouter interface via _weswapRouter.
The code base contains external function calls with unknown implementation, such as the below. The scope of the audit treats contracts that are out of scope, unknown implementation of interfaces, and other dependencies as black boxes and assumes their functional correctness. However, in the real world, these out of scope contracts can be compromised, potentially causing major vulnerability for the project. ```solidity=298 require(IVRF(_vrfVerify).fastVerify(_publicKey, _proof, _seed, _uPoint, _vComponents), "FR0-PD0-090"); require(IVRF(_vrfVerify).verifyByProof(gamma, _message), "FR0-PD0-091"); ```
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (56)
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