Skip to content

feat(contracts): Add M002 legacy seller claims - #995

Merged
kotevcode merged 14 commits into
mainfrom
contracts-update-all
Sep 8, 2026
Merged

feat(contracts): Add M002 legacy seller claims#995
kotevcode merged 14 commits into
mainfrom
contracts-update-all

Conversation

@kotevcode

Copy link
Copy Markdown
Contributor

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

  • After M001 activation, M002 whitelists AntseedSellerRewardsPool on ANTSToken and installs the claim policy using the respective owners.
  • Eligible sellers can withdraw a cumulative 10% of their locked legacy rewards (default RELEASE_BPS=1000), less previous withdrawals. Repeating a claim cannot release another 10%.
  • Sellers flagged by the immutable wash-trading registry receive zero. No vesting, manual owner flags, or policy setters.
  • Unclaimed legacy emissions do not count until claimed through V2; later deposits release only the additional allowance.
  • DIEM's zero locked balance prevents any pool claim despite its historical direct payouts.
  • Existing CHANGELOG entries describe the user-facing migration.

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

  • 35 focused Solidity policy/migration tests passed, including both new regressions.
  • 89 deployment CLI tests passed after integrating current main.
  • Deployment records validated for Base mainnet and Base Sepolia.
  • Formatting and whitespace checks passed for the added tests.
  • Previous contract-level mainnet-fork validation of the same production policy covered 201 sellers, 644 late seller/epoch claims, real wash-registry exclusions, and DIEM pool isolation. Those fork fixtures/tests remain local and are not included here.
  • This is not a claim of a fresh full-repository test run or a completed end-to-end mainnet deployment-CLI rehearsal. Rehearse and dry-run against the active M001 state before broadcasting; no deployment is performed by this PR.

Types of Changes

  • New feature (non-breaking change that adds functionality)
  • Chore (additional regression tests)
  • Breaking change

Checklist

  • Necessary documentation and CHANGELOG entries included
  • Tests added for review feedback
  • Focused unit/migration and deployment CLI tests pass
  • End-to-end deployment-CLI rehearsal against current mainnet state

alexanderludwig and others added 14 commits September 3, 2026 15:22
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.
feat(contracts): M002 legacy seller claims migration
@kotevcode
kotevcode merged commit 1bd3486 into main Sep 8, 2026
4 checks passed
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