Skip to content
Audit finding Beginner

Over assignment of payable in claimairdropdistribution function could cause confusion regarding native token handling

The claimAirdropDistribution function casts the contract's own address to a payable type when calling an external claim function whose interface declares the recipient as a plain address. This mismatch does not enable an exploit but could mislead integrators into thinking the contract expects to receive native tokens.

Pig46940 Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#55174 [SC-Insight] over assignment of payable in claimairdropdistribution function could cause confusion regarding native token handling

Submitted on Sep 23rd 2025 at 18:43:20 UTC by @Pig46940 for Mitigation Audit | Flare | FAssets

Description

Brief / Intro

The claimAirdropDistribution function casts address(this) to address payable when calling _distribution.claim, even though the _recipient parameter in IDistributionToDelegators is defined as a non-payable address. This mismatch is unnecessary and may cause confusion about whether the distribution contract expects to receive native tokens.

Vulnerability Details

IDistributionToDelegators.claim is specified as:

Solidity
function claim(
    address _rewardOwner,
    address _recipient,
    uint256 _month,
    bool _wrap
) external returns (
    uint256 _rewardAmount
);
  • _rewardOwner: address of the reward owner
  • _recipient: address to transfer funds to (non-payable address)
  • _month: last month to claim for
  • _wrap: should reward be wrapped immediately

In CollateralPool.sol, the implementation uses an unnecessary payable cast:

Solidity
function claimAirdropDistribution(
    IDistributionToDelegators _distribution,
    uint256 _month
)
    external
    onlyAgent
    nonReentrant
    returns(uint256)
{
    uint256 balanceBefore = wNat.balanceOf(address(this));
   // This does not match the `IDistributionToDelegators` interface definition.
    _distribution.claim(address(this), payable(address(this)), _month, true);
    uint256 balanceAfter = wNat.balanceOf(address(this));
    uint256 claimed = balanceAfter - balanceBefore;
    totalCollateral += claimed;
    emit ClaimedReward(claimed, 0);
    return claimed;
}

Because the interface expects a non-payable address for _recipient, casting address(this) to address payable is unnecessary and may mislead developers.

Note that a different interface, RewardsV2Interface, defines _recipient as address payable, which may further add to confusion when comparing different claim functions:

Solidity
function claim(
    address _rewardOwner,
    address payable _recipient,
    uint24 _rewardEpochId,
    bool _wrap,
    struct RewardsV2Interface.RewardClaimWithProof[] _proofs
) external returns (
    uint256 _rewardAmountWei
);

Example of matching use elsewhere in the codebase:

Solidity
function claimDelegationRewards(
    IRewardManager _rewardManager,
    uint24 _lastRewardEpoch,
    IRewardManager.RewardClaimWithProof[] calldata _proofs
)
    external
    onlyAgent
    nonReentrant
    returns (uint256)
{
    uint256 balanceBefore = wNat.balanceOf(address(this));
    // This matches with the official documentation.
    _rewardManager.claim(address(this), payable(address(this)), _lastRewardEpoch, true, _proofs);
    uint256 balanceAfter = wNat.balanceOf(address(this));
    uint256 claimed = balanceAfter - balanceBefore;
    totalCollateral += claimed;
    emit ClaimedReward(claimed, 1);
    return claimed;
}

Impact Details

Integrators or developers interacting with the Flare Fasset system may be confused by the discrepancy between the interface documentation and the implementation. Specifically, _recipient in IDistributionToDelegators.claim is defined as a non-payable address, but the contract casts it to address payable. This may lead integrators to incorrectly assume that the contract can receive native FLR, potentially causing misunderstandings in contract usage, reward claiming logic, or security assumptions.

References

Proof of Concept

<details> <summary>Proof of Concept — Removing the `payable` cast (click to expand)</summary>
  • Deleted the payable cast in the claimAirdropDistribution function in CollateralPool.sol. Tests still pass after removing the payable() cast.

Modified function:

Solidity
function claimAirdropDistribution(
    IDistributionToDelegators _distribution,
    uint256 _month
)
    external
    onlyAgent
    nonReentrant
    returns(uint256)
{
    uint256 balanceBefore = wNat.balanceOf(address(this));
    _distribution.claim(address(this), address(this), _month, true);
    uint256 balanceAfter = wNat.balanceOf(address(this));
    uint256 claimed = balanceAfter - balanceBefore;
    totalCollateral += claimed;
    emit ClaimedReward(claimed, 0);
    return claimed;
}

Commands used to run tests:

$ yarn c
$ yarn hardhat test ./test/unit/collateralPool/CollateralPool.ts
</details>

Notes / Recommendation

  • Remove the unnecessary payable cast to match the IDistributionToDelegators interface and avoid misleading consumers of the contract.
  • Ensure consistent parameter types across similar claim interfaces (or clearly document differences) to reduce potential confusion.

The original report as published on Immunefi, by Pig46940. 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 an unnecessary payable cast that does not match the non-payable recipient parameter declared in the called interface.

Impact

No direct exploit is shown; the risk is that integrators may wrongly assume the contract can receive native FLR, leading to misunderstandings about reward claiming or security assumptions.

What the attacker needed

None

The fix

The unnecessary payable cast should be removed so the call matches the interface, and parameter types across similar claim interfaces should be made consistent or clearly documented.

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.

In Solidity, an address marked 'payable' is one that is allowed to receive the network's native currency. Here the code marks its own address as payable even though the function it calls does not ask for that, which is harmless but confusing. The report is about clarity and consistency, not a way to steal funds.

More by Pig46940

View all

25 more disclosed reports, best first.

More from Flare | FAssets

View all

The newest disclosed reports for this program.

Similar reports

Same bug class and techniques, clearest first.