RunBro is a decentralized platform that rewards users for their physical activity by integrating the Google Fit API with a unique reward model. Users can buy and sell fitness-related items (such as shoes) while earning native tokens (RBT) based on their steps.
Key Technologies and Tools
Chainlink
Chainlink's decentralized oracle network provides reliable and secure data feeds and automation for our platform:
Chainlink Functions: Our GetStepsAPI contract uses Chainlink Functions to fetch daily step count data from external APIs, ensuring accurate and tamper-proof data.
Chainlink Automation: We leverage Chainlink Automation to manage periodic tasks such as reward distribution and slot management in our WethRegistry contract.
Automation upkepp tx - 0x2eee18e433c25ae0944b50315d33ebe922f2aee14d13f0ce85b3d4b8d0e6a41a
chainlink function subscriptio id - 3371
OpenZeppelin
We utilize OpenZeppelin's robust and secure libraries to implement key features in our smart contracts:
ERC20: Our RunBroToken is built using OpenZeppelin's ERC20 standard, ensuring compatibility and security. Ownable: We use the Ownable module to manage ownership and access control in our contracts.
ERC20Permit and ERC20Votes: These extensions add permit functionality and voting capabilities to our tokens, enhancing their utility and governance.
General Flow
Sequence User and Seller Registration
Users and sellers register on the platform, providing necessary details and undergoing KYC verification for sellers. Listing Shoes
Sellers list shoes on the marketplace, specifying details such as name, brand, cost, and quantity. Purchasing Shoes
Registered users can purchase listed shoes. Funds are held in escrow until the transaction is confirmed by both parties. Fetching Steps Data
Users fetch their daily steps data from an external API using the GetStepsAPI contract. This data is stored and used for reward distribution. Reward Distribution
Based on the steps data, users are rewarded with RunBroTokens. The reward distribution occurs daily at a specified time. Transaction Confirmation
Both buyers and sellers confirm the transaction. Once confirmed, funds are released from escrow to the seller. Claiming Rewards
Users who have purchased a certain number of shoes can claim additional RunBroTokens as rewards. Slot Management and Reward Distribution
The WethRegistry contract manages user slots and distributes rewards based on the reserve balance using Chainlink Automation. Reward Calculation and Distribution
The WethReward contract calculates and distributes rewards based on user activity and steps data. Contract Deployment
The DeployContracts script deploys and initializes all necessary contracts, including setting up DAO roles and permissions.
- Proposal System: DAO members can propose new sellers for registration on the platform. Proposals go through a voting process to determine whether the seller is approved.
- Voting System: DAO members can cast their votes either in favor of or against a proposal. The result of the vote will decide if the user gets registered.
- Registration: Once a proposal passes, the user is registered as a seller on the platform.