Using Governor with erc721

Hello, it's great to read that openzeppelin released their governance system based on the compound governor effort. I hope it will be a game-changer for the whole community :slight_smile:
I read in the introductory article:

OpenZeppelin Contracts contain the most common requirements out of the box. Beyond these, OpenZeppelin Governor could potentially be configured with ERC721 voting power so certain NFT owners can participate in governance when specified

I was wondering if there's some code samples or tutorials to achieve a governance system in which erc721 owners has voting power (1 nft = 1 vote, as in the standard governor system), including the possibility to delegate voting power to another user - or if it's just trivial enough to be accomplished with a few tweaks...

1 Like

Ah on How to set up on-chain governance I read

Voting power could be determined in different ways: multiple ERC20 tokens, ERC721 tokens, sybil resistant identities, etc. All of these options are potentially supported by writing a custom Votes module for your Governor

Therefore I guess there should be an equivalent of ERC20Votes extension for ERC721...

Anyway, here the flow I'd like to build (in case it can help the discussion):

  • First I deploy a contract that create a capped amount of an NFT (yet to be minted)
  • Users can mint the NFT, paying an ad-hoc fee that is sent to the treasury
  • The treasury is managed by the Timelock contract (or it can be the timelock itself ?)
  • Users that own one or more NFT can access to the project governance (proposals will span from treasury management to changing the DAO governance system)
  • On-chain proposals creation and voting are locked till a specific amount of NFTs are minted (as a kind of blocker to ensure that no malicious proposals can be passed while the supply and participation are low )
1 Like