Skip to main content

Smart Reward Claims

Steer's smart reward platform provides an efficient and user-friendly system for distributing and claiming rewards. This document outlines the process of aggregating claims, publishing reward data, and the mechanism for users to claim their rewards.

Reward Aggregation and Publishing

  1. Campaign Reward Updates: Each active reward campaign's distribution bundle is executed to get the updated claims. These claims are stored as pending (not available for withdrawal).
  2. Aggregation: The Steer Nodes routinely aggregates all new claims and existing claims to get the updated published claims.
  3. Merkle Tree Generation: The total list of users and their available token claims is processed into a merkle tree.
  4. On-chain Publishing: The root hash of the merkle tree is pushed on-chain, representing the current state of all user claims. Updated rewards are now available for claiming.

User Experience

  • Users can frequently claim rewards as they become available with each update.
  • Steer continuously runs distribution bundles, allowing users to see their earned rewards in near real-time.
  • The UI provides a live feed of earnings, which are then made claimable.

Claiming Process

When a user wishes to claim their rewards on-chain, they interact with the Smart Rewards Distributor Contract.

Claim Function

/// @dev Allows claiming tokens if hash made from address and amount is part of the merkle tree
/// @param users the array of users to claim for, msg.sender must have permissions
/// @param amounts the amounts for each token earned by claimee. Note that this includes previously claimed tokens.
/// @param campaignIds the campaigns the claims belong to, a way to track token flows per campaign
/// @param proofs merkle proofs to prove the token addresses and amounts for the user are in tree
function claim(
address[] calldata users,
uint256[] calldata campaignIds,
uint256[] calldata amounts,
bytes32[][] calldata proofs
) external;

Claiming Process

  1. The user initiates a claim through the UI.
  2. The UI generates the necessary proofs from the published rewards data.
  3. The claim function is called with the required parameters:
    • users: Array of user addresses to claim for
    • campaignIds: IDs of the campaigns the claims belong to
    • amounts: Token amounts earned by each claimee (including previously claimed tokens)
    • proofs: Merkle proofs to verify the claims

Security and Verification

  • The merkle tree root is generated and published on-chain by Steer's decentralized nodes.
  • The smart contract verifies the provided proofs against the on-chain merkle root to ensure the validity of each claim.

Benefits

  1. Efficiency: Merkle trees allow for efficient verification of large sets of data.
  2. Frequent Updates: Users can claim rewards more frequently as new data is published.
  3. Transparency: All claim data is verifiable on-chain.
  4. Flexibility: The system can handle multiple campaigns and users in a single transaction.

By leveraging merkle trees and smart contract technology, Steer's Smart Reward Claims system provides a secure, efficient, and user-friendly method for distributing and claiming rewards across various campaigns.