The OZ Governor Module belongs to the Zodiac collection of tools, which can be accessed through the Zodiac App available on Gnosis Safe, as well as in this repository.
If you have any questions about Zodiac, join the Gnosis Guild Discord. Follow @GnosisGuild on Twitter for updates.
The OZ Governor Module is an opinionated implementation of OpenZeppelin's Governor contracts designed to be used in a Zodiac-style setup, allowing a Avatar (like a Gnosis Safe) to controlled by on-chain governance similar to Compound's Governor Alpha and Bravo.
This module makes no changes to the existing Governor interface, in order to maintain compatibility with existing applications that support Governor. However, it does modify the behaviour of some existing functions, along with adding some additional functions, to enable it to be more easily used with an avatar.
Specifically, the following changes are important to note:
_executor()
returns the address stored atowner
. So allonlyGovernance()
checks are now equivalent toonlyOwner()
checks.owner
can be set withtransferOwnership()
. This is important for enabling complex governance setups where the avatar may differ from the account that owns the governor module.execute
encodes the provided array of transactions as a delegate call to the multisend contract and triggers a call toexecTransactionFromModule()
on the address stored attarget
. This enables governor to be chained with other modifiers, like the Delay or Roles modifiers.
Warning: Tokens or value MUST NEVER be sent to the address of a deployed instance of this module, as they will be immediately lost. Rather, all value should be stored in the attached avatar (Gnosis Safe).
yarn install # install dependencies
yarn build # compiles contracts
yarn coverage # runs the tests and displays contract coverage report
For each command, the network can be specified by adding the network argument, for instance --network hardhat
.
For a full test setup run:
yarn deploy
This will deploy a mastercopy for the module, a mastercopy of the ERC20Votes token, a mastercopy of the ERC721Votes token. Then it will deploy a test avatar, and create a minimal proxy for the ERC20 Votes token and set up a minimal proxy for the module (using the test avatar and ERC20 Votes proxy).
To deploy the mastercopy of the module:
yarn deploy --tags moduleMastercopy
To deploy the mastercopy of the ERC20 Votes token:
yarn deploy --tags erc20VotesMastercopy
To deploy the mastercopy of the ERC721 Votes token:
yarn deploy --tags erc721VotesMastercopy
Created under the LGPL-3.0+ license.
An audit has been performed by the G0 group.
All issues and notes of the audit have been addressed in commit e8281f03779427cd1716e078b712f42473f36e7c.
The audit results are available as a pdf in this repo.
All contracts are WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.