-
Notifications
You must be signed in to change notification settings - Fork 1
Token Issuance and Distribution Model
GitToken software issues Ethereum tokens whenever a valid GitHub web hook event is received corresponding to a contribution made toward a GitHub organization.
All GitToken contracts are created with an initial supply of zero 0
tokens. Upon each valid contribution, the total supply of the tokens issued increases, relative to the contribution type and corresponding reward value.
Additionally, given special events, such as adding a new member to an organization or reaching a milestone, a reserved supply of tokens is created. The purpose of the reserve supply is to allocate a supply of tokens for auction. The auctioning of these tokens is controlled by the GitToken contract given pre-defined schedule(s). These schedules may be organized by the contributors of the project through vote, or default to the GitToken software to correspond to future events and conditions.
Consequently, the GitToken token issuance and distribution model is continuous, and therefore its supply is inflationary. Inflationary forces are strongest when the rate of supply increases faster than the real output of the per unit value. This may occur when tokens are issued for events that have not been realized or hold intangible value.
For example, issuing tokens for watch
events is probably the easiest way to earn GitToken tokens, simply click the Watch
or Star
repository buttons on a GitToken enabled GitHub repository.
This event may hold intangible value as it may represent future word of mouth marketing or other channels of connection. However, it may also become an attack surface, if the frequency of watch events is abnormally high relative to the frequency of other contribution events.
To mitigate this scenario and control the rate of token supply increase for intangible events, the GitToken default reward values of these intangible events are relatively smaller compared to events representing tangible value, like commit
, create
and pull_request
events.
For example, watch
events issue 100 tokens
by default, compared to 2500 tokens
for a pull_request
or create
event.
In the context of GitToken tokens, the purchasing power, or exchange rate, of the per unit value of the token should factor in the rate of change of the token supply.
The GitToken software does not target a rate of change in the token supply or an inflation rate. However, as a project matures, the rate of change in the token supply should become stable.
Short-terms "jumps" or "spikes" in the rate of change of the token supply may indicate changes in the projects' organization, reward values, or other meaningful events.
Tokens are issued and distributed via the rewardContributor()
and _rewardContributor()
contract methods
/**
* @dev Reward contributor when a GitHub web hook event is received
* @param _username string GitHub username of contributor
* @param _rewardType string GitHub Event Reward Type
* @param _rewardValue uint Number of tokens rewarded to contributor
* @param _reservedValue uint Number of tokens reserved for auction
* @param _deliveryID string GitHub delivery ID of web hook request
* @return bool Returns boolean value if method is called
*/
function rewardContributor(
string _username,
string _rewardType,
uint _rewardValue,
uint _reservedValue,
string _deliveryID
)
onlyOwner
public
returns (bool) {
require(gittoken._rewardContributor(_username, _rewardValue, _reservedValue, _deliveryID));
Contribution(
gittoken.contributorAddresses[_username],
_username,
_rewardType,
_rewardValue,
_reservedValue,
now
);
return true;
}
/**
* @dev Internal rewardContributor method for GitToken contract rewardContributor method
* @param self Data Use the Data struct as the contract storage and reference
* @param _username string GitHub username of contributor
* @param _rewardValue uint Number of tokens rewarded to contributor
* @param _reservedValue uint Number of tokens reserved for auction
* @param _deliveryID string GitHub delivery ID of web hook request
* @return bool Returns boolean value when called from the parent contract;
*/
function _rewardContributor (
Data storage self,
string _username,
uint _rewardValue,
uint _reservedValue,
string _deliveryID
) internal returns (bool) {
// Get the contributor Ethereum address from GitHub username
address _contributor = self.contributorAddresses[_username];
// If no value is created, then throw the transaction;
require(_rewardValue > 0 || _reservedValue > 0);
// If the GitHub web hook event ID has already occured, then throw the transaction;
require(self.receivedDelivery[_deliveryID] == false);
// Update totalSupply with the added values created, including the reserved supply for auction;
self.totalSupply = self.totalSupply.add(_rewardValue).add(_reservedValue);
// Add to the balance of reserved tokens held for auction by the contract
self.balances[address(this)] = self.balances[address(this)].add(_reservedValue);
// If the contributor is not yet verified, increase the unclaimed rewards for the user until the user verifies herself/himself;
if (_contributor == 0x0){
self.unclaimedRewards[_username] = self.unclaimedRewards[_username].add(_rewardValue);
} else {
// If the contributor's address is set, update the contributor's balance;
self.balances[_contributor] = self.balances[_contributor].add(_rewardValue);
}
// Set the received deliveries for this event to true to prevent/mitigate event replay attacks;
self.receivedDelivery[_deliveryID] = true;
// Return true to parent contract
return true;
}
The amount of tokens issued and distributed correspond to the type of contribution made to the GitHub repository.
GitToken Reward and Reserved Values May be Reviewed Here
NOTE THIS FUNCTIONALITY HAS BEEN DEPRECATED AND REWARD AND RESERVE VALUES ARE NO LONGER STORED INSIDE THE CONTRACT. REWARDS ARE NOW CALCULATED OFF-CHAIN AND VALUES ARE PROVIDED TO THE rewardContributor()
METHOD. THIS SECTION WILL BE MODIFIED IN THE NEAR FUTURE TO DISCUSS SETTING CUSTOM VALUES