we2net - audit

CertiK1 address on BNB Chain

CertiK reviewed We2net (we2net - audit) on 7 Mar 2023: 17 findings, 0 critical; 5 marked fixed, 2 acknowledged, 10 open.

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

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings17

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

SeverityOpenAcknowledgedFixed
Critical000
High020
Medium002
Low1003
LowDivide Before MultiplyOpen

Performing integer division before multiplication truncates the low bits, losing the precision of calculation. ```solidity=1116 uint256 topReward = totalReward.mul(_topRewardRate).div(_rewardBase); ``` ```solidity=1118 uint256 nodeReward = topReward.mul(rewardRate[nodeLevel]).div(_rewardBase); ``` --- ```solidity=1140 uint256 topReward = totalReward.mul(_topRewardRate).div(_rewardBase); ``` ```solidity=1142 uint256 nodeReward = topReward.mul(rewardRate[nodeLevel]).div(_rewardBase); ``` --- ```solidity=916 uint256 topReward = totalReward.mul(_topRewardRate).div(_rewardBase); ``` ```solidity=918 uint256 nodeReward = topReward.mul(levelInfo[nodeLevel].rewardRate).div(_rewardBase); ``` --- ```solidity=940 uint256 topReward = totalReward.mul(_topRewardRate).div(_rewardBase); ``` ```solidity=942 uint256 nodeReward = topReward.mul(levelInfo[nodeLevel].rewardRate).div(_rewardBase); ```

LowLack of Sanity CheckOpen

The functions in` TransferHelper` is missing a sanity check to ensure the parameter `token` is a contract. If the `token` is an EOA, the function call `token.call()` will always return true.

LowMissing Emit EventsOpen

In the contract `LiquidityHub`, functions that update state variables should emit relevant events as notifications. - function setEndTime - function setManger - function setTaxRate - function setTaxAndRewardBase - function setTopRewardRate - function setRewardRate ____ In the `we2net`, functions that update state variables should emit relevant events as notifications. - function setManger - function setMinter - function setStartTime - function setTaxAndFeeManger - function setTaxAndRewardBase - function excludedFromTax - function setTaxFrom - function setTaxTo - function setRootNode - function setParentNodeByManager - function setLevelsCountAndRewardRate - function setLevelInfo - function setClaimAmount

LowMIssing Input CheckOpen

In the contract `LiquidityHub`, `setEndTime` do not check if new endtime > block.timestamp

LowMissing Zero Address ValidationOpen

Addresses should be checked before assignment or external call to make sure they are not zero addresses. ```solidity=904 we2netToken = _we2netToken; ``` - `_we2netToken` is not zero-checked before being used. --- ```solidity=905 usdtToken = _usdtToken; ``` - `_usdtToken` is not zero-checked before being used. --- ```solidity=906 pair = _pair; ``` - `_pair` is not zero-checked before being used. --- ```solidity=907 wbnb = _wbnb; ``` - `_wbnb` is not zero-checked before being used. --- ```solidity=908 pairWbnbUsdt = _pairWbnbUsdt; ``` - `_pairWbnbUsdt` is not zero-checked before being used. --- ```solidity=1077 _taxManager = taxManager; ``` - `taxManager` is not zero-checked before being used. --- ```solidity=1078 _feeManager = feeManager; ``` - `feeManager` is not zero-checked before being used. --- ```solidity=1079 _recycleManager = recycleManager; ``` - `recycleManager` is not zero-checked before being used. --- ```solidity=810 _taxManager = taxManager; ``` - `taxManager` is not zero-checked before being used. --- ```solidity=811 _feeManager = feeManager; ``` - `feeManager` is not zero-checked before being used. --- ```solidity=840 rootNode = _rootNode; ``` - `_rootNode` is not zero-checked before being used.

LowPotential Sandwich AttacksOpen

A sandwich attack may happen when an attacker observes a transaction swapping tokens or adding/removing liquidity without setting restrictions on slippage or minimum output amount. The attacker can manipulate the exchange rate by frontrunning (executing before the target) a transaction to purchase one of the assets and make profits by backrunning (executing after the target) a transaction to sell the asset. The following functions are called without setting restrictions on slippage or minimum output amount, so transactions triggering these functions are vulnerable to sandwich attacks, especially when the input amount is large: - removeLiquidity - addLiquidity - addBnbLiquidity

LowPull-Over-Push Pattern In `transferOwnership()` FOpen

The change of `_owner` by function `transferOwnership()` overrides the previously set `_owner` with the new one without guaranteeing the new `_owner` is able to actuate transactions on-chain.

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 assumes 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=872 address public pair; ``` - The contract `LiquidityHub` interacts with third-party contract with `IPancakePair` interface via `pair`. --- ```solidity=873 address public wbnb; ``` - The contract `LiquidityHub` interacts with third-party contract with `IWETH` interface via `wbnb`. --- ```solidity=874 address public pairWbnbUsdt; ``` - The contract `LiquidityHub` interacts with third-party contract with `IPancakePair` interface via `pairWbnbUsdt`.

LowtotalNodesCount Might Double CountedOpen

In the contract `we2net`, everytime a childNode set a parent, totalNodesCount++. If the same _parent address is set by two childNode. It will be double counted. ## Imapct As the `totalNodesCount` is only used as a rootNode initialable flag in the function `setRootNode`, It does not impact the contract functionalities.

LowVariables That Could Be Declared as ImmutableOpen

The linked variables assigned in the constructor can be declared as `immutable`. Immutable state variables can be assigned during contract creation but will remain constant throughout the lifetime of a deployed contract. A big advantage of immutable variables is that reading them is significantly cheaper than reading from regular state variables since they will not be stored in storage.

Contracts in scope1

AddressChainSource code
0x572c9ab47977d7d909572f3b8bce076a858a8763Chain: BNB ChainSource code: Verified source

Part of We2net’s security record

We2net
Audits1 audit by 1 firmLast audit Mar 2023, by CertiK.
Critical findingsNo open critical findingsIn 1 report.
Open We2net’s security record

Security firm

CertiK

1,044 projects reviewed · 1,375 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