From 18debee5ec60e7f32b3c22855e7f073fe78bf81f Mon Sep 17 00:00:00 2001 From: 0xRaccoon Date: Thu, 4 Jan 2024 12:40:10 -0300 Subject: [PATCH] fix: rename votesBlockNumber to votesBlocknumber Signed-off-by: 0xRaccoon --- .../contracts/governance/WonderGovernor.sol | 32 +++++++++---------- .../interfaces/governance/IWonderGovernor.sol | 12 +++---- .../governance/utils/IWonderVotes.sol | 2 +- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/solidity/contracts/governance/WonderGovernor.sol b/solidity/contracts/governance/WonderGovernor.sol index 153954d..c5d17e4 100644 --- a/solidity/contracts/governance/WonderGovernor.sol +++ b/solidity/contracts/governance/WonderGovernor.sol @@ -305,7 +305,7 @@ abstract contract WonderGovernor is address[] memory targets, uint256[] memory values, bytes[] memory calldatas, - uint256 votesBlockNumber, + uint256 votesBlocknumber, string memory description ) public virtual validProposalType(proposalType) returns (uint256) { address proposer = _msgSender(); @@ -316,7 +316,7 @@ abstract contract WonderGovernor is } // check proposal threshold - uint256 proposerVotes = getVotes(proposer, proposalType, votesBlockNumber, clock() - 1); + uint256 proposerVotes = getVotes(proposer, proposalType, votesBlocknumber, clock() - 1); uint256 votesThreshold = proposalThreshold(proposalType); if (proposerVotes < votesThreshold) { revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold); @@ -560,9 +560,9 @@ abstract contract WonderGovernor is /** * @dev See {IWonderGovernor-castVote}. */ - function castVote(uint256 proposalId, uint8 support, uint256 votesBlockNumber) public virtual returns (uint256) { + function castVote(uint256 proposalId, uint8 support, uint256 votesBlocknumber) public virtual returns (uint256) { address voter = _msgSender(); - return _castVote(proposalId, voter, support, votesBlockNumber, ''); + return _castVote(proposalId, voter, support, votesBlocknumber, ''); } /** @@ -571,11 +571,11 @@ abstract contract WonderGovernor is function castVoteWithReason( uint256 proposalId, uint8 support, - uint256 votesBlockNumber, + uint256 votesBlocknumber, string calldata reason ) public virtual returns (uint256) { address voter = _msgSender(); - return _castVote(proposalId, voter, support, votesBlockNumber, reason); + return _castVote(proposalId, voter, support, votesBlocknumber, reason); } /** @@ -584,12 +584,12 @@ abstract contract WonderGovernor is function castVoteWithReasonAndParams( uint256 proposalId, uint8 support, - uint256 votesBlockNumber, + uint256 votesBlocknumber, string calldata reason, bytes memory params ) public virtual returns (uint256) { address voter = _msgSender(); - return _castVote(proposalId, voter, support, reason, votesBlockNumber, params); + return _castVote(proposalId, voter, support, reason, votesBlocknumber, params); } /** @@ -599,7 +599,7 @@ abstract contract WonderGovernor is uint256 proposalId, uint8 support, address voter, - uint256 votesBlockNumber, + uint256 votesBlocknumber, bytes memory signature ) public virtual returns (uint256) { bool valid = SignatureChecker.isValidSignatureNow( @@ -612,7 +612,7 @@ abstract contract WonderGovernor is revert GovernorInvalidSignature(voter); } - return _castVote(proposalId, voter, support, votesBlockNumber, ''); + return _castVote(proposalId, voter, support, votesBlocknumber, ''); } /** @@ -622,7 +622,7 @@ abstract contract WonderGovernor is uint256 proposalId, uint8 support, address voter, - uint256 votesBlockNumber, + uint256 votesBlocknumber, string calldata reason, bytes memory params, bytes memory signature @@ -649,7 +649,7 @@ abstract contract WonderGovernor is revert GovernorInvalidSignature(voter); } - return _castVote(proposalId, voter, support, reason, votesBlockNumber, params); + return _castVote(proposalId, voter, support, reason, votesBlocknumber, params); } /** @@ -662,10 +662,10 @@ abstract contract WonderGovernor is uint256 proposalId, address account, uint8 support, - uint256 votesBlockNumber, + uint256 votesBlocknumber, string memory reason ) internal virtual returns (uint256) { - return _castVote(proposalId, account, support, reason, votesBlockNumber, _defaultParams()); + return _castVote(proposalId, account, support, reason, votesBlocknumber, _defaultParams()); } /** @@ -679,14 +679,14 @@ abstract contract WonderGovernor is address account, uint8 support, string memory reason, - uint256 votesBlockNumber, + uint256 votesBlocknumber, bytes memory params ) internal virtual returns (uint256) { _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Active)); uint8 _proposalType = _proposals[proposalId].proposalType; - uint256 weight = _getVotes(account, _proposalType, votesBlockNumber, proposalSnapshot(proposalId), params); + uint256 weight = _getVotes(account, _proposalType, votesBlocknumber, proposalSnapshot(proposalId), params); _countVote(proposalId, account, support, weight, params); if (params.length == 0) { diff --git a/solidity/interfaces/governance/IWonderGovernor.sol b/solidity/interfaces/governance/IWonderGovernor.sol index 89d01b0..6e312f8 100644 --- a/solidity/interfaces/governance/IWonderGovernor.sol +++ b/solidity/interfaces/governance/IWonderGovernor.sol @@ -330,7 +330,7 @@ interface IWonderGovernor is IERC165, IERC6372 { address[] memory targets, uint256[] memory values, bytes[] memory calldatas, - uint256 votesBlockNumber, + uint256 votesBlocknumber, string memory description ) external returns (uint256 proposalId); @@ -385,7 +385,7 @@ interface IWonderGovernor is IERC165, IERC6372 { * * Emits a {VoteCast} event. */ - function castVote(uint256 proposalId, uint8 support, uint256 votesBlockNumber) external returns (uint256 balance); + function castVote(uint256 proposalId, uint8 support, uint256 votesBlocknumber) external returns (uint256 balance); /** * @dev Cast a vote with a reason @@ -395,7 +395,7 @@ interface IWonderGovernor is IERC165, IERC6372 { function castVoteWithReason( uint256 proposalId, uint8 support, - uint256 votesBlockNumber, + uint256 votesBlocknumber, string calldata reason ) external returns (uint256 balance); @@ -407,7 +407,7 @@ interface IWonderGovernor is IERC165, IERC6372 { function castVoteWithReasonAndParams( uint256 proposalId, uint8 support, - uint256 votesBlockNumber, + uint256 votesBlocknumber, string calldata reason, bytes memory params ) external returns (uint256 balance); @@ -421,7 +421,7 @@ interface IWonderGovernor is IERC165, IERC6372 { uint256 proposalId, uint8 support, address voter, - uint256 votesBlockNumber, + uint256 votesBlocknumber, bytes memory signature ) external returns (uint256 balance); @@ -435,7 +435,7 @@ interface IWonderGovernor is IERC165, IERC6372 { uint256 proposalId, uint8 support, address voter, - uint256 votesBlockNumber, + uint256 votesBlocknumber, string calldata reason, bytes memory params, bytes memory signature diff --git a/solidity/interfaces/governance/utils/IWonderVotes.sol b/solidity/interfaces/governance/utils/IWonderVotes.sol index 491be24..91c2ef0 100644 --- a/solidity/interfaces/governance/utils/IWonderVotes.sol +++ b/solidity/interfaces/governance/utils/IWonderVotes.sol @@ -78,7 +78,7 @@ interface IWonderVotes { function getSnapshotVotes( address account, uint8 proposalType, - uint256 votesBlockNumber, + uint256 votesBlocknumber, uint256 voteStart ) external view returns (uint256);