Skip to content
Business logic Audit finding Intermediate

Inconsistent behavior for canary claims in the claimer

The claimer contract calculates fees per claim using only the standard prize pool claim count, ignoring canary claims. This inconsistency could lead to incorrect fee calculations for canary claims.

volodya Follow

Originally disclosed on Code4rena

Submitted by volodya

Proof of Concept

Whenever a claimer claims prizes they compute fees per claim without considering canary claims.

  function claimPrizes(
    Vault vault,
    uint8 tier,
    address[] calldata winners,
    uint32[][] calldata prizeIndices,
    address _feeRecipient
  ) external returns (uint256 totalFees) {
    uint256 claimCount;
    for (uint i = 0; i < winners.length; i++) {
      claimCount += prizeIndices[i].length;
    }

    uint96 feePerClaim = uint96(
      _computeFeePerClaim(
        _computeMaxFee(tier, prizePool.numberOfTiers()),
        claimCount,
        prizePool.claimCount()
      )
    );

    vault.claimPrizes(tier, winners, prizeIndices, feePerClaim, _feeRecipient);

    return feePerClaim * claimCount;
  }

src/Claimer.sol#L76

Recommended Mitigation Steps

Consider canary as a claim.

    uint96 feePerClaim = uint96(
      _computeFeePerClaim(
        _computeMaxFee(tier, prizePool.numberOfTiers()),
        claimCount,
-        prizePool.claimCount()
+        prizePool.claimCount() + prizePool.canaryClaimCount()
      )
    );

Assessed type

Error

asselstine (PoolTogether) confirmed

PoolTogether mitigated:

Unified standard and canary tier. PR: https://github.com/GenerationSoftware/pt-v5-prize-pool/pull/17

Status: Mitigation confirmed. Full details in report from rvierdiiev, dirk_y and 0xStalin.


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

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 fee calculation uses only the standard claim count and omits the canary claim count, causing inconsistent fee computation.

Impact

The fee per claim may be calculated incorrectly for canary claims, potentially leading to over- or under-charging of fees.

What the attacker needed

None

The fix

The fee calculation should include the canary claim count by adding `prizePool.canaryClaimCount()` to the claim count.

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.

A smart contract that pays out prizes calculates a fee for each claim based on how many claims have been made. It forgot to include a special type of claim called a canary claim, so the fee might be wrong for those.

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 volodya

View all

11 more disclosed reports, best first.

More from PoolTogether

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.