Skip to content

Testing All Possible Events in a TCR

Eddy Muñoz edited this page Mar 10, 2018 · 9 revisions

Below are a list of all possible events that can happen amongst applicants, challengers, and voters both in registry listings and in governance interactions:

W1 = Wallet 1 = Applicant Wallet

W2 = Wallet 2 = Challenger Wallet

W3 = Wallet 3 = Support–Vote Wallet

W4 = Wallet 4 = Oppose–Vote Wallet

dispensationPct = 50%

voteQuorum = 50%

Events within the registry

Event 1

Unchallenged Application

  1. W1 applies foo.com into the registry
  2. foo.com goes unchallenged and is admitted into the registry
  3. W1 now has the ability to:
    • Stake more token into the foo.com
    • Withdraw token from foo.com's stake
    • Withdraw foo.com from the registry and withdraw all tokens staked with foo.com

Event 2

No Vote Challenge

  1. W1 applies foo.com into the registry
  2. W2 challenges foo.com from the registry
  3. In voting, nobody votes on foo.com, and tie goes to the challenger
  4. W2 wins 100% of the minDeposit used by W1 to apply foo.com

Event 3

Supporting Votes

  1. W1 applies foo.com into the registry
  2. W2 challenges foo.com from the registry
  3. W3 commits and reveals 1 vote to SUPPORT
  4. Once voting ends, foo.com is admitted into the registry
    • W1 wins 50% of W2's minDeposit used to challenge foo.com
    • W2 loses 100% of minDeposit tokens staked to challenge foo.com
    • W3 wins the remaining 50% of W2's minDeposit token & calls withdrawVotingRights to have the token used to vote returned to it
  5. W1 now has the ability to:
    • Stake more token into the foo.com
    • Withdraw token from foo.com's stake
    • Withdraw foo.com from the registry and withdraw all tokens staked with foo.com

Event 4

Majority Wins

  1. W1 applies foo.com into the registry
  2. W2 challenges foo.com from the registry
  3. W3 commits 2 token votes to SUPPORT
  4. W4 commits 1 token vote to OPPOSE
  5. W3 reveals its 2 token votes to SUPPORT
  6. W4 reveals its 1 token vote to OPPOSE
  7. Once voting ends, foo.com is admitted into the registry
    • W1 wins 50% of W2's minDeposit used to challenge foo.com
    • W2 loses 100% of minDeposit tokens staked to challenge foo.com
    • W3 wins the remaining 50% of W2's minDeposit token & calls withdrawVotingRights to have the 2 tokens used to vote returned to the wallet
    • W4 calls withdrawVotingRights to have the 1 token used to vote returned
  8. W1 now has the ability to:
    • Stake more token into the foo.com
    • Withdraw token from foo.com's stake
    • Withdraw foo.com from the registry and withdraw all tokens staked with foo.com

Event 5

Unrevealed Votes

  1. W1 applies foo.com into the registry
  2. W2 challenges foo.com from the registry
  3. W3 commits 1 token vote to SUPPORT
  4. W4 commits 1 token vote to OPPOSE
  5. W3 reveals its 1 vote to SUPPORT
  6. W4 fails to reveal its 1 token vote to OPPOSE
  7. Once voting ends, foo.com is admitted into the registry
    • W1 wins 50% of W2's minDeposit used to challenge foo.com
    • W2 loses 100% of minDeposit tokens staked to challenge foo.com
    • W3 wins the remaining 50% of W2's minDeposit token & calls withdrawVotingRights to have the 1 token used to vote returned to the wallet
    • W4 has to call rescueTokens to withdraw the committed 1 token vote
  8. W1 now has the ability to:
    • Stake more token into the foo.com
    • Withdraw token from foo.com's stake
    • Withdraw foo.com from the registry and withdraw all tokens staked with foo.com