Organization's rewards contract
A smart contract written in Soroban to reward members of an organization who perform meaningful tasks.
This smart contract provides an organization the ability of:
Define the reward token for the organization.
Define the custom rewards and their respective compensation.
Add members.
Revoke memberships.
Reward members according to the organization's specific rules.
Return the balance of a member who leaves the organization.
Contract workflow
Generate an admin account.
Create and initialize the stellar token. This step relies on the built-in token contract.
Note: the initialization for the token contract must be skipped if the token already exists in the stellar network.
Initialize the organization contract with your custom rewards.
Generate a signature to fund the organization's token balance using the administrator's account.
Fund the balance of the contract using the previously generated signature.
Add members to the organization.
Create a signature to enable token transfer for the accounts.
Note: a signature is required for each transfer transaction.
Reward members.
Signatures
are required to execute any functions involving calls to privileged functions of the token contract. Token Contract Interface.
Revoke membership
Approve the transaction using the token contract.
Transfer the balance to the organization by revoking the membership.
Setup
Soroban setup
For setting up your environment, visit: Soroban Setup
Contract code
Clone this GitHub repository.
Test
For testing the contract run:
Last updated