Hooks.wtf

Recipients

FlaunchOwnerRecipient.sol

FlaunchOwnerRecipient resolves the launch NFT owner when revenue is distributed. B-21 covers this behavior and the same ownership-resolution rule in NFTOwnerRecipient.

Reviewed source: src/recipients/FlaunchOwnerRecipient.sol at commit 38f14ff.

Findings

IDSeverityFinding
B-21LowOwner recipients credit whoever holds the NFT at distribution

[LOW] B-21 · Owner recipients credit whoever holds the NFT at distribution

B-21 · Low

Owner-resolving recipients read the NFT owner at payout time. A temporary holder can trigger distribution and keep the resulting escrow credit after returning the NFT.

FlaunchOwnerRecipient and NFTOwnerRecipient resolve ownerOf when a payment is distributed. They do not attribute the payment to the account that owned the NFT while the fees accrued.

If an external venue lets another account temporarily take ownership, that account can call the permissionless Flaunch.distribute while it holds the NFT. The escrow credit is then assigned to the temporary holder and survives the NFT's return.

Earlier review: F-14 remains open. The owner-at-payout behavior is unchanged.

Impact

An owner who places a fee-bearing NFT in a lending or temporary-custody venue can lose its pending fees. The path requires that external ownership transfer; the protocol does not itself provide a flash-loan venue for these NFTs. An ordinary NFT sale also transfers the practical right to trigger allocation of the pending backlog.

Affected code

Locations refer to the reviewed commit, 38f14ff.

From src/recipients/FlaunchOwnerRecipient.sol:45–57:

try IERC721(flaunch).ownerOf(_tokenId) returns (address owner) {
    // If we can find the owner, then we can set the beneficiary and update the last known owner
    beneficiary = owner;

    // Update the last known owner
    if (owner != address(0)) {
        lastKnownOwner[_tokenId] = owner;
    }
} catch {
    // If we have been unable to find the owner, then we will need still allow processing, however we
    // will reference the last known owner if available.
    beneficiary = lastKnownOwner[_tokenId];
}

Proof of concept

The source review checked both recipient functions at the reviewed commit. Its reproduction is pseudocode:

borrow the fee-bearing NFT from a venue that transfers ownership
call Flaunch.distribute while holding it
return the NFT
claim the escrow credit assigned to the temporary holder

There is no executable Foundry proof for this finding. Building one would require supplying an external lending venue that is not part of the repository. The evidence establishes payout-time ownership resolution; exploitability through a particular venue depends on that venue's transfer rules.

Document that the current holder can claim all pending revenue, and advise owners against placing these NFTs in venues that temporarily transfer ownership. If historical ownership is meant to determine entitlement, introduce explicit accounting for it rather than resolving only the owner at distribution time.

Previous
StakingRecipient.sol