Wemix Retainer 121 wepublicBank

CertiKFiles named in the report

Audit

Part of CertiK’s retainer series

CertiK reviewed WEMIX (Wemix Retainer 121 wepublicBank) on 2 Aug 2024: 7 findings, 0 critical; 3 marked fixed, 4 open.

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

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings7

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

SeverityOpenAcknowledgedFixed
Critical000
High200
Medium000
Low203
LowModifier Sequence OptimizationFixed

The sequence of checks within the `cancelProject` and `settleProject` function can be optimized to save gas. Specifically, the check for `msg.sender` should be arranged before the signature validation. This is because the `msg.sender` check is simpler and less computationally intensive compared to the signature validation. By performing this check first, unnecessary computationally expensive operations can be avoided if the `msg.sender` check fails. ```solidity=560 require( RbacSignatureValidator.isValidSignature( wepublicPoint, keccak256(packedData), signature, CANCEL_FUNDING_PROJECT_ROLE ), "FundingProjectTreasury: invalid signature" ); require( projectTreasury == address(this), "FundingProjectTreasury: invalid project treasury" ); require( msg.sender == projectOwner, "FundingProjectTreasury: invalid project owner" ); ```

LowSender does not transfer any tokens to the treasuFixed

In the function `fund()`, if the current type is `Wemix`, the sender will pay the native token to this contract and then transfer it to the project owner. However, if the current type is `WepublicPoint`, the `wepublicPoint` contract mints tokens to this contract but does not reduce any tokens from the sender. This could potentially allow users to fund projects without actually spending their own tokens, leading to "funding out of thin air." ```solidity=361 if (targetCurrencyType == CurrencyType.Wemix) { require( msg.value == fundAmount, "FundingProjectTreasury: invalid msg.value for Wemix" ); payable(projectOwner).transfer(fundAmount); } else if (targetCurrencyType == CurrencyType.WepublicPoint) { require( msg.value == 0, "FundingProjectTreasury: invalid msg.value for WP" ); IWepublicPointV2(wepublicPoint).mint(fundAmount); ```

LowState Variables `rewardQuantityOfFunder` and `_reFixed

In the function `_cancelProject()`, the `fundedAmounts` of the funders and `totalLockedBalance` are updated. However, the `rewardQuantityOfFunder` and `_rewardInfos` are not updated. If the `REWARD_DISTRIBUTOR_ROLE` role mistakenly distributes the removed funders, they can still receive the NFT reward even though their fund amount is 0. ```solidity=929 cancelAmounts[i] = fundedAmount; accumulatedBalance += fundedAmount; _totalLockedBalance -= fundedAmount; fundedAmounts[funder] = 0; //@audit: `rewardQuantityOfFunder` and `_rewardInfos` not updated here ``` Additionally, the function `distributeReward` should decrease the `_rewardInfos[rewardId].totalQuantity`. ```solidity=714 for (uint i = 0; i < infos.length;) { DistributeInfo memory info = infos[i]; --rewardQuantityOfFunder[info.to][rewardId]; //@audit: _rewardInfos[rewardId].totalQuantity not updated here IERC721Upgradeable(_reward.tokenAddress).safeTransferFrom(vault, info.to, info.tokenId); unchecked { ++i; } } ```

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

  • contracts/WepublicPointV3Logic.sol
  • contracts/FundingProjectTreasury.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