Wemix BYLOSports Wemix3.0 Mainnet - Retainer 30

CertiKFiles named in the report

Audit

Part of CertiK’s retainer series

CertiK reviewed WEMIX (Wemix BYLOSports Wemix3.0 Mainnet - Retainer 30) on 28 Jun 2023: 14 findings, 0 critical; 3 marked fixed, 11 open.

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

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings14

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

SeverityOpenAcknowledgedFixed
Critical000
High201
Medium000
Low902
HighCentralization Related RisksOpen

In the contract `RoleManager` the role `role` has authority over the following function: - renounceRole() Any compromise to the `role` account may allow the hacker to take advantage of this authority and renounce corresponding privileges to functions within other contracts. ----------- In the contract `RoleManager` the role `adminRole` has authority over the following functions: - setRoleAdmin() - grantRole() - revokeRole() - renounceRole() Any compromise to the `adminRole` accounts may allow the hacker to take advantage of this authority and grant associated role to any account, revoke the role from any account, and renounce the role. ----------- In the contract `ExecuteManager` the role `setterRole` has authority over the following functions: - changeExecutability() - changeExecutabilityBelongContract() Any compromise to the `setterRole` accounts may allow the hacker to take advantage of this authority and modify important variables. ----------- In the contract `BYLOSports` the role `executeManager` has authority over the following functions: - enter() - reward() Any compromise to the `executeManager` account may allow the hacker to take advantage of this authority and pause or unpause the `enter()` and `reward()` functions. ----------- In the contract `BYLOSports` the role `defaultOwner` has authority over the following functions: - withdrawCharge() - changeValidator() - setVault() - setCoolTime() Any compromise to the `defaultOwner` account may allow the hacker to take advantage of this authority and set important variables, withdraw tokens from the contract, and transfer tokens from `vault`. ----------- In the contract `BYLOSports` the role `validator` has authority to provide signatures, enabling users to interact with the following functions: - enter() - settle() - reward() Any compromise to the `validator` account may allow the hacker to take advantage of this authority and withdraw tokens from this contract and the `vault` address.

HighMinting Centralization RiskOpen

In the contract `GameToken`, the role `navigator` has the authority to mint an arbitrary amount of tokens to an arbitrary address. Any compromise to the `navigator` account may allow a hacker to take advantage of this authority and mint a huge amount of tokens to themselves. The hacker could sell those tokens and cause the token price to drop.

LowInconsistency in the `withdrawCharge()` functionOpen

The comments for the `withdrawCharge()` function indicate its purpose is for the owner to "get remain reward" from winning events. However, in practice, this function withdraws the betting amount, not the reward. Additionally, it can be utilized to withdraw tokens from losing events as well. ```solidity=189 /** * @dev External function to withdraw * Withdraws the amount of the event ID from which the reward was not received by user to another address * @param to address of get remain reward * @param eventID ID of user don't received event */ function withdrawCharge( address to, bytes32 eventID ) external onlyOwner { require(betInfo[eventID].isSettled, "BYLOSports: event is not settled yet"); require(!betInfo[eventID].taken, "BYLOSports: user already received"); require(betInfo[eventID].amount > 0, "BYLOSports: event non-existence"); betInfo[eventID].taken = true; require(_token.transfer(to, betInfo[eventID].amount), "BYLOSports: withdraw error"); } ```

LowMissing Emit EventsOpen

There should always be events emitted in the sensitive functions that are controlled by centralization roles.

LowMissing Removal of Index from `_registIndex` MappOpen

The `_removeListElement()` function within the contract is designed to remove an account from a specific role's list. However, the function is not correctly removing the index from the `_registIndex` mapping.

LowMissing Zero Address ValidationOpen

Addresses are not validated before assignment or external calls, potentially allowing the use of zero addresses and leading to unexpected behavior or vulnerabilities. If critical roles are assigned to a zero address, it could result in permanent loss of those roles. ```solidity=80 _validator = validator; ``` - `validator` is not zero-checked before being used. --- ```solidity=18 navigator = navigator_; ``` - `navigator_` is not zero-checked before being used.

LowPotential Cross-Chain Replay AttackOpen

Signed messages are not properly verified with the current chain ID, thus allowing attackers to perform replay attacks across chains. Hardcoded or cached chain ID values are also vulnerable since a hard fork may occur and change the chain ID in the future.

LowPotential Inconsistency in `settle()` FunctionOpen

The `settle()` function is utilized for settling events, determining the winners and losers. However, that there might be an inconsistency in this function, specifically with the `totalReward` parameter. This parameter represents the total reward amount to be distributed among winners, yet the individual reward for each event is not considered within the function. This could lead to a discrepancy where the `totalReward` does not accurately represent the actual reward amount.

LowPotential Risks Related to Contract BalanceOpen

In the existing design, users place bets by transferring tokens into this contract and also claim their rewards from the contract. However, there might be two potential risks. Specifically, if the contract's balance is insufficient, users may not be able to claim their rewards. Furthermore, if the amount of the bet is larger than the rewards, the excess tokens could potentially be locked within the contract.

LowRisk of Function Reversion Due to Insufficient VaOpen

The `settle()` function in the current implementation may require a transfer of tokens from the vault to this contract. If the balance in the vault is not sufficient to cover this transfer, the `settle()` function could potentially revert, which would prevent the correct settlement of events.

Show 1 more
LowRole Indexing Issue in Role ManagementOpen

The `_registIndex` mapping records the index of an element in the `_roleList[_role]` array. However, if the index is 0, it does not distinguish whether the element exists in the `_roleList[_role]` array. This is due to the default behavior of Solidity mappings, where querying a non-existent key returns a zero value. As a result, for accounts that do not exist in `_roleList[_role]`, the value of `_registIndex[_role][_account]` is also 0.

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

  • contracts/projects/Bylo/contracts/BYLOSports/BYLOSports.sol
  • contracts/projects/RoleManager/contracts/RoleManager.sol
  • contracts/projects/ExecuteManager/contracts/ExecuteManager.sol
  • contracts/projects/GameToken/contracts/Token/GameToken.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