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.
Last updated . It holds audits and findings, contracts and incidents up to Nov 2026. Trustblock does not review code.
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).
Potentially Drain All Tokens From Other Pools
UpVsDown · CertiK · 14 Sep 2023 · Report ↗
Any User Can Burn Tokens
Playnance - Audit 2 · CertiK · 19 Jun 2024 · Report ↗
Bets May Be Taken From Other Pools
Playnance - Audit 2 · CertiK · 19 Jun 2024 · Report ↗
Centralization Related Risks
Playnance - Audit 2 · CertiK · 19 Jun 2024 · Report ↗
Centralized Balance Manipulation
Playnance - Audit 2 · CertiK · 19 Jun 2024 · Report ↗
Centralization Risks
UpVsDown · CertiK · 14 Sep 2023 · Report ↗
The Game Outcome can be Updated Within One Round
UpVsDown · CertiK · 14 Sep 2023 · Report ↗
`createPool()` Function Not Restricted
UpVsDown · CertiK · 14 Sep 2023 · Report ↗
Lack Of Validation Of `isPoolOpen`
UpVsDown · CertiK · 14 Sep 2023 · Report ↗
No Upper Limit in `changeGameFeePercentage` funct
UpVsDown · CertiK · 14 Sep 2023 · Report ↗
Newest first
| Report | Security firm | Date | Scope | Critical findings | Findings | Source |
|---|---|---|---|---|---|---|
| Playnance - Audit 2 | Security firm: CertiK | Date: | Scope: Files listed | None open | Findings: 4 high · 13 low 4 fixed · 13 open | skynet.certik.com ↗ |
| UpVsDown | Security firm: CertiK | Date: | Scope: 2 addresses on Polygon (POS) | 1 open critical finding | Findings: 1 critical · 2 high · 7 medium · 10 low 20 open | skynet.certik.com ↗ |
Statuses are the security firm’s own, from each report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 1 | 0 | 0 |
| High | 6 | 0 | 0 |
| Medium | 7 | 0 | 0 |
| Low | 19 | 0 | 4 |
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 reportThe 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 reportWhen 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 reportIn 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.  --- 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 reportIn 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 reportIn the contract `Ownable` 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 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.  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.  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 reportA 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 reportThe `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 reportThe 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 reportThe 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 reportDuring 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 reportThe 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 reportA 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 reportThe 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 reportThe 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 reportThe 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 reportIt 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 reportAddresses 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 reportWhen 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 reportWhen 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 reportPerforming 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 reportA 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 reportThe 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 reportThe 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 reportThe 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 reportBoolean 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 reportWithin 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 reportFunctions that update state variables should emit relevant events as notifications.
Open the reportAddresses 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 reportPerforming 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 reportThe 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 reportAccording 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 reportThe 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| Address | Chain | Source code |
|---|---|---|
| 0xdb41…0a840xdb414fe5a6ae09f4b58df1e5615c38c4bee10a84 | Chain: Polygon (POS) | Source code: Verified source |
| 0x7a77…9d270x7a7726273407287c7926bd177f482d1442a79d27 | Chain: Polygon (POS) | Source code: Verified source |
Trustblock holds 2 public audit reports for Playnance, dated 14 Sep 2023 to 19 Jun 2024. The latest is by CertiK (“Playnance - Audit 2”).
CertiK wrote the 2 reports Trustblock holds for Playnance.
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.
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.
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.
<head><script src="https://widget.trustblock.run/project-widget.min.js" defer></script></head><body><divdata-tb-project-widgetdata-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