Playnance audit reports

Polygon (POS)playnance.comGitHub

Playnance has 2 public audit reports from CertiK; the latest is CertiK, 19 Jun 2024; 1 critical finding, 1 open. It also holds 2 deployed contracts on 1 chain.

Critical findings
1 open critical finding
Reported in “UpVsDown” by CertiK, Sep 2023. Not marked fixed in that report. See the findings
Open the latest report
Your label, live
Get the label for your site

Last updated . It holds audits and findings, contracts and incidents up to Nov 2026. Trustblock does not review code.

Open findings across every firm33

Statuses are the security firms’ own

33 findings are still open or acknowledged in the firms’ reports: 1 critical, 6 high, 7 medium, 19 low (all open).

Critical
1
High
6
Medium
7
Low
19
  • Critical Open

    Potentially Drain All Tokens From Other Pools

    UpVsDown · CertiK · 14 Sep 2023 · Report ↗

  • High Open

    Any User Can Burn Tokens

    Playnance - Audit 2 · CertiK · 19 Jun 2024 · Report ↗

  • High Open

    Bets May Be Taken From Other Pools

    Playnance - Audit 2 · CertiK · 19 Jun 2024 · Report ↗

  • High Open

    Centralization Related Risks

    Playnance - Audit 2 · CertiK · 19 Jun 2024 · Report ↗

  • High Open

    Centralized Balance Manipulation

    Playnance - Audit 2 · CertiK · 19 Jun 2024 · Report ↗

  • High Open

    Centralization Risks

    UpVsDown · CertiK · 14 Sep 2023 · Report ↗

  • High Open

    The Game Outcome can be Updated Within One Round

    UpVsDown · CertiK · 14 Sep 2023 · Report ↗

  • Medium Open

    `createPool()` Function Not Restricted

    UpVsDown · CertiK · 14 Sep 2023 · Report ↗

  • Medium Open

    Lack Of Validation Of `isPoolOpen`

    UpVsDown · CertiK · 14 Sep 2023 · Report ↗

  • Medium Open

    No Upper Limit in `changeGameFeePercentage` funct

    UpVsDown · CertiK · 14 Sep 2023 · Report ↗

All 33 open and acknowledged findings

Audits2

Newest first

ReportSecurity firmDateScopeCritical findingsFindingsSource
Playnance - Audit 2Security firm: CertiKDate: Scope: Files listedNone openFindings: 4 high · 13 low
4 fixed · 13 open
skynet.certik.com ↗
UpVsDownSecurity firm: CertiKDate: Scope: 2 addresses on Polygon (POS)1 open critical findingFindings: 1 critical · 2 high · 7 medium · 10 low
20 open
skynet.certik.com ↗

Findings37

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

SeverityOpenAcknowledgedFixed
Critical100
High600
Medium700
Low1904
CriticalPotentially Drain All Tokens From Other PoolsUpVsDown · CertiK · 14 Sep 2023Open

The `distribute` function serves the purpose of distributing bets from participants who have incurred losses to the winners of the ongoing pool, simultaneously collecting fees from the losing participants. However, a potential issue arises when multiple pools are concurrently active, and trades are being executed on these pools. Under such circumstances, executing the distribution process for one specific pool has the potential to drain all the tokens from the other active pools since it sends all the balance of the bet tokens to the fee address. ```solidity=359 sendEther(feeAddress,getContractBalance()); ``` ```solidity=355 if (winners.distributedCount == winners.bets.length) { sendEther(feeAddress, (dist.fee + dist.totalMinusFee)*feePercentage / 100); sendEther(feeJackpotAddress, (dist.feeJackpot + dist.totalMinusJackpotFee)*feeJackpotPercentage / 100); //Send leftovers to fee address sendEther(feeAddress,getContractBalance()); clearPool(poolId); } ``` As a result, users of games participating in other pools, whether they are winners or losers, will not be able to claim their bets and rewards. **Important Note**: Certain identification and KYC procedures were attempted to be applied to the project team in order to better understand the centralization situation and potential risks of the project. Based on the collected information and further conducted investigation, the project passed the criteria with a certain amount of requirements satisfied for the investigation. Still we strongly advise end users to conduct further research and exercise due diligence before engaging with the project. It is crucial for end users to independently verify and assess all available information to make informed decisions.

Open the report
HighAny User Can Burn TokensPlaynance - Audit 2 · CertiK · 19 Jun 2024Open

The USDP tokens is meant to be a stable coin and should only be burnable by the contract's owner, as seen from the way that the `ERC20Burnable.burn()` function is overwritten: ```solidity=31 function burn(uint256 amount) public override onlyOwner { super._burn(owner(), amount); } ``` However, the function `ERC20Burnable.burnFrom()` is not overwritten, allowing any user to burn their own tokens by first giving themself an allowance and then calling `burnFrom()`. As the USDP token is meant to be a stable coin, its supply is incredibly important for its tokenomics. Allowing arbitrary users to burn the stable coin causes the token to be at risk of depegging.

Open the report
HighBets May Be Taken From Other PoolsPlaynance - Audit 2 · CertiK · 19 Jun 2024Open

When distributing winnings, winnings are distributed to all winners and then the fee and remaining tokens in the contract are distributed to the fee address. In the case of multiple pools, these remaining tokens may consist of bets made to other pools. ```solidity=420 if (winners.distributedCount == winners.bets.length) { sendToken( feeAddress, ((dist.fee + dist.totalMinusFee) * feePercentage) / 100 ); sendToken( feeJackpotAddress, ((dist.feeJackpot + dist.totalMinusJackpotFee) * feeJackpotPercentage) / 100 ); //Send leftovers to fee address sendToken(feeAddress, getContractTokenBalance()); ``` As such, these leftover tokens that were supposed to be used as bets for another pool are stolen by the fee address.

Open the report
HighCentralization Related RisksPlaynance - Audit 2 · CertiK · 19 Jun 2024Open

In the contract `USDP` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and mint stable coins to themself, take taxes for themself, or greatly increase taxes. ![](https://accelerator-tasks-prod.acc.corp.certik.com/11ef-0bd0-984a1630-9ea9-3118e42f544a/diagrams/centralization_usd-USDP-_owner.svg) --- In the contract `UpVsDownGameV8`, the role `_owner` has authority over the following functions: - `changeGameControllerAddress`: changes the address of the `gameController` role - `changeGameFeePercentage`: changes the fee rate - `changeGameFeeJackpotPercentage`: changes the jackpot fee rate - `changeGameFeeAddress`: changes the address that fees are sent to - `changeGameFeeJackpotAddress`: changes the address that jackpot fees are sent to - `stopGame`: stops the game from running, preventing the start of rounds and bets - `startGame`: starts the game, allowing the start of rounds and bets - `allowContract`: whitelists a contract to make bets - `removeContract`: removes a contract from the whitelist Additionally, the role `gameController` has authority over the following functions: - `createPool`: starts a new pool - `trigger`: starts or ends a round - `distribute`: returns bets or transfers bet winnings Any compromise to either of the above roles allows a hacker to disrupt the game and decide how a game will end.

Open the report
HighCentralized Balance ManipulationPlaynance - Audit 2 · CertiK · 19 Jun 2024Open

In the contract `USDP`, the role `owner` has the authority to mint tokens to an arbitrary account without any restrictions. Any compromise to the `owner` account may allow a hacker to take advantage of this authority and manipulate users' balances. Since `USDP` is meant to be a stable coin, a hacker with access to the `owner` account would be able to acquire a large number of `USDP` stable coins or greatly manipulate the price of `USDP`.

Open the report
HighCentralization RisksUpVsDown · CertiK · 14 Sep 2023Open

In the contract `Ownable` the role `_owner` has authority over the functions shown in the diagram below. ![](https://accelerator-tasks-prod.acc.corp.certik.com/b97df111417649b3838a1bbe4bd45aa8/diagrams/centralization_UpVsDownGameV2-Ownable-_owner.svg) Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and affect the following functions: - renounceOwnership: Leave the contract without the owner. - transferOwnership: Transfer ownership of the contract to a new account (`newOwner`). In the contract `UpVsDownGameV2` the role `_owner` has authority over the functions shown in the diagram below. ![](https://accelerator-tasks-prod.acc.corp.certik.com/b97df111417649b3838a1bbe4bd45aa8/diagrams/centralization_UpVsDownGameV2-UpVsDownGameV2-_owner.svg) Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and affect the following functions: - changeGameControllerAddress: Set gameController address, who can control the whole process of this game. - changeGameFeePercentage: Set a game fee percentage that represents the rate of taxation from the loser. - changeGameFeeAddress: Set the fee address that can receive the game fee, the default fee address is the deployer. - stopGame: stop the game process, bettors can't call the `makeTrade` - startGame: start the game process to make the bettors trade. In the contract `UpVsDownGameV2` the role `gameController` has authority over the functions shown in the diagram below. ![](https://accelerator-tasks-prod.acc.corp.certik.com/b97df111417649b3838a1bbe4bd45aa8/diagrams/centralization_UpVsDownGameV2-UpVsDownGameV2-gameController.svg) Any compromise to the `gameController` account may allow the hacker to take advantage of this authority and affect the following functions. - trigger: to start the game, end the game, distribute bets and rewards to winners, or return bets to players. - distribute: to distribute the bets and rewards to winners, or return bets to players. - createPool: Create a trading pool to allow bettors to place bets. In the contract `UpVsDownGameV4` the role `gameController` has authority over the functions. Any compromise to the `gameController` account may allow the hacker to take advantage of this authority and affect the following functions: - changeGameFeeJackpotPercentage(), to change the game fee percentage. - changeGameFeeJackpotAddress(), to change the game fee charged address. **Important Note**: Certain identification and KYC procedures were attempted to be applied to the project team in order to better understand the centralization situation and potential risks of the project. Based on the collected information and further conducted investigation, the project passed the criteria with a certain amount of requirements satisfied for the investigation. Still we strongly advise end users to conduct further research and exercise due diligence before engaging with the project. It is crucial for end users to independently verify and assess all available information to make informed decisions.

Open the report
HighThe Game Outcome can be Updated Within One RoundUpVsDown · CertiK · 14 Sep 2023Open

A game round consists of two steps, where the `trigger` function can be called to set `startPrice` and initiate the game. After the game starts, players engage in trading and place bets on the game outcome. After a certain period of time, the `trigger` function is called again to determine the game result based on `endPrice` and distribute the bets and rewards to the winners. However, there is no guarantee that `endPrice` will not be zero, so the second step can be executed multiple times, generating different game results and redistributing bets and rewards from other rounds, this can lead to unfairness in the user's gameplay and potentially result in losses for other players. ```solidity=283 function trigger( bytes calldata poolId, int64 timeMS, uint256 tradesStartTimeMS, uint256 tradesEndTimeMS, int32 price, uint32 batchSize ) public onlyGameController onlyPoolExists(poolId) { Round storage currentRound = pools[poolId]; if(isPoolOpen(poolId)) { require(isRunning, 'The game is not running, rounds can only be ended at this point'); currentRound.startPrice = price; currentRound.roundStartTime = timeMS; currentRound.tradesStartTimeMS = tradesStartTimeMS; currentRound.tradesEndTimeMS = tradesEndTimeMS; emit RoundStarted(poolId, timeMS, currentRound.startPrice, currentRound.minBetAmount, currentRound.maxBetAmount, currentRound.poolBetsLimit, poolId); } else if (currentRound.endPrice == 0) { currentRound.endPrice = price; emit RoundEnded(poolId, timeMS, currentRound.startPrice, currentRound.endPrice, poolId); distribute(poolId, batchSize, timeMS); } else { revert PendingDistributions(); } } ``` **Important Note**: Certain identification and KYC procedures were attempted to be applied to the project team in order to better understand the centralization situation and potential risks of the project. Based on the collected information and further conducted investigation, the project passed the criteria with a certain amount of requirements satisfied for the investigation. Still we strongly advise end users to conduct further research and exercise due diligence before engaging with the project. It is crucial for end users to independently verify and assess all available information to make informed decisions.

Open the report
Medium`createPool()` Function Not RestrictedUpVsDown · CertiK · 14 Sep 2023Open

The `createPool` function has the potential to overwrite an existing pool if the poolId already exists. This can result in the bettor's funds becoming locked in the overwritten pool, potentially causing a loss of funds. Additionally, this can cause a logic error in the system, leading to unexpected behavior. ````solidity=276 function createPool(bytes calldata poolId, uint256 minBetAmount , uint256 maxBetAmount, uint256 poolBetsLimit) public onlyGameController { pools[poolId].created = true; pools[poolId].minBetAmount = minBetAmount; pools[poolId].maxBetAmount = maxBetAmount; pools[poolId].poolBetsLimit = poolBetsLimit; } ````

Open the report
MediumLack Of Validation Of `isPoolOpen`UpVsDown · CertiK · 14 Sep 2023Open

The function `distribute` can be called to distribute the bets and rewards to the winners. However, there is no guarantee that the round ends. Based on the correct process, bets and rewards will be distributed to the winners after `endPrice` is set by the function `trigger`.

Open the report
MediumNo Upper Limit in `changeGameFeePercentage` functUpVsDown · CertiK · 14 Sep 2023Open

The method `changeGameFeePercentage` is used to set the fee rate for taxing the losers' funds. The current implementation allows for setting the fee rate to any value without an upper bound. If the fee rate is 100 percent, the winner will not receive any profit. ````solidity=256 function changeGameFeePercentage(uint8 newFeePercentage) public onlyOwner { feePercentage = newFeePercentage; } ````

Open the report
Show 10 more
MediumPotential DOS AttackUpVsDown · CertiK · 14 Sep 2023Open

During the execution of the `distribute` function, users' bets are distributed by invoking the `sendEther` function. However, if the winner is a malicious smart contract with a fallback function that reverts any payment, all the bets will become locked within the contract.

Open the report
MediumPotential Lock the Bets And RewardsUpVsDown · CertiK · 14 Sep 2023Open

The function `distribute` is centralized and can only be invoked by the `GameController` role. Consequently, the timing of distributing bets and rewards is solely determined by the `GameController` role, even if the game has already ended. This can result in a poor user experience. In the worst-case scenario, if the `GameController` role is exploited, bets and rewards could potentially remain in the contract indefinitely. We would like to confirm with the client if the current implementation aligns with the original project design.

Open the report
MediumPotential Reentrancy Attack (Sending Ether or TokUpVsDown · CertiK · 14 Sep 2023Open

A reentrancy attack can occur when the contract creates a function that makes an external call to another untrusted contract before resolving any effects. If the attacker can control the untrusted contract, they can make a recursive call back to the original function, repeating interactions that would have otherwise not run after the external call resolved the effects. ### External call(s) ```solidity=322 sendEther(group.addresses[i], group.bets[i]); ``` * This function call executes the following external call(s). * In `UpVsDownGameV2.sendEther`, * `(sent,data) = address(to).call{gas: 0,value: amount}("")` ### State variables written after the call(s) ```solidity=326 group.distributedCount = to; ``` --- ### External call(s) ```solidity=340 returnBets(poolId, returnGroup, batchSize); ``` * This function call executes the following external call(s). * In `UpVsDownGameV2.sendEther`, * `(sent,data) = address(to).call{gas: 0,value: amount}("")` ### State variables written after the call(s) ```solidity=344 clearPool(poolId); ``` * This function call executes the following assignment(s). * In `UpVsDownGameV2.clearPool`, * `delete pools[poolId].upBetGroup` * In `UpVsDownGameV2.clearPool`, * `delete pools[poolId].downBetGroup` * In `UpVsDownGameV2.clearPool`, * `delete pools[poolId].startPrice` * In `UpVsDownGameV2.clearPool`, * `delete pools[poolId].endPrice` --- ### External call(s) ```solidity=364 sendEther(winners.addresses[i], winnings + winners.bets[i]); ``` * This function call executes the following external call(s). * In `UpVsDownGameV2.sendEther`, * `(sent,data) = address(to).call{gas: 0,value: amount}("")` ### State variables written after the call(s) ```solidity=366 winners.totalDistributed = winners.totalDistributed + winnings; ``` ```solidity=371 winners.distributedCount = to; ``` ```solidity=362 for (uint i = winners.distributedCount; i < to; i++) { ``` --- ### External call(s) ```solidity=364 sendEther(winners.addresses[i], winnings + winners.bets[i]); ``` * This function call executes the following external call(s). * In `UpVsDownGameV2.sendEther`, * `(sent,data) = address(to).call{gas: 0,value: amount}("")` ```solidity=373 sendEther(feeAddress, dist.fee + dist.totalMinusFee - winners.totalDistributed); ``` ### State variables written after the call(s) ```solidity=374 clearPool(poolId); ``` * This function call executes the following assignment(s). * In `UpVsDownGameV2.clearPool`, * `delete pools[poolId].upBetGroup` * In `UpVsDownGameV2.clearPool`, * `delete pools[poolId].downBetGroup` * In `UpVsDownGameV2.clearPool`, * `delete pools[poolId].startPrice` * In `UpVsDownGameV2.clearPool`, * `delete pools[poolId].endPrice`

Open the report
MediumUnreasonable Upper Boundary on `newFeePercentage`UpVsDown · CertiK · 14 Sep 2023Open

The functions `changeGameFeePercentage` and `changeGameFeeJackpotPercentage` allows the owner to set the fee percent to 100, hence, all return bet amount will possibly be charged as fees. ```solidity=197 function changeGameFeePercentage(uint8 newFeePercentage) public onlyOwner { require (newFeePercentage <=100 , "Wrong fee percentage value"); feePercentage = newFeePercentage; } function changeGameFeeJackpotPercentage(uint8 newFeeJackpotPercentage) public onlyOwner { require (newFeeJackpotPercentage <=100 , "Wrong jackpot fee percentage value"); feeJackpotPercentage = newFeeJackpotPercentage; } ```

Open the report
LowIncorrect Upper Bound on Tax RatePlaynance - Audit 2 · CertiK · 19 Jun 2024Open

The documentation and comments state that the maximum tax rate is 1%. ```solidity=65 require(newTaxRate <= 1000, "Tax rate cannot exceed 1%"); ``` However, the tax rate is out of 10000, meaning the maximum tax rate is 1000/10000 = 10%. ```solidity=47 taxAmount = (amount * _taxRate) / 10000; ```

Open the report
LowMints and Burns are TaxedPlaynance - Audit 2 · CertiK · 19 Jun 2024Open

The ERC20 `_update` function has been overwritten to apply taxes if the tax rate is positive. ```solidity=46 if (!_whitelist[from] && !_whitelist[to] && _taxRate > 0) { taxAmount = (amount * _taxRate) / 10000; require(taxAmount > 0, "Tax amount too low"); super._update(from, _taxWallet, taxAmount); //Send the tax amount to tax wallet } ``` In particular, mints and burns are by default taxed as the `_mint` and `_burn` functions use `_update`. ```solidity function _mint(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(address(0), account, value); } ``` ```solidity function _burn(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidSender(address(0)); } _update(account, address(0), value); } ``` However, it does not make sense for these operations to be taxed.

Open the report
LowMissing Emit EventsPlaynance - Audit 2 · CertiK · 19 Jun 2024Open

It is important to emit events for sensitive actions, particularly those that can be executed by centralized roles or administrators. This ensures transparency and enables tracking of critical changes, which is essential for security and trust in the system. Missing event logs can indeed result in a lack of visibility and potential information loss.

Open the report
LowMissing Zero Address ValidationPlaynance - Audit 2 · CertiK · 19 Jun 2024Open

Addresses are not validated before assignment or external calls, potentially allowing the use of zero addresses and leading to unexpected behavior or vulnerabilities. For example, transferring tokens to a zero address can result in a permanent loss of those tokens. ```solidity=23 _taxWallet = taxWallet; ``` - `taxWallet` is not zero-checked before being used. --- ```solidity=154 gameController = newGameController; ``` - `newGameController` is not zero-checked before being used.

Open the report
LowNot Compliant With the EIP20 StandardPlaynance - Audit 2 · CertiK · 19 Jun 2024Open

When transferring tokens, a possible tax is taken on the amount transferred: ```solidity=46 if (!_whitelist[from] && !_whitelist[to] && _taxRate > 0) { taxAmount = (amount * _taxRate) / 10000; require(taxAmount > 0, "Tax amount too low"); super._update(from, _taxWallet, taxAmount); //Send the tax amount to tax wallet } ``` If the tax amount is 0, then the transfer fails. In particular, when transferring 0 tokens, the transfer will always fail as the tax amount will be 0 in this situation. This is not compliant with the EIP20 standard, as transfers of 0 tokens are expected to succeed: https://eips.ethereum.org/EIPS/eip-20. In addition, this creates an issue with interoperability. Smart contracts wishing to interact with the USDP contract would need to handle the situation when transferring 0 tokens, which is not the standard.

Open the report
LowPotential Denial-of-Service AttackPlaynance - Audit 2 · CertiK · 19 Jun 2024Open

When returning bets or distributing winnings, a loop occurs where tokens are sent to the bettors for each iteration of the loop. ```solidity=297 for (uint i = group.distributedCount; i < to; i++) { sendToken(group.addresses[i], group.bets[i]); ``` Depending on the token used, such as tokens with hooks or callbacks, it may be possible for a malicious better to cause a transfer of tokens to fail, resulting in the entire loop reverting. As there are no other ways for bettors to receive their funds, their tokens will be locked in the contract.

Open the report
Show 10 more
LowPotential Divide by ZeroPlaynance - Audit 2 · CertiK · 19 Jun 2024Open

Performing division by zero would raise an error and revert the transaction. ```solidity=393 uint256 winnings = ((winners.bets[i] * dist.totalFees * 100) / winners.total / ``` The expression `(winners.bets[i] * dist.totalFees * 100) / winners.total` may divide by zero. Note that this is only possible if the minimum bet is 0.

Open the report
LowPotential Reentrancy Attack (Sending Tokens)Playnance - Audit 2 · CertiK · 19 Jun 2024Open

A reentrancy attack can occur when the contract creates a function that makes an external call to another untrusted contract before resolving any effects. If the attacker can control the untrusted contract, they can make a recursive call back to the original function, repeating interactions that would have otherwise not run after the external call resolved the effects. ### External call(s) ```solidity=298 sendToken(group.addresses[i], group.bets[i]); ``` * This function call executes the following external call(s). * In `UpVsDownGameV7.sendToken`, * `sent = token.transfer(to,amount)` ### State variables written after the call(s) ```solidity=307 group.distributedCount = to; ``` --- ### External call(s) ```solidity=330 returnBets(poolId, returnGroupUp, batchSize); ``` * This function call executes the following external call(s). * In `UpVsDownGameV7.sendToken`, * `sent = token.transfer(to,amount)` ```solidity=331 returnBets(poolId, returnGroupDown, batchSize); ``` ### State variables written after the call(s) ```solidity=354 clearPool(poolId); ``` * This function call executes the following assignment(s). * In `UpVsDownGameV7.clearPool`, * `delete pools[poolId].upBetGroup` * In `UpVsDownGameV7.clearPool`, * `delete pools[poolId].downBetGroup` * In `UpVsDownGameV7.clearPool`, * `delete pools[poolId].startPrice` * In `UpVsDownGameV7.clearPool`, * `delete pools[poolId].endPrice` ```solidity=331 returnBets(poolId, returnGroupDown, batchSize); ``` * This function call executes the following assignment(s). * In `UpVsDownGameV7.returnBets`, * `group.distributedCount = to` --- ### External call(s) ```solidity=363 returnBets(poolId, returnGroup, batchSize); ``` * This function call executes the following external call(s). * In `UpVsDownGameV7.sendToken`, * `sent = token.transfer(to,amount)` ### State variables written after the call(s) ```solidity=373 clearPool(poolId); ``` * This function call executes the following assignment(s). * In `UpVsDownGameV7.clearPool`, * `delete pools[poolId].upBetGroup` * In `UpVsDownGameV7.clearPool`, * `delete pools[poolId].downBetGroup` * In `UpVsDownGameV7.clearPool`, * `delete pools[poolId].startPrice` * In `UpVsDownGameV7.clearPool`, * `delete pools[poolId].endPrice` --- ### External call(s) ```solidity=397 sendToken(winners.addresses[i], winnings + winners.bets[i]); ``` * This function call executes the following external call(s). * In `UpVsDownGameV7.sendToken`, * `sent = token.transfer(to,amount)` ### State variables written after the call(s) ```solidity=408 winners.totalDistributed = winners.totalDistributed + winnings; ``` ```solidity=419 winners.distributedCount = to; ``` ```solidity=392 for (uint i = winners.distributedCount; i < to; i++) { ``` --- ### External call(s) ```solidity=397 sendToken(winners.addresses[i], winnings + winners.bets[i]); ``` * This function call executes the following external call(s). * In `UpVsDownGameV7.sendToken`, * `sent = token.transfer(to,amount)` ```solidity=421 sendToken( feeAddress, ((dist.fee + dist.totalMinusFee) * feePercentage) / 100 ); ``` ```solidity=425 sendToken( feeJackpotAddress, ((dist.feeJackpot + dist.totalMinusJackpotFee) * feeJackpotPercentage) / 100 ); ``` ```solidity=431 sendToken(feeAddress, getContractBalance()); ``` ### State variables written after the call(s) ```solidity=433 clearPool(poolId); ``` * This function call executes the following assignment(s). * In `UpVsDownGameV7.clearPool`, * `delete pools[poolId].upBetGroup` * In `UpVsDownGameV7.clearPool`, * `delete pools[poolId].downBetGroup` * In `UpVsDownGameV7.clearPool`, * `delete pools[poolId].startPrice` * In `UpVsDownGameV7.clearPool`, * `delete pools[poolId].endPrice` --- ### External call(s) ```solidity=561 token.transferFrom(_msgSender(), address(this), userTrade.amount); ``` ### State variables written after the call(s) ```solidity=563 newTotal = addBet( betGroup, _msgSender(), userTrade.amount, userTrade.avatarUrl, userTrade.countryCode, userTrade.whiteLabelId ); ``` * This function call executes the following assignment(s). * In `UpVsDownGameV7.addBet`, * `betGroup.bets.push(amount)` * In `UpVsDownGameV7.addBet`, * `betGroup.addresses.push(signer)` * In `UpVsDownGameV7.addBet`, * `betGroup.avatars.push(avatar)` * In `UpVsDownGameV7.addBet`, * `betGroup.countries.push(countryCode)` * In `UpVsDownGameV7.addBet`, * `betGroup.whiteLabelIds.push(whiteLabelId)` * In `UpVsDownGameV7.addBet`, * `betGroup.total += amount`

Open the report
LowUnchecked ERC-20 `transfer()`/`transferFrom()` CaPlaynance - Audit 2 · CertiK · 19 Jun 2024Open

The return values of the `transfer()` and `transferFrom()` calls in the smart contract are not checked. Some ERC-20 tokens' transfer functions return no values, while others return a bool value, they should be handled with care. If a function returns `false` instead of reverting upon failure, an unchecked failed transfer could be mistakenly considered successful in the contract. ```solidity=561 token.transferFrom(_msgSender(), address(this), userTrade.amount); ```

Open the report
LowCalculation Can Be SimplifiedUpVsDown · CertiK · 14 Sep 2023Open

The fee calculation can be simplified. ```solidity=356 sendEther(feeAddress, (dist.fee + dist.totalMinusFee)*feePercentage / 100); sendEther(feeJackpotAddress, (dist.feeJackpot + dist.totalMinusJackpotFee)*feeJackpotPercentage / 100); ``` Since the `dist.fee + dist.totalMinusFee` is equal to `losers.total`, and `dist.feeJackpot + dist.totalMinusJackpotFee` is equal to `losers.total` too.

Open the report
LowCheck Effect Interaction Pattern ViolatedUpVsDown · CertiK · 14 Sep 2023Open

The sequence of external call and storage manipulation must follow a check effect interaction pattern. - `returnBets` ```solidity=282 for (uint i = group.distributedCount; i < to; i ++) { sendEther(group.addresses[i], group.bets[i]); emit TradeReturned(poolId, group.addresses[i], group.bets[i], group.whiteLabelIds[i]); } group.distributedCount = to; ``` - `distribute()` ```solidity=344 for (uint i = winners.distributedCount; i < to; i++) { uint256 winnings = (winners.bets[i] * dist.totalFees * 100 / winners.total / 100); sendEther(winners.addresses[i], winnings + winners.bets[i]); emit TradeWinningsSent(poolId, winners.addresses[i], winners.bets[i], winnings, winners.addresses[i], winners.whiteLabelIds[i],feePercentage,feeJackpotPercentage); winners.totalDistributed = winners.totalDistributed + winnings; } emit RoundDistributed(poolId, winners.bets.length, winners.distributedCount, to, timeMS); winners.distributedCount = to; if (winners.distributedCount == winners.bets.length) { sendEther(feeAddress, (dist.fee + dist.totalMinusFee)*feePercentage / 100); sendEther(feeJackpotAddress, (dist.feeJackpot + dist.totalMinusJackpotFee)*feeJackpotPercentage / 100); //Send leftovers to fee address sendEther(feeAddress,getContractBalance()); clearPool(poolId); } ```

Open the report
LowComparison to Boolean ConstantUpVsDown · CertiK · 14 Sep 2023Open

Boolean constants can be used directly and do not need to be compared to true or false. ```solidity=242 require(pools[poolId].created == true, 'Pool does not exist'); ```

Open the report
LowLack Of Input Validation On the Function `triggerUpVsDown · CertiK · 14 Sep 2023Open

Within the `trigger` function, there appears to be a lack of validations in place to guarantee the integrity of certain parameters. It is important to implement validations that ascertain the following conditions: - The value of the `price` parameter must be greater than zero to ensure valid trade calculations - The start time of the trade, denoted as `tradesStartTimeMS`, should be earlier than the trade end time, denoted as `tradesEndTimeMS`. This validation is essential to maintain chronological coherence in the trade timeline ```solidity=250 if(isPoolOpen(poolId)) { require(isRunning, 'The game is not running, rounds can only be ended at this point'); currentRound.startPrice = price; currentRound.roundStartTime = timeMS; currentRound.tradesStartTimeMS = tradesStartTimeMS; currentRound.tradesEndTimeMS = tradesEndTimeMS; emit RoundStarted(poolId, timeMS, currentRound.startPrice, currentRound.minBetAmount, currentRound.maxBetAmount, currentRound.poolBetsLimit, poolId); } ```

Open the report
LowMissing Emit EventsUpVsDown · CertiK · 14 Sep 2023Open

Functions that update state variables should emit relevant events as notifications.

Open the report
LowMissing Zero Address ValidationUpVsDown · CertiK · 14 Sep 2023Open

Addresses are not validated before assignment or external calls, potentially allowing the use of zero addresses and leading to unexpected behavior or vulnerabilities. For example, transferring tokens to a zero address can result in a permanent loss of those tokens. ```solidity=247 gameController = newGameController; ``` - `newGameController` is not zero-checked before being used. --- ```solidity=253 gameController = newGameController; ``` - `newGameController` is not zero-checked before being used. --- ```solidity=261 feeAddress = newFeeAddress; ``` - `newFeeAddress` is not zero-checked before being used.

Open the report
LowPotential Divide by ZeroUpVsDown · CertiK · 14 Sep 2023Open

Performing division by zero would raise an error and revert the transaction. ```solidity=345 uint256 winnings = (winners.bets[i] * dist.totalFees * 100 / winners.total / 100); ``` The expression `winners.bets[i] * dist.totalFees * 100 / winners.total` may divide by zero. Its divisor has has estimated interval [0, 231584178474632390847141970017375815706539969331281128078915168015826259279870].

Open the report
Show 3 more
LowRequest for Explanation of Price Source and CalcuUpVsDown · CertiK · 14 Sep 2023Open

The parameter `price` passed to the function `trigger` eventually determines which group will win the game. And this function `trigger` is only accessible to the `GameController` role. We would like the team to explain the source of the price and provide a more detailed explanation of the calculation logic behind it.

Open the report
LowThe default winner is `downBetGroup`UpVsDown · CertiK · 14 Sep 2023Open

According to the distribution logic, if both the `startPrice` and `endPrice` are equal, regardless of whether they are zero or not, the `downBetGroup` will ultimately emerge as the winner of the game. ```solidity=329 function distribute ( bytes calldata poolId, uint32 batchSize, int64 timeMS ) public onlyGameController onlyPoolExists(poolId) { ... BetGroup storage winners = round.downBetGroup; BetGroup storage losers = round.upBetGroup; if (round.startPrice < round.endPrice) { winners = round.upBetGroup; losers = round.downBetGroup; } ... ```` We would like to confirm with the client if the current implementation aligns with the original project design.

Open the report
LowUnused Contract and LibraryUpVsDown · CertiK · 14 Sep 2023Open

The project contains one or more contract or library definitions that are not used, which can lead to unnecessary complexity and reduced maintainability. ```solidity=104 library Strings { ``` - The library `Strings` is declared but never used.

Open the report

Contracts2

AddressChainSource code
0xdb414fe5a6ae09f4b58df1e5615c38c4bee10a84Chain: Polygon (POS)Source code: Verified source
0x7a7726273407287c7926bd177f482d1442a79d27Chain: Polygon (POS)Source code: Verified source

All 2 addresses and the files the reports name

Playnance: questions

Is Playnance audited?

Trustblock holds 2 public audit reports for Playnance, dated 14 Sep 2023 to 19 Jun 2024. The latest is by CertiK (“Playnance - Audit 2”).

Who audited Playnance?

CertiK wrote the 2 reports Trustblock holds for Playnance.

Are there open findings in Playnance’s audits?

33 findings are still open or acknowledged in the firms’ reports: 1 critical, 6 high, 7 medium, 19 low (all open). Of 1 critical finding: 1 open. Statuses are the security firms’ own.

Show this on your site

Is this your project? Show this record on your own website. The label states what the record holds, links to this page and updates by itself. It is free and needs no sign-in.

Content

Facts

Automatic: the three strongest facts of this project’s own record (its last audit and two more), highlighted. They update with the record. Picking a fact turns Automatic off.

Fixed as
Language

Style

Layout
Theme
Accent
Corners

Format

Size
Date
Embed as
HTML
<head>
<script src="https://widget.trustblock.run/project-widget.min.js" defer></script>
</head>
<body>
<div
data-tb-project-widget
data-tb-project-slug="playnance"
></div>
</body>

Paste the code where the label should appear. It uses no API credit and updates by itself.

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