This repository contains smart contract code for a decentralized application (dApp) called BitHub. Bithub is a platform that incentivizes developers to make contributions to open-source projects by rewarding them with Bithub tokens (BTH), an ERC20 token.
Bithub.sol is an ERC20 token contract that implements the standard ERC20 interface along with additional functionalities such as transferring tokens, approving spender addresses, and checking allowances.
ContributionTracker.sol is the main contract that tracks and rewards contributions made by developers to open-source projects. It includes functionalities such as recording contributions, claiming rewards, staking tokens, adjusting reward parameters, and withdrawing funds.
-
Recording Contributions: Approved contributors can record their contributions by providing the repository URL and type of contribution. Upon recording, the contributor is rewarded with Bithub tokens based on a reward tier system.
-
Claiming Rewards: Contributors can claim their accumulated rewards at any time. Once claimed, the corresponding amount of Bithub tokens is transferred to the contributor's address.
-
Staking: Users can stake their Bithub tokens in the contract to participate in governance or earn additional rewards. Staked tokens are locked in the contract until unstaked.
-
Reward Adjustment: Governors have the authority to adjust reward parameters such as base reward and bonus reward, with a cooldown period between adjustments.
-
Withdrawal of Funds: Contract owner can withdraw excess funds (excluding rewards) accumulated in the contract.
-
Deploy Contracts: Deploy
Bithub.solandContributionTracker.solcontracts on the Ethereum blockchain. -
Approve Contributors: Contract owner can approve or remove contributors by calling
approveContributorandremoveContributorfunctions. -
Record Contributions: Approved contributors can record their contributions by calling the
recordContributionfunction with the repository URL and contribution type. -
Claim Rewards: Contributors can claim their accumulated rewards by calling the
claimRewardfunction. -
Adjust Reward Parameters: Governors can adjust reward parameters using the
adjustRewardParametersfunction. -
Stake Tokens: Users can stake their Bithub tokens by calling the
stakefunction. -
Unstake Tokens: Users can unstake their tokens by calling the
unstakefunction. -
Withdraw Funds: Contract owner can withdraw excess funds by calling the
withdrawFundsfunction.