Smart Rewards System
The Smart Rewards System is comprised of several key components:
Components
Smart Rewards Distributor Contract
This smart contract manages the on-chain portion of Smart Rewards processes. It handles campaign registration and management, updates the root hash for the published rewards, and holds and distributes funds. Additionally, the contract manages approved reward tokens, handles user claims, and manages campaign discounts for certain users.
Distribution Bundles
Distribution bundles contain the logic to determine which addresses should be credited to receive the campaign's rewards. These WebAssembly bundles are stored on IPFS and are responsible for fetching the required data, processing it, and determining the correct amount of rewards to be distributed amongst users. Each campaign has one distribution bundle, which is run frequently when the campaign is active to provide the latest results of user allocations. The same distribution bundle can be used for multiple campaigns, and the results of the bundles are checked to ensure they are not over-allocating rewards.
Distribution Scheduler
Steer's Distribution Scheduler is the process that frequently runs the distribution bundles and aggregates the results as pending rewards. This component ensures that reward calculations are kept up-to-date throughout the duration of active campaigns.
Reward Publishing Web3 Function
The Reward Publishing process utilizes Steer's existing web3 functions to reliably post updated claims on-chain. This process combines pending rewards with any existing rewards and creates a hash tree of the various claims. The root hash is then updated on the smart rewards distributor contract. After this update, users can claim the latest rewards through the contract by submitting proofs of their claims, ensuring a secure and verifiable reward distribution system.