Skip to content
Business logic Audit finding Beginner

Discrepancy between number of Yeetback winners in contract and documentation

The Yeetback contract hardcodes the number of winners per round to ten, while the project documentation says this number is configurable. A user relying on the documentation would wrongly believe the winner count can be changed.

Oxrochimaru Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#42388 [SC-Insight] Discrepancy between number of Yeetback winners in contract and documentation

Submitted on Mar 23rd 2025 at 14:12:20 UTC by @Oxrochimaru for Audit Comp | Yeet

Description

Brief/Intro

As per documentation the number of yeetback winners are 10 but are configurable via config. But as per Yeetback::draftWinners() nrOfWinners are hardcoded to 10 and can't be changed.

https://docs.yeetit.xyz/yeet/yeet-game

Solidity
    function draftWinners(uint256 randomNumber, uint256 round) private {
        uint256 potValue = potForRound[round];
        uint256 nrOfYeets = yeetsInRound[round].length;
        uint256 nrOfWinners = 10;

        uint256 winnings = potValue / nrOfWinners;
        amountToWinners[round] = winnings;

        for (uint256 i; i < nrOfWinners; i++) {
            uint256 randomDataNumber = uint256(keccak256(abi.encodePacked(randomNumber, i)));
            uint256 winningYeetIndex = randomDataNumber % nrOfYeets; // index of the winning yeet
            address winnerAddress = yeetsInRound[round][winningYeetIndex];

            // Update amountToWinners and amountOfWins
            amountOfWins[round][winnerAddress] += 1;

            emit YeetbackWinner(round, winnerAddress, winnings, winningYeetIndex);
        }
    }

Vulnerability Details

The documentation states that number of winners can change but it is hardcoded to 10 in the smart contract.

Impact Details

Documentation is contradicting the actual behaviour in the code.

References

Numbers that are formated in this way 10 means that they are changeable via some configuration.

Proof of Concept

Proof of Concept

  • User reading the documentation will believe number of winners are configurable.
  • Actually no. of winners are fixed to 10 in the smart contract.

The original report as published on Immunefi, by Oxrochimaru. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the winner count was written as a fixed value in the drafting function instead of being read from a configurable setting.

Impact

The documentation contradicts the contract's actual behaviour, which could mislead users about how many winners a round produces.

What the attacker needed

None

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

This is a smart contract, a program that runs on a blockchain. The documentation told users that the number of prize winners each round could be adjusted by configuration, but the code always picks exactly ten winners. Nothing is stolen here; the problem is that the written promise and the actual behaviour do not match.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by Oxrochimaru

View all

1 more disclosed report, best first.

More from Yeet

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.