Skip to content

Token Issuance and Distribution Model

Ryan Tate edited this page Jul 29, 2017 · 24 revisions

GitToken software issues Ethereum tokens whenever a valid GitHub web hook event is received, corresponding to a contribution made toward a GitHub organization.

Token Supply & Inflation

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.

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 what the per unit value represents.

Token Distribution

Tokens are issued and distributed via the rewardContributor() and _rewardContributor() contract methods

function rewardContributor(
  string _username,
  string _rewardType,
  uint _rewardBonus,
  uint _reservedValue,
  string _deliveryID
) onlyOwner public returns (bool) {
  if(!gittoken._rewardContributor(
    _username,
    _rewardType,
    _rewardBonus,
    _reservedValue,
    _deliveryID
  )) {
    throw;
  } else {
    address _contributor = gittoken.contributorAddresses[_username];
    uint _value = gittoken.rewardValues[_rewardType].add(_rewardBonus);
    Contribution(_contributor, _username, _value, _reservedValue, now, _rewardType);
    return true;
  }
}
function _rewardContributor (
  Data storage self,
  string _username,
  string _rewardType,
  uint _rewardBonus,
  uint _reservedValue,
  string _deliveryID
) internal returns (bool) {
  uint _value = self.rewardValues[_rewardType].add(_rewardBonus);
  address _contributor = self.contributorAddresses[_username];

  if(_value == 0) {
    throw;
  } else if (self.receivedDelivery[_deliveryID] == true) {
    throw;
  } else {
    self.totalSupply = self.totalSupply.add(_value).add(_reservedValue);
    self.balances[address(this)] = self.balances[address(this)].add(_reservedValue);

    if (_contributor == 0x0){
      self.unclaimedRewards[_username] = self.unclaimedRewards[_username].add(_value);
    } else {
      self.balances[_contributor] = self.balances[_contributor].add(_value);
    }

    self.receivedDelivery[_deliveryID] = true;
    return true;
  }
}

The amount of tokens issued and distributed corresponds to the type of contribution made to the GitHub repository. The following table provides the default token reward values that are associated with each GitHub web hook event.

NOTE: The following reward values are subject to change; We are still modeling token distributions and running simulated and live tests. Please refer to the GitToken.sol contract for the current default values.

Event Reward Value Description
* 0 Any time any event is triggered
commit_comment 250 Any time a Commit is commented on.
create 2500 Any time a Branch or Tag is created.
delete 0 Any time a Branch or Tag is deleted.
deployment 5000 Any time a Repository has a new deployment created from the API.
deployment_status 100 Any time a deployment for a Repository has a status update from the API.
fork 5000 Any time a Repository is forked.
gollum 100 Any time a Wiki page is updated.
installation 250 Any time a GitHub App is installed or uninstalled.
installation_repositories 1000 Any time a repository is added or removed from an installation.
issue_comment 250 Any time a comment on an issue is created, edited, or deleted.
issues 500 Any time an Issue is assigned, unassigned, labeled, unlabeled, opened, edited, milestoned, demilestoned, closed, or reopened.
label 100 Any time a Label is created, edited, or deleted.
marketplace_purchase 0 Any time a user purchases, cancels, or changes their GitHub Marketplace plan.
member 1000 Any time a User is added or removed as a collaborator to a Repository, or has their permissions modified.
membership 1000 Any time a User is added or removed from a team. Organization hooks only.
milestone 15000 Any time a Milestone is created, closed, opened, edited, or deleted.
organization 1000 Any time a user is added, removed, or invited to an Organization. Organization hooks only.
org_block 0 Any time an organization blocks or unblocks a user. Organization hooks only.
page_build 500 Any time a Pages site is built or results in a failed build.
ping 2500 Any time a web hook is configured.
project_card 250 Any time a Project Card is created, edited, moved, converted to an issue, or deleted.
project_column 50 Any time a Project Column is created, edited, moved, or deleted.
project 1000 Any time a Project is created, edited, closed, reopened, or deleted.
public 10000 Any time a Repository changes from private to public.
pull_request_review_comment 250 Any time a comment on a pull request's unified diff is created, edited, or deleted (in the Files Changed tab).
pull_request_review 100 Any time a pull request review is submitted, edited, or dismissed.
pull_request 1000 Any time a pull request is assigned, unassigned, labeled, unlabeled, opened, edited, closed, reopened, or synchronized (updated due to a new push in the branch that the pull request is tracking). Also any time a pull request review is requested, or a review request is removed.
push 1000 Any Git push to a Repository, including editing tags or branches. Commits via API actions that update references are also counted. This is the default event.
repository 2500 Any time a Repository is created, deleted (organization hooks only), made public, or made private.
release 5000 Any time a Release is published in a Repository.
status 200 Any time a Repository has a status update from the API
team 2000 Any time a team is created, deleted, modified, or added to or removed from a repository. Organization hooks only
team_add 2000 Any time a team is added or modified on a Repository.
watch 100 Any time a User stars a Repository.
Clone this wiki locally