A minimal, production-oriented reward distributor that pays users based on a Merkle root of cumulative entitlements. Admins update the root; users claim the delta since their last claim. Includes a simple Merkle helper module and tests.
reward_distribution::merkle_tree— Merkle helpers (hashing, proof verification).reward_distribution::merkle_tree_distribution— Core distributor (vault, admin, claim logic). This module is under development. A root challenge period is planned, allowing challengers to dispute a submitted root within a configurable window.
update_root(admin, new_root)— Set the active Merkle root.deposit(account, amount)— Fund the vault (SupraCoin).withdraw(owner, withdrawal_address, amount)— Owner withdraws vault funds.claim_rewards(_caller, user, entitled_cumulative, proof)— Paysentitled_cumulative - already_claimed(user).
- leaf = sha2_256( bcs::to_bytes(user: address) || bcs::to_bytes(entitled_cumulative: u64) )
sources/— Move modulestests/— Move testsmerkle_script/— JS utilities (hashing/merkle helpers; see src/utils/*)
- Coin type:
supra_framework::supra_coin::SupraCoin. - Configure the
reward_distribution addressinMove.tomlbefore publishing. - Access control:
ownercan setadmin; onlyadmincan update_root.