Request form
Cookbook may introduce a token in the future. Share and contribute to be eligible for future airdrops.
close icon
relevant tag icon
Wizards
copy icon
Rob-test
• version 1.0.0
Cool

Wizards

Desc

*Visit desktop site to download or deploy

Version

1.0.0

Creator

Rob-test

Last Publish

11/24/2022
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
isExecuted(uint256) :
This function checks whether a proposal with a given ID has been executed or not. It takes in a uint256 proposalId as an argument and returns a boolean value. It does this by accessing the _proposals mapping and checking the 'executed' field of the proposal with the given ID. If the 'executed' field is true, then the proposal has been executed and the function returns true. Otherwise, it returns false. (autogenerated documentation)
isCanceled(uint256) :
This function checks whether a proposal with the given ID has been canceled or not. It does this by accessing the 'canceled' property of the proposal stored in the _proposals mapping and returning its value. (autogenerated documentation)
_castVote(uint256,address,uint8,string) :
This function is used to cast a vote on a proposal in a Ghost Voting contract. It takes in the proposal ID, the account address of the voter, the support (yes/no) of the vote, and a reason for the vote. It then calculates the delta weight of the vote and adds it to the ghost_sum_vote_power_by_id mapping for the proposal. Finally, it returns the delta weight of the vote. (autogenerated documentation)
snapshot(uint256) :
This function returns the deadline of a given proposal, identified by its proposalId. It works by accessing the _proposals mapping, which stores information about each proposal, and returning the voteStart._deadline value associated with the given proposalId. (autogenerated documentation)
getExecutor() :
This function is a public view function that returns the address of the executor of the contract. It works by accessing the _executor() internal function, which returns the address of the executor. (autogenerated documentation)
votingDelay() :
This function is used to retrieve the voting delay set for a particular contract. It works by returning the value stored in the _votingDelay variable, which is set when the contract is deployed. This value is used to determine the amount of time that must pass before a vote can be cast. (autogenerated documentation)
votingPeriod() :
This function is used to view the voting period of a contract. It returns the value of the _votingPeriod variable, which is a uint256 type. This variable is used to store the length of the voting period, which is the amount of time that a vote is open for. (autogenerated documentation)
proposalThreshold() :
This function returns the proposal threshold, which is the minimum amount of votes required for a proposal to be accepted. It works by returning the value stored in the _proposalThreshold variable. (autogenerated documentation)
quorum(uint256) :
This function is an override of the quorum function from the IGovernor interface. It calculates the quorum fraction for a given block number, which is used to determine the minimum number of votes required for a proposal to pass. The quorum fraction is calculated by dividing the total number of votes cast by the total number of votes available. (autogenerated documentation)
getVotes(address,uint256) :
This function is an override of the getVotes() function from the IGovernor interface. It retrieves the number of votes that a given account has at a given block number. It works by calling the getVotes() function from the GovernorVotes contract, which is the contract that implements the IGovernor interface. (autogenerated documentation)
state(uint256) :
This function is used to view the state of a proposal with a given ID. It is an override of the state function from the Governor and GovernorTimelockControl contracts. It returns the ProposalState of the proposal, which can be either Pending, Active, Executed, or Cancelled. (autogenerated documentation)
propose(uint256[],string) :
This function is used to propose a new governance action to the Governor contract. It takes in an array of addresses, an array of uint256 values, an array of bytes calldatas, and a string description as parameters. The function then calls the super.propose() function, which is inherited from the IGovernor interface, and returns a uint256 value. This value is the ID of the newly proposed governance action. (autogenerated documentation)
_execute(uint256,uint256[],bytes32) :
This function is an override of the _execute function from the Governor and GovernorTimelockControl contracts. It is used to execute a proposal that has been approved by the Governor. It takes in a proposal ID, an array of target addresses, an array of values, an array of calldatas, and a description hash as parameters. The function then calls the _execute function from the parent contracts, which will execute the proposal by calling the target addresses with the given values and calldatas. (autogenerated documentation)
_cancel(uint256[],bytes32) :
This function is used to cancel a previously scheduled transaction on the GovernorTimelockControl contract. It takes in an array of target addresses, an array of values, an array of calldatas, and a description hash as parameters. It then calls the _cancel function of the GovernorTimelockControl contract, which will cancel the transaction and return the transaction ID of the cancelled transaction. (autogenerated documentation)
_executor() :
This function is used to retrieve the address of the executor of the GovernorTimelockControl contract. It does this by calling the _executor() function of the Governor contract, which returns the address of the executor. (autogenerated documentation)
supportsInterface(bytes4) :
This function is used to check if a given contract supports a specific interface. It takes a bytes4 interfaceId as an argument and returns a boolean value indicating whether the contract supports the interface or not. The function calls the supportsInterface() function from the parent contract, which checks if the interfaceId matches any of the supported interfaces. If a match is found, the function returns true, otherwise it returns false. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i Wizards
copy icon

Last Publish

11/24/2022

Version

1.0.0

Creator

Rob-test

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.