feat(contracts): Add M002 legacy seller claims - #995
Merged
Conversation
Unfreezes the deployed AntseedSellerRewardsPool after M001 activates. Claims are blocked twice today: the pool has no sellerClaimPolicy, and ANTS transfers are disabled with the pool (the transfer sender) never whitelisted. - policies/AntseedLegacySellerClaimPolicy: stateless claim policy that re-derives each seller's cumulative locked ANTS from EmissionsV2/V1 state (epochs 0..lastEpoch, mirroring claimSellerEmissions), releases releaseBps (default 1538 ~ 10/65) with optional linear vesting, and returns zero for sellers the wash-trading registry has proven (or the owner flagged). - script/migrations/M002LegacySellerClaims/Install.s.sol: keyless, idempotent install. Token owner whitelists the pool on ANTSToken (skipped when transfers are enabled or already whitelisted); pool owner deploys the policy and installs it. Guards: M001 active, pool discovered via V2, lastEpoch = gate.effectiveEpoch() - 1 >= MIGRATION_EPOCH, wash registry required with code. - scripts/deployments/m002.mjs: single install phase, signers deployer + sellerRewardsPoolOwner, states ready/active/not-applicable/invalid, records 002-legacy-seller-claims and updates current.json, finalize recovery, fork test that rehearses M001 then applies M002 on top. - m001.mjs: extract rehearseM001OnFork so later migrations can layer on an activated M001 fork; ledger.mjs gains a canonicalRoot override and only regenerates chain config from the repository ledger. - Tests: policy unit tests, M002 migration tests (frozen-before proof, release payout, wash trader NothingToClaim, resume paths, no-op rerun), runner tests for M002 classification/baseline/records. - Docs: README section, M002 runbook, .env.example, CHANGELOG.
This reverts commit f1f1b43.
…/m002-legacy-seller-claims
…/m002-legacy-seller-claims
feat(contracts): M002 legacy seller claims migration
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.
Description
Brings M002 legacy seller claims onto main. PR #982 was merged into
contracts-update-all, not main; this PR carries that implementation forward without rewriting its history and adds the two same-seller mixed-history regression tests requested in review. Main has been merged into the source branch, preserving both M002 and main's deployment tests and resolving the changelog conflict.The diff is limited to M002's policy, installer/CLI registration, tests, and existing documentation/changelog updates. The additional local mainnet-fork audit files and unrelated DIEM staker diagnostics are not included.
Release Notes
AntseedSellerRewardsPoolon ANTSToken and installs the claim policy using the respective owners.RELEASE_BPS=1000), less previous withdrawals. Repeating a claim cannot release another 10%.Review Follow-up
The new tests use one seller with both direct and locked reward epochs. They verify the exact reduced payout and replay rejection when some allowance remains, and zero payout when direct rewards already exceed the allowance. This pins down the documented conservative behavior; mixed histories remain unsupported, not newly supported.
Validation
Types of Changes
Checklist