Wemix Nile#2 Retainer#13

CertiKFiles named in the report

Audit

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.

No open critical findings
Open the reportOpen WEMIX’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings23

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High201
Medium004
Low5011
HighCentralization Related RisksOpen

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 **

HighCentralized Control of Contract UpgradeOpen

`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.

LowDifferent input params between `cast` and `isValiOpen

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.

Lowfunction `getAvailableNum()` cannot reflect the nOpen

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.

LowInsufficient removalOpen

```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.

LowThird Party DependencyOpen

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.

LowUnknown Implementation of InterfacesOpen

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"); ```

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

  • projects/NILE_V1/contracts/ContractFactory/IContractFactory.sol
  • projects/NILE_V1/contracts/Governance/SpellBase.sol
  • projects/NILE_V1/contracts/Components/NILEComponent.sol
  • projects/NILE_V1/contracts/Governance/Spells/GovernanceSpell.sol
  • projects/NILE_V1/contracts/Role/EditorRole.sol
  • projects/NILE_V1/contracts/Registry/SpellRegistry.sol
  • projects/NILE_V1/contracts/Components/Treasury/Treasury.sol
  • projects/NILE_V1/contracts/Token/GovernanceToken.sol
  • projects/NILE_V1/contracts/Components/Incinerator/IIncinerator.sol
  • projects/NILE_V1/contracts/StakingPool/StakingPool.sol
  • projects/NILE_V1/contracts/Governance/ISpell.sol
  • projects/NILE_V1/contracts/Station/IStation.sol
  • projects/NILE_V1/contracts/Token/IDAOToken.sol
  • projects/NILE_V1/contracts/Router/IFundRouter.sol
  • projects/NILE_V1/contracts/ContractFactory/ContractFactory.sol
  • projects/NILE_V1/contracts/Registry/ISpellRegistry.sol
  • projects/NILE_V1/contracts/Role/Upgradeable/EditorRoleUpgradeable.sol
  • projects/NILE_V1/contracts/Station/Station.sol
  • projects/NILE_V1/contracts/Governance/GovernanceProxy.sol
  • projects/NILE_V1/contracts/StakingPool/StakingPoolProxy.sol
  • projects/NILE_V1/contracts/Role/Upgradeable/RouterRoleUpgradeable.sol
  • projects/NILE_V1/contracts/Governance/Spells/TreasurySpell.sol
  • projects/NILE_V1/contracts/Token/DAOToken.sol
  • projects/NILE_V1/contracts/Governance/Payment/IPayment.sol
  • projects/NILE_V1/contracts/Governance/IGovernance.sol
  • projects/NILE_V1/contracts/Registry/IMelterRegistry.sol
  • projects/NILE_V1/contracts/Token/IGovernanceToken.sol
  • projects/NILE_V1/contracts/Registry/MelterRegistry.sol
  • projects/NILE_V1/contracts/Role/MakerRole.sol
  • projects/NILE_V1/contracts/Components/FundManager/FundManager.sol
  • projects/NILE_V1/contracts/Governance/Spells/LiquidationSpell.sol
  • projects/NILE_V1/contracts/Role/Upgradeable/OwnerRoleUpgradeable.sol
  • projects/NILE_V1/contracts/Governance/Governance.sol
  • projects/NILE_V1/contracts/Router/DAORouter.sol
  • projects/NILE_V1/contracts/Registry/PteRegistry.sol
  • projects/NILE_V1/contracts/Station/IStationView.sol
  • projects/NILE_V1/contracts/Components/Trust/ITrust.sol
  • projects/NILE_V1/contracts/Registry/IPteRegistry.sol
  • projects/NILE_V1/contracts/Station/IReOpen.sol
  • projects/NILE_V1/contracts/Governance/Payment/Payment.sol
  • projects/NILE_V1/contracts/Station/ReOpen.sol
  • projects/NILE_V1/contracts/Governance/Spells/RelocateSpell.sol
  • projects/NILE_V1/contracts/Components/Treasury/ITreasury.sol
  • projects/NILE_V1/contracts/Governance/Spells/DistributionSpell.sol
  • projects/NILE_V1/contracts/Components/FundManager/IFundManager.sol
  • projects/NILE_V1/contracts/Common/Queue.sol
  • projects/NILE_V1/contracts/Router/FundRouter.sol
  • projects/NILE_V1/contracts/Components/Incinerator/Incinerator.sol
  • projects/NILE_V1/contracts/Governance/Spells/RevenueSpell.sol
  • projects/NILE_V1/contracts/Role/RouterRole.sol
  • projects/NILE_V1/contracts/Common/DAOPausable.sol
  • projects/NILE_V1/contracts/Router/IDAORouter.sol
  • projects/NILE_V1/contracts/Governance/Spells/SwapSpell.sol
  • projects/NILE_V1/contracts/StakingPool/IStakingPool.sol
  • projects/NILE_V1/contracts/Components/Trust/Trust.sol
  • projects/NILE_V1/contracts/Governance/Spells/ReopenSpell.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