Created
December 15, 2022 05:42
-
-
Save KolevDarko/e02e74cb4143b5cdc327a5cd58b3c292 to your computer and use it in GitHub Desktop.
Governor execute
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function execute( | |
address[] memory targets, | |
uint256[] memory values, | |
bytes[] memory calldatas, | |
bytes32 descriptionHash | |
) public payable virtual override returns (uint256) { | |
uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash); | |
ProposalState status = state(proposalId); | |
require( | |
status == ProposalState.Succeeded || status == ProposalState.Queued, | |
"Governor: proposal not successful" | |
); | |
_proposals[proposalId].executed = true; | |
emit ProposalExecuted(proposalId); | |
_beforeExecute(proposalId, targets, values, calldatas, descriptionHash); | |
_execute(proposalId, targets, values, calldatas, descriptionHash); | |
_afterExecute(proposalId, targets, values, calldatas, descriptionHash); | |
return proposalId; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment