Skip to content

Instantly share code, notes, and snippets.

@atvanguard
Last active November 5, 2018 01:37
Show Gist options
  • Save atvanguard/205813570838a7e4a6eac53f13e8d4e5 to your computer and use it in GitHub Desktop.
Save atvanguard/205813570838a7e4a6eac53f13e8d4e5 to your computer and use it in GitHub Desktop.
// delegations
await instance.delegateTo(accounts[2], {from: accounts[3]})
await instance.delegateTo(accounts[5], {from: accounts[6]})
await instance.delegateTo(accounts[7], {from: accounts[8]})
// V7 delegates to V5 creating a super proxy
await instance.delegateTo(accounts[5], {from: accounts[7]})
// V5 delegates their combined voting power to V4
await instance.delegateTo(accounts[4], {from: accounts[5]})
// Voting begins
await instance.vote(0, {from: accounts[1]}) // Yes
await instance.vote(1, {from: accounts[2]}) // No
await instance.vote(2, {from: accounts[4]}) // Maybe
await instance.vote(2, {from: accounts[9]})
// Voter 8 changes their delegation
await instance.delegateTo(accounts[2], {from: accounts[8]})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment