Skip to content
DoS Audit finding Beginner

_payoutToken[s]() is not compatible with tokens with missing return value

The payout functions call ERC20 transfer inside a require statement that expects a boolean return value. For tokens that do not return a boolean, the transfer reverts even when successful, so payouts are blocked and tokens remain stuck in the contract.

d3e4 Follow

Originally disclosed on Code4rena

Submitted by d3e4, also found by 141345, 2997ms, ballx, Bnke0x0, brgltd, brgltd, cccz, cccz, chaduke, d3e4, Dinesh11G, Jeiwan, joestakey, Lambda, martin, pashov, RedOneN, Trust, V_B, and vv7

PA1D.sol#L317 PA1D.sol#L340

Payout is blocked and tokens are stuck in contract.

Proof of Concept

PA1D._payoutToken() and PA1D._payoutTokens() call ERC20.transfer() in a require-statement to send tokens to a list of payout recipients. Some tokens do not return a bool (e.g. USDT, BNB, OMG) on ERC20 methods. But since the require-statement expects a bool, for such a token a void return will also cause a revert, despite an otherwise successful transfer. That is, the token payout will always revert for such tokens.

Recommended Mitigation Steps

Use OpenZeppelin’s SafeERC20, which handles the return value check as well as non-standard-compliant tokens.

alexanderattar (Holograph) commented:

Low priority, but can be updated to ensure compatibility with all ERC20 tokens.

alexanderattar (Holograph) linked a PR:

Feature/holo 612 royalty smart contract improvements


The original report as published on Code4rena, by d3e4. 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

The code assumes every ERC20 token returns a boolean from transfer, but some widely used tokens return nothing, causing the require check to revert.

Impact

Payouts for tokens with a missing return value always revert, leaving the tokens stuck in the contract.

What the attacker needed

Payout token lacks a boolean return value

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.

Some older tokens, such as USDT, do not send back a yes/no answer when you ask them to transfer money. The contract insists on getting that answer, so it treats a successful transfer as a failure and cancels the whole payout. As a result, the money stays trapped in the contract.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by d3e4

View all

19 more disclosed reports, best first.

More from Holograph contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.