O slideshow foi denunciado.

Onchain Decentralized Governance.pptx

1

Compartilhar

1 de 24
1 de 24

Onchain Decentralized Governance.pptx

1

Compartilhar

Baixar para ler offline

Descrição

Looks into different DAO governance frameworks and tools. Deep dive into Solidity example of proposal voting contract

Transcrição

  1. 1. DECENTRALIZED GOVERNANCE Smart Contracts that power Decentralized On- chain Governance Gene Leybzon 4/7/2022
  2. 2. DISCLAIMER § The views and opinions expressed by the Presenter are those of the Presenter. § Presentation is not intended as legal or financial advice and may not be used as legal or financial advice. § Every effort has been made to assure this information is up-to-date as of the date of publication.
  3. 3. PLAN FOR TODAY 1.DAO and Decentralized Governance 2.Smart Contracts for Decentralized Governance
  4. 4. DEFINING DAO “A decentralized autonomous organization (DAO), sometimes called a decentralized autonomous corporation (DAC), is an organization represented by rules encoded as a computer program that is transparent, controlled by the organization members and not influenced by a central government, in other words they are member-owned communities without centralized leadership.” - Wikipedia • DAOs often use blockchain technology to provide a secure digital ledger to track digital interactions • DAO governance is coordinated using tokens or NFTs that grant voting powers • DAOs can be subject to coups or hostile takeovers that upend their voting structures especially if the voting power is based upon the number of tokens one owns
  5. 5. DECENTRALIZED GOVERNANCE Decentralized Governance frameworks for managing collective action and common resources rules of decentralized organizations are primarily enforced by code, rather than the legal system often use direct voting Benefits: • Gives power directly to token holders • Eliminates some risks of censorship, manipulation, bribery • Reduce reliance on external legal frameworks and systems • Helps to align interests with group goals • Greater autonomy • Efficiency of decision making • Improved transparency
  6. 6. GOVERNANCE BY VOTING On Chain More secure No trusted third party is required to count or enact votes Passed proposals can be executed automatically Works well for approving protocol changes or other high-risk votes Reduces risk of vote tampering Off Chain Votes are not submitted as blockchain transactions No transaction fees are necessary for off chain votes More participation, particularly from smaller holders and wider community Off chain votes can be recorded via decentralized data storage systems, reducing risk of vote tampering Works well for sentiment polls or other low risk votes
  7. 7. NOTABLE DAOS Name Token Use cases Network Launch Status Dash DASH Governance, fund allocation [24] Dash (cryptocurrency) May 2015[25] Operational since 2015[26][27][28] The DAO DAO Venture capital Ethereum April 2016 Defunct late 2016 due to hack[29] Augur REP Prediction market, Sports betting, Option (finance), Insurance Ethereum July 2018 Operational Steem STEEM Data distribution, Social media, Name services, Industrial Steem March 2016 Operational Uniswap UNI Exchange, Automated Market Making Ethereum November 2018 Operational[30] ConstitutionDAO PEOPLE Purchasing an original copy of the Constitution of the United States Ethereum November 2021[31] Defunct[32]
  8. 8. IS IT LEGAL?
  9. 9. EXAMPLE OF VOTING PROPOSAL FLOW
  10. 10. MAKER GOVERNANCE EXPERIENCE (DAI STABLECOIN)
  11. 11. APPROACHES FOR DAO GOVERNANCE No-Code DAO Stack Aragon Colony DAOHaus xDAO Snapshot Coding Solutions Zodiac Tally Gnosis Safe Openzeppelin
  12. 12. TALLY.XYZ VOTING EXPERIENCE (DEMO)
  13. 13. TALLY.XYZ VOTE STATISTICS
  14. 14. ADDING YOUR DAO TO TALLY.XYZ
  15. 15. MAJOR GOVERNANCE FRAMEWORKS AND APPROACHES On-chain voting Off-chain Voting Vote delegation Protocols Compound Governor ✓ ✓ COMP voting OpenZeppelin Governor ✓ ✓ Many Curve Voting Escrow ✓ ✓ Curve Finance mStable Multisigs ✓ Synthetix Yearn Finance Sushiswap Snapshot Polls ✓ Balancer Sushiswap Yearn Finance
  16. 16. TALLY.XYZ SUPPORTED PROTOCOLS Compound (COMP) Uniswap (UNI) Indexed Finance (NDX) PoolTogether (POOL) Radicle (RAD) Idle Finance (IDLE) Inverse Finance (INV) Unslashed Finance (USF) …
  17. 17. BALLOT CONTRACT 1/6 // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; /// @title Voting with delegation. contract Ballot { struct Voter { uint weight; // weight is accumulated by delegation bool voted; // if true, that person already voted address delegate; // person delegated to uint vote; // index of the voted proposal } // This is a type for a single proposal. struct Proposal { bytes32 name; // short name (up to 32 bytes) uint voteCount; // number of accumulated votes }
  18. 18. BALLOT CONTRACT 2/6 constructor(bytes32[] memory proposalNames) { chairperson = msg.sender; voters[chairperson].weight = 1; // For each of the provided proposal names, // create a new proposal object and add it // to the end of the array. for (uint i = 0; i < proposalNames.length; i++) { // `Proposal({...})` creates a temporary // Proposal object and `proposals.push(...)` // appends it to the end of `proposals`. proposals.push(Proposal({ name: proposalNames[i], voteCount: 0 })); } }
  19. 19. BALLOT CONTRACT 3/6 function giveRightToVote(address voter) external { require( msg.sender == chairperson, "Only chairperson can give right to vote." ); require( !voters[voter].voted, "The voter already voted." ); require(voters[voter].weight == 0); voters[voter].weight = 1; }
  20. 20. BALLOT CONTRACT 4/6 /// Delegate your vote to the voter `to`. function delegate(address to) external { // assigns reference Voter storage sender = voters[msg.sender]; require(!sender.voted, "You already voted."); require(to != msg.sender, "Self-delegation is disallowed."); while (voters[to].delegate != address(0)) { to = voters[to].delegate; // We found a loop in the delegation, not allowed. require(to != msg.sender, "Found loop in delegation."); } // Since `sender` is a reference, this // modifies `voters[msg.sender].voted` Voter storage delegate_ = voters[to]; // Voters cannot delegate to wallets that cannot vote. require(delegate_.weight >= 1); sender.voted = true; sender.delegate = to; if (delegate_.voted) { // If the delegate already voted, // directly add to the number of votes proposals[delegate_.vote].voteCount += sender.weight; } else { // If the delegate did not vote yet, // add to her weight. delegate_.weight += sender.weight; } }
  21. 21. BALLOT CONTRACT 5/6 function vote(uint proposal) external { Voter storage sender = voters[msg.sender]; require(sender.weight != 0, "Has no right to vote"); require(!sender.voted, "Already voted."); sender.voted = true; sender.vote = proposal; // If `proposal` is out of the range of the array, // this will throw automatically and revert all // changes. proposals[proposal].voteCount += sender.weight; }
  22. 22. BALLOT CONTRACT 6/6 function winnerName() external view returns (bytes32 winnerName_) { winnerName_ = proposals[winningProposal()].name; }
  23. 23. NEXT STEPS (AGENDA FOR OUR MEETUP NEXT MONTH) Governor Bravo OpenZeppelin
  24. 24. ABOUT PRESENTER Gene Leybzon https://www.linkedin.com/in/leybzon/ https://www.meetup.com/members/90 74420/ https://www.leybzon.com https://clarity.fm/geneleybzon

Descrição

Looks into different DAO governance frameworks and tools. Deep dive into Solidity example of proposal voting contract

Transcrição

  1. 1. DECENTRALIZED GOVERNANCE Smart Contracts that power Decentralized On- chain Governance Gene Leybzon 4/7/2022
  2. 2. DISCLAIMER § The views and opinions expressed by the Presenter are those of the Presenter. § Presentation is not intended as legal or financial advice and may not be used as legal or financial advice. § Every effort has been made to assure this information is up-to-date as of the date of publication.
  3. 3. PLAN FOR TODAY 1.DAO and Decentralized Governance 2.Smart Contracts for Decentralized Governance
  4. 4. DEFINING DAO “A decentralized autonomous organization (DAO), sometimes called a decentralized autonomous corporation (DAC), is an organization represented by rules encoded as a computer program that is transparent, controlled by the organization members and not influenced by a central government, in other words they are member-owned communities without centralized leadership.” - Wikipedia • DAOs often use blockchain technology to provide a secure digital ledger to track digital interactions • DAO governance is coordinated using tokens or NFTs that grant voting powers • DAOs can be subject to coups or hostile takeovers that upend their voting structures especially if the voting power is based upon the number of tokens one owns
  5. 5. DECENTRALIZED GOVERNANCE Decentralized Governance frameworks for managing collective action and common resources rules of decentralized organizations are primarily enforced by code, rather than the legal system often use direct voting Benefits: • Gives power directly to token holders • Eliminates some risks of censorship, manipulation, bribery • Reduce reliance on external legal frameworks and systems • Helps to align interests with group goals • Greater autonomy • Efficiency of decision making • Improved transparency
  6. 6. GOVERNANCE BY VOTING On Chain More secure No trusted third party is required to count or enact votes Passed proposals can be executed automatically Works well for approving protocol changes or other high-risk votes Reduces risk of vote tampering Off Chain Votes are not submitted as blockchain transactions No transaction fees are necessary for off chain votes More participation, particularly from smaller holders and wider community Off chain votes can be recorded via decentralized data storage systems, reducing risk of vote tampering Works well for sentiment polls or other low risk votes
  7. 7. NOTABLE DAOS Name Token Use cases Network Launch Status Dash DASH Governance, fund allocation [24] Dash (cryptocurrency) May 2015[25] Operational since 2015[26][27][28] The DAO DAO Venture capital Ethereum April 2016 Defunct late 2016 due to hack[29] Augur REP Prediction market, Sports betting, Option (finance), Insurance Ethereum July 2018 Operational Steem STEEM Data distribution, Social media, Name services, Industrial Steem March 2016 Operational Uniswap UNI Exchange, Automated Market Making Ethereum November 2018 Operational[30] ConstitutionDAO PEOPLE Purchasing an original copy of the Constitution of the United States Ethereum November 2021[31] Defunct[32]
  8. 8. IS IT LEGAL?
  9. 9. EXAMPLE OF VOTING PROPOSAL FLOW
  10. 10. MAKER GOVERNANCE EXPERIENCE (DAI STABLECOIN)
  11. 11. APPROACHES FOR DAO GOVERNANCE No-Code DAO Stack Aragon Colony DAOHaus xDAO Snapshot Coding Solutions Zodiac Tally Gnosis Safe Openzeppelin
  12. 12. TALLY.XYZ VOTING EXPERIENCE (DEMO)
  13. 13. TALLY.XYZ VOTE STATISTICS
  14. 14. ADDING YOUR DAO TO TALLY.XYZ
  15. 15. MAJOR GOVERNANCE FRAMEWORKS AND APPROACHES On-chain voting Off-chain Voting Vote delegation Protocols Compound Governor ✓ ✓ COMP voting OpenZeppelin Governor ✓ ✓ Many Curve Voting Escrow ✓ ✓ Curve Finance mStable Multisigs ✓ Synthetix Yearn Finance Sushiswap Snapshot Polls ✓ Balancer Sushiswap Yearn Finance
  16. 16. TALLY.XYZ SUPPORTED PROTOCOLS Compound (COMP) Uniswap (UNI) Indexed Finance (NDX) PoolTogether (POOL) Radicle (RAD) Idle Finance (IDLE) Inverse Finance (INV) Unslashed Finance (USF) …
  17. 17. BALLOT CONTRACT 1/6 // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; /// @title Voting with delegation. contract Ballot { struct Voter { uint weight; // weight is accumulated by delegation bool voted; // if true, that person already voted address delegate; // person delegated to uint vote; // index of the voted proposal } // This is a type for a single proposal. struct Proposal { bytes32 name; // short name (up to 32 bytes) uint voteCount; // number of accumulated votes }
  18. 18. BALLOT CONTRACT 2/6 constructor(bytes32[] memory proposalNames) { chairperson = msg.sender; voters[chairperson].weight = 1; // For each of the provided proposal names, // create a new proposal object and add it // to the end of the array. for (uint i = 0; i < proposalNames.length; i++) { // `Proposal({...})` creates a temporary // Proposal object and `proposals.push(...)` // appends it to the end of `proposals`. proposals.push(Proposal({ name: proposalNames[i], voteCount: 0 })); } }
  19. 19. BALLOT CONTRACT 3/6 function giveRightToVote(address voter) external { require( msg.sender == chairperson, "Only chairperson can give right to vote." ); require( !voters[voter].voted, "The voter already voted." ); require(voters[voter].weight == 0); voters[voter].weight = 1; }
  20. 20. BALLOT CONTRACT 4/6 /// Delegate your vote to the voter `to`. function delegate(address to) external { // assigns reference Voter storage sender = voters[msg.sender]; require(!sender.voted, "You already voted."); require(to != msg.sender, "Self-delegation is disallowed."); while (voters[to].delegate != address(0)) { to = voters[to].delegate; // We found a loop in the delegation, not allowed. require(to != msg.sender, "Found loop in delegation."); } // Since `sender` is a reference, this // modifies `voters[msg.sender].voted` Voter storage delegate_ = voters[to]; // Voters cannot delegate to wallets that cannot vote. require(delegate_.weight >= 1); sender.voted = true; sender.delegate = to; if (delegate_.voted) { // If the delegate already voted, // directly add to the number of votes proposals[delegate_.vote].voteCount += sender.weight; } else { // If the delegate did not vote yet, // add to her weight. delegate_.weight += sender.weight; } }
  21. 21. BALLOT CONTRACT 5/6 function vote(uint proposal) external { Voter storage sender = voters[msg.sender]; require(sender.weight != 0, "Has no right to vote"); require(!sender.voted, "Already voted."); sender.voted = true; sender.vote = proposal; // If `proposal` is out of the range of the array, // this will throw automatically and revert all // changes. proposals[proposal].voteCount += sender.weight; }
  22. 22. BALLOT CONTRACT 6/6 function winnerName() external view returns (bytes32 winnerName_) { winnerName_ = proposals[winningProposal()].name; }
  23. 23. NEXT STEPS (AGENDA FOR OUR MEETUP NEXT MONTH) Governor Bravo OpenZeppelin
  24. 24. ABOUT PRESENTER Gene Leybzon https://www.linkedin.com/in/leybzon/ https://www.meetup.com/members/90 74420/ https://www.leybzon.com https://clarity.fm/geneleybzon

Mais Conteúdo rRelacionado

Audiolivros relacionados

Gratuito durante 30 dias do Scribd

Ver tudo

×