#
IGovernorFactory
Matt Stam (@mattstam)
IGovernorFactory
Clone factory for deploying token clones (minimal proxies of IGovernor
).
https://blog.openzeppelin.com/workshop-recap-cheap-contract-deployment-through-clones/ Only CREATE2 / deterministic creation is supported, since in the Git Consensus Protocol onboarding, the addresses will always need to be be predicted ahead of time. The usual flow is: 1. Predict the address of the governor using GovernorFactory.predictAddress() 2. Deploy the token using TokenFactory.createToken(..., govAddr, ...) 3. Deploy the governor using GovernorFactory.createGovernor(..., tokenAddr, ...)
#
Methods
#
createGovernor
function createGovernor(address tokenAddr, string name, uint256 votingDelay, uint256 votingPeriod, uint256 proposalThreshold, uint256 quorumNumerator, bytes32 salt) external nonpayable returns (address instanceAddr)
Creates an IGovernor
with an optional initial distribution. Uses CREATE2 so that the governor's address can be computed deterministically using predictAddress().
#
Parameters
#
Returns
#
predictAddress
function predictAddress(bytes32 salt) external view returns (address instanceAddr)
Predicts the address of an IGovernor
deployed using CREATE2 + salt value.
#
Parameters
#
Returns
#
Events
#
GovernorCreated
event GovernorCreated(address instanceAddr, address creatorAddr, address tokenAddr, string name, uint256 votingDelay, uint256 votingPeriod, uint256 proposalThreshold, uint256 quorumNumerator)