DECENTRALIZED
GOVERNANCE
PART II
Smart Contracts that power Decentralized On-
chain Governance
Gene Leybzon 4/7/2022
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.
PLAN FOR TODAY
1.DAO and Decentralized Governance
(refresh)
2.Examples of Successful Governance
Models
3.OpenZeppelin governor contract
examples
4.Next steps
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
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
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
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]
IS IT LEGAL?
EXAMPLE OF VOTING PROPOSAL
FLOW
MAKER GOVERNANCE
EXPERIENCE
(DAI STABLECOIN)
APPROACHES FOR DAO
GOVERNANCE
No-Code
DAO Stack
Aragon
Colony
DAOHaus
xDAO
Snapshot
Coding Solutions
Zodiac
Tally
Gnosis Safe
Openzeppelin
TALLY.XYZ VOTING EXPERIENCE
(DEMO)
TALLY.XYZ VOTE STATISTICS
ADDING YOUR DAO TO TALLY.XYZ
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
TALLY.XYZ SUPPORTED
PROTOCOLS
Compound (COMP)
Uniswap (UNI)
Indexed Finance (NDX)
PoolTogether (POOL)
Radicle (RAD)
Idle Finance (IDLE)
Inverse Finance (INV)
Unslashed Finance (USF)
…
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
}
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
}));
}
}
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;
}
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;
}
}
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;
}
BALLOT CONTRACT 6/6
function winnerName() external view
returns (bytes32 winnerName_)
{
winnerName_ = proposals[winningProposal()].name;
}
TOKEN VOTE DEMOCRACY OR
PLUTOCRACY?
HOW DECENTRALIZED IS THE
GOVERNANCE OF BLOCKCHAIN-
BASED FINANCE?
The initial allocation of governance tokens by project
GOVERNANCE TOKEN
WHAT IS YEARN.FINANCE?
• Decentralized finance (DeFi) project
• Runs on the Ethereum blockchain
• Automates yield earning from stablecoins
• Enable users to optimize their earnings on crypto assets through lending and
Consists of several independent products, including:
•APY – Shows interest rates across different lending
protocols.
•yEarn (depricated) – Identifies the highest interest rates
users can earn lending an asset.
•Vaults – Collection of investment strategies designed to
generate the highest returns from other DeFi projects.
•Zap – Bundles several trades in one click, saving on
costs and labor.
•yGift - NFT that can be used to reward someone for
their work, or to simply share some love
Anyone who owns YFI is able to receive
revenue collected by the protocol in the form of
fees. yearn.finance charges a fee of 5% for its
Vaults service and and 0.5% on Vaults and
Earn. The yearn.finance system retains
$500,000 of fees and distributes the rest to YFI
holders.
YFI GOVERNANCE MODEL
A multi-DAO structure, managed by constrained delegation
A fluid number of
decentralized autonomous
organizations (DAOs) that
contribute to the protocol in
some unique way
YFI holders vote for changes to the protocol or
the protocols governance structure
yTeams focus on specific aspects of the
protocol or relevant operations
Multisig members execute or veto any on-
chain decisions
SIMPLIFIED GOVERNANCE FLOW
YFI
holders
yTeams
yTx
Multisig
create, destroy,
define limitations
notify about decision
creates
Delegate
d
Transacti
on
execute or vet
DETAIL FLOW
yTeam Objective Membership Pool
yGuard Protect the vaults
YFI Protocol Dev,
YFI Strategists, YFI
Mechanics, YFI
Secret Admirers
yBrain Manage the strats YFI Strategists
yDev
Manage the
protocol
YFI Protocol Dev
yPeople Curate the team
YFI Compensation
Working Group,
YFI Advisors
yBudget Spend money well
YFI Finances, YFI
Advisors
yFarm Grow the treasury
YFI Secret
Admirers, YFI
Secret Entrance
yTx Write transactions YFI Doers
PROPOSAL PROCESS
Requirements to pass proposals
•3 day discussion on the forum
• At least 25% vote 'for' the
change
•1 YFI in possession to submit to
snapshot
•5 day snapshot with over 50%
passing votes
https://gov.yearn.finance/
https://snapshot.org/#/ybaby.eth
YFI PROPOSAL STATES
Proposed YIPs will be discussed on governance calls
and in Discord
Approved – This YIP has passed community
governance and is now being prioritized for
development.
Implemented – This YIP has been implemented and
deployed to the mainnet.
Rejected – This YIP has failed to reach community
consensus.
Withdrawn – This YIP has been withdrawn by the
author(s)
Deferred – This YIP is pending another YIP/some
other change that should be bundled with it
together.
Propose
d
Approve
d
Implem
ented
Moribun
d
Deferre
d
Rejected Withdraw
n
YFI TEAM COMPENSATION
Gift Circles allow DAO
members to collectively
reward each other
Circle contributors
directly recognize each
other’s value, building a
more cohesive and
productive community
Understand how value moves
through your organization and
move more decisions and
resources to the community
coordinape.com “Decentralized payroll for flat
organizations”
MEETUP GOVERNOR CONTRACT
Requirement Value
Voting Delay (time between
deployment of contract and voting
start)
1 minute
Proposal Threshold (Minimum
number of votes to create
proposal)
0
Quorum 50% of votes
Voting Period 1 minute
SOLIDITY CODE FOR GOVERNOR AND
TOKEN CONTRACTS
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/governance/Governor.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol";
contract MeetupGovernor is Governor, GovernorCountingSimple, GovernorVotes,
GovernorVotesQuorumFraction {
constructor(IVotes _token)
Governor("MeetupGovernor")
GovernorVotes(_token)
GovernorVotesQuorumFraction(50)
{}
function votingDelay() public pure override returns (uint256) {
return 1; // 1 block
}
function votingPeriod() public pure override returns (uint256) {
return 5; // 1 minute
}
// The following functions are overrides required by Solidity.
function quorum(uint256 blockNumber)
public
view
override(IGovernor, GovernorVotesQuorumFraction)
returns (uint256)
{
return super.quorum(blockNumber);
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts@4.6.0/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts@4.6.0/token/ERC20/extensions/draft-ERC20P
import "@openzeppelin/contracts@4.6.0/token/ERC20/extensions/ERC20Votes.s
contract MeetupGold is ERC20, ERC20Permit, ERC20Votes {
constructor() ERC20("MeetupGold", "MG") ERC20Permit("MeetupGold") {
_mint(msg.sender, 1000 * 10 ** decimals());
}
// The following functions are overrides required by Solidity.
function _afterTokenTransfer(address from, address to, uint256 amount
internal
override(ERC20, ERC20Votes)
{
super._afterTokenTransfer(from, to, amount);
}
function _mint(address to, uint256 amount)
internal
override(ERC20, ERC20Votes)
{
super._mint(to, amount);
}
function _burn(address account, uint256 amount)
internal
override(ERC20, ERC20Votes)
{
super._burn(account, amount);
DEPLOYING MEETUP TOKEN
CONTRACT
0xd90d83699FC6328C82a7d5F3956DdBd0F2754141
DEPLOYING MEETUP GOVERNOR
CONTRACT
CREATE DAO
CAST THE VOTE
NEXT STEPS
Moving beyond coin voting
governance
Governance Minimization Guide
Finance Redefined: Can DeFi and
on-chain governance change
human nature?
On-Chain Governance
How to Code an On-Chain DAO
Contracts Wizard
How to set up on-chain
governance
OpenZeppelin Governance API
Documentation
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

Onchain Decentralized Governance 2.pptx

  • 1.
    DECENTRALIZED GOVERNANCE PART II Smart Contractsthat power Decentralized On- chain Governance Gene Leybzon 4/7/2022
  • 2.
    DISCLAIMER § The viewsand 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.
    PLAN FOR TODAY 1.DAOand Decentralized Governance (refresh) 2.Examples of Successful Governance Models 3.OpenZeppelin governor contract examples 4.Next steps
  • 4.
    DEFINING DAO “A decentralizedautonomous 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.
    DECENTRALIZED GOVERNANCE Decentralized Governance frameworks formanaging 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.
    GOVERNANCE BY VOTING OnChain 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.
    NOTABLE DAOS Name TokenUse 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.
  • 9.
    EXAMPLE OF VOTINGPROPOSAL FLOW
  • 10.
  • 11.
    APPROACHES FOR DAO GOVERNANCE No-Code DAOStack Aragon Colony DAOHaus xDAO Snapshot Coding Solutions Zodiac Tally Gnosis Safe Openzeppelin
  • 12.
  • 13.
  • 14.
    ADDING YOUR DAOTO TALLY.XYZ
  • 15.
    MAJOR GOVERNANCE FRAMEWORKS ANDAPPROACHES 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.
    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.
    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.
    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.
    BALLOT CONTRACT 3/6 functiongiveRightToVote(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.
    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.
    BALLOT CONTRACT 5/6 functionvote(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.
    BALLOT CONTRACT 6/6 functionwinnerName() external view returns (bytes32 winnerName_) { winnerName_ = proposals[winningProposal()].name; }
  • 23.
    TOKEN VOTE DEMOCRACYOR PLUTOCRACY?
  • 24.
    HOW DECENTRALIZED ISTHE GOVERNANCE OF BLOCKCHAIN- BASED FINANCE? The initial allocation of governance tokens by project
  • 25.
  • 26.
    WHAT IS YEARN.FINANCE? •Decentralized finance (DeFi) project • Runs on the Ethereum blockchain • Automates yield earning from stablecoins • Enable users to optimize their earnings on crypto assets through lending and Consists of several independent products, including: •APY – Shows interest rates across different lending protocols. •yEarn (depricated) – Identifies the highest interest rates users can earn lending an asset. •Vaults – Collection of investment strategies designed to generate the highest returns from other DeFi projects. •Zap – Bundles several trades in one click, saving on costs and labor. •yGift - NFT that can be used to reward someone for their work, or to simply share some love Anyone who owns YFI is able to receive revenue collected by the protocol in the form of fees. yearn.finance charges a fee of 5% for its Vaults service and and 0.5% on Vaults and Earn. The yearn.finance system retains $500,000 of fees and distributes the rest to YFI holders.
  • 27.
    YFI GOVERNANCE MODEL Amulti-DAO structure, managed by constrained delegation A fluid number of decentralized autonomous organizations (DAOs) that contribute to the protocol in some unique way YFI holders vote for changes to the protocol or the protocols governance structure yTeams focus on specific aspects of the protocol or relevant operations Multisig members execute or veto any on- chain decisions
  • 28.
    SIMPLIFIED GOVERNANCE FLOW YFI holders yTeams yTx Multisig create,destroy, define limitations notify about decision creates Delegate d Transacti on execute or vet
  • 29.
    DETAIL FLOW yTeam ObjectiveMembership Pool yGuard Protect the vaults YFI Protocol Dev, YFI Strategists, YFI Mechanics, YFI Secret Admirers yBrain Manage the strats YFI Strategists yDev Manage the protocol YFI Protocol Dev yPeople Curate the team YFI Compensation Working Group, YFI Advisors yBudget Spend money well YFI Finances, YFI Advisors yFarm Grow the treasury YFI Secret Admirers, YFI Secret Entrance yTx Write transactions YFI Doers
  • 30.
    PROPOSAL PROCESS Requirements topass proposals •3 day discussion on the forum • At least 25% vote 'for' the change •1 YFI in possession to submit to snapshot •5 day snapshot with over 50% passing votes https://gov.yearn.finance/ https://snapshot.org/#/ybaby.eth
  • 31.
    YFI PROPOSAL STATES ProposedYIPs will be discussed on governance calls and in Discord Approved – This YIP has passed community governance and is now being prioritized for development. Implemented – This YIP has been implemented and deployed to the mainnet. Rejected – This YIP has failed to reach community consensus. Withdrawn – This YIP has been withdrawn by the author(s) Deferred – This YIP is pending another YIP/some other change that should be bundled with it together. Propose d Approve d Implem ented Moribun d Deferre d Rejected Withdraw n
  • 32.
    YFI TEAM COMPENSATION GiftCircles allow DAO members to collectively reward each other Circle contributors directly recognize each other’s value, building a more cohesive and productive community Understand how value moves through your organization and move more decisions and resources to the community coordinape.com “Decentralized payroll for flat organizations”
  • 33.
    MEETUP GOVERNOR CONTRACT RequirementValue Voting Delay (time between deployment of contract and voting start) 1 minute Proposal Threshold (Minimum number of votes to create proposal) 0 Quorum 50% of votes Voting Period 1 minute
  • 34.
    SOLIDITY CODE FORGOVERNOR AND TOKEN CONTRACTS pragma solidity ^0.8.4; import "@openzeppelin/contracts/governance/Governor.sol"; import "@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol"; import "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol"; import "@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol"; contract MeetupGovernor is Governor, GovernorCountingSimple, GovernorVotes, GovernorVotesQuorumFraction { constructor(IVotes _token) Governor("MeetupGovernor") GovernorVotes(_token) GovernorVotesQuorumFraction(50) {} function votingDelay() public pure override returns (uint256) { return 1; // 1 block } function votingPeriod() public pure override returns (uint256) { return 5; // 1 minute } // The following functions are overrides required by Solidity. function quorum(uint256 blockNumber) public view override(IGovernor, GovernorVotesQuorumFraction) returns (uint256) { return super.quorum(blockNumber); // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts@4.6.0/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts@4.6.0/token/ERC20/extensions/draft-ERC20P import "@openzeppelin/contracts@4.6.0/token/ERC20/extensions/ERC20Votes.s contract MeetupGold is ERC20, ERC20Permit, ERC20Votes { constructor() ERC20("MeetupGold", "MG") ERC20Permit("MeetupGold") { _mint(msg.sender, 1000 * 10 ** decimals()); } // The following functions are overrides required by Solidity. function _afterTokenTransfer(address from, address to, uint256 amount internal override(ERC20, ERC20Votes) { super._afterTokenTransfer(from, to, amount); } function _mint(address to, uint256 amount) internal override(ERC20, ERC20Votes) { super._mint(to, amount); } function _burn(address account, uint256 amount) internal override(ERC20, ERC20Votes) { super._burn(account, amount);
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
    NEXT STEPS Moving beyondcoin voting governance Governance Minimization Guide Finance Redefined: Can DeFi and on-chain governance change human nature? On-Chain Governance How to Code an On-Chain DAO Contracts Wizard How to set up on-chain governance OpenZeppelin Governance API Documentation
  • 40.