Skip to content

feat(batch_claim): settle batch claims with actual token payouts (#1198) - #1385

Closed
lienhoatienphung-svg wants to merge 1 commit into
CalloraOrg:mainfrom
lienhoatienphung-svg:feature/1198-batch-claim-token-payouts
Closed

lienhoatienphung-svg wants to merge 1 commit into
CalloraOrg:mainfrom
lienhoatienphung-svg:feature/1198-batch-claim-token-payouts

Conversation

@lienhoatienphung-svg

Copy link
Copy Markdown

Closes #1198

Summary

Wires real reward-token payouts into CalloraBatchClaim:

  1. Adds StorageKey::RewardToken, init_with_token(env, admin, reward_token), set_reward_token(env, caller, reward_token), and get_reward_token(env).
  2. Validates the entire batch upfront in batch_claim and verifies token::Client::new(&env, &token_addr).balance(&contract_addr) >= total_claimed before mutating any state (returning BatchClaimError::InsufficientBalance if underfunded).
  3. Transfers each claimant's pending_amount after marking ClaimConsumed and record.settled = true, and includes the reward token in claims_settled events.
  4. Updates contracts/batch_claim/docs/storage.md to match the contract's StorageKey layout.

Acceptance Criteria Mapping

  • Each claimant receives exactly their pending amount: Verified in test_batch_claim_transfers_reward_tokens_to_each_claimant.
  • Insufficient contract balance fails before any state change: Checked upfront before the settlement write loop; verified in test_batch_claim_insufficient_contract_balance_fails_without_state_change.
  • Events include token: init_with_token and claims_settled include the configured reward_token address.
  • Storage doc updated: Updated contracts/batch_claim/docs/storage.md.

Validation

  • cargo test -p callora-batch-claim

Payout Wallet (Base Mainnet USDC / EVM): 0x3806cd592a508d1992Ed007C2F53de251C2E7452

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.

Settle batch claims with actual token payouts

2 participants