GovernorAlphaFactory
This contract lets the Alchemy Contract set up its own GovernorAlpha instance to manage proposals.
There is a fixed amount needed to propose which is set at 1% of the total supply of the generated Alchemy ERC20 token and a quorum for votes set to 4% of the total supply.
init
initfunction init(address timelock_) externalThis function is called to set up the Governor contract with the matching timelock contract.
propose
proposefunction propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) publicFunction that lets users create a proposal.
Takes the targets, values, function signatures, and the calldatas for the contract calls as well as a description.
queue
queuefunction queue(uint proposalId) publicThis function is used to queue a proposal after it was successful.
_queueOrRevert
_queueOrRevertfunction _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta)Internal function that either queues a proposal or cancels it.
execute
executefunction execute(uint proposalId) public payableThe actual execute function for a proposal. This then calls the execue function on the timelock contract.
cancel
cancelfunction cancel(uint proposalId) publicCancels a defeated proposal.
getActions
getActionsfunction getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas)Returns the targets, signatures, values, and call data from a specific proposal.
getReceipt
getReceiptfunction getReceipt(uint proposalId, address voter) public view returns (Receipt memory)Gets a receipt for voting on a proposal.
state
statefunction state(uint proposalId) publicReturns the current state of a proposal.
castVote
castVotefunction castVote(uint proposalId, bool support)Lets a user vote on a proposal.
castVoteBySig
castVoteBySigfunction castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) publicLets a user vote on a proposal by signature.
_castVote
_castVotefunction _castVote(address voter, uint proposalId, bool support) internalInternal function to cast a vote.
GovernorMint
GovernorMintfunction GovernorMint(
address nft_,
uint supply_,
uint votingtime_
) publicFactory function to mint a new governor alpha contract instance.
Last updated
Was this helpful?