Add txTo to Transfer entity + credit boughtCap on approved tx.to#63
Merged
Conversation
DEX aggregators (e.g. OpenOcean) may route cy-token buys through an intermediate adapter contract, so Transfer.from is the adapter rather than the aggregator itself. Under the old rule, these legitimate aggregator-routed purchases were treated as non-approved transfers, leaving the buyer with boughtCap=0 and zero reward eligibility. Add txTo / txToIsApprovedSource to the Transfer entity and use the tx-level target as a secondary approval signal. If either Transfer.from or tx.to is approved, the recipient is credited. Short-circuit to avoid redundant factory() calls: - when fromIsApprovedSource already true - when txTo is null (contract creation) - when txTo equals the cy token itself (direct token-contract call) Closes cyclofinance/cyclo.rewards#215 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
thedavidmeister
added a commit
to cyclofinance/cyclo.site
that referenced
this pull request
Apr 22, 2026
Bumps cyclo-arbitrum-one from 2025-12-30-00a4 to 2026-04-20-e5f8. The new deploy (from the April 20 matrix deploy triggered after cyclofinance/cyclo.subgraph#63 merged) includes the txTo field and the eligibleShare removal. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DEX aggregators (e.g. OpenOcean) may route cy-token buys through an intermediate adapter contract. Under the old rule, these aggregator-routed trades left the buyer with `boughtCap=0` because `Transfer.from` is the unrecognized adapter, not the aggregator.
Changes
Tests
Paired with
cyclofinance/cyclo.rewards#??? — rewards pipeline consumes the new `txTo` field.
Context
Investigation: cyclofinance/cyclo.rewards#215 — an LP with 12k cysFLR LP'd via Sparkdex but earned zero because their OpenOcean-routed cysFLR purchases went through an unrecognized intermediate.
🤖 Generated with Claude Code