Skip to content

etherfi: gate claim list by on-chain finalized+valid state - #304

Merged
sparrowDom merged 1 commit into
mainfrom
sparrowDom/etherfi-claim-onchain-filter
Jul 17, 2026
Merged

etherfi: gate claim list by on-chain finalized+valid state#304
sparrowDom merged 1 commit into
mainfrom
sparrowDom/etherfi-claim-onchain-filter

Conversation

@sparrowDom

@sparrowDom sparrowDom commented Jul 16, 2026

Copy link
Copy Markdown
Member

Problem

autoClaimEtherFiWithdraw was failing every run on mainnet with execution reverted: ERC721: invalid token ID. Example failed run

Root cause: claimableEtherFiRequests() builds the claim list purely from the ops-squid subgraph (claimable_isNull: false, claimed_isNull: true) with no on-chain check. Request 80636 was already claimed on-chain (NFT burnt, request struct deleted), but the subgraph still reported it as claimable, so claimEtherFiWithdrawals([80636]) reverted inside ownerOf(). EtherFi's isFinalized() is a pure id <= lastFinalizedRequestId comparison that stays true after a claim, so a stale request keeps coming back and wedges the action.

Fix

Gate the subgraph candidates against the EtherFi WithdrawRequestNFT before claiming — keep only requests that are isFinalized && getRequest().isValid (mirrors the existing Lido path, which already filters on isFinalized && !isClaimed). isValid is false once a request is claimed/invalidated, dropping stale ids like 80636. Skipped ids are logged.

Subgraph can report already-claimed requests as claimable, so
claimEtherFiWithdrawals reverted with "ERC721: invalid token ID".
@sparrowDom
sparrowDom merged commit ceb065d into main Jul 17, 2026
7 checks passed
@sparrowDom
sparrowDom deleted the sparrowDom/etherfi-claim-onchain-filter branch July 17, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants