From 07362ceacd6b4eb9a625afddbcce36b2bbe4db06 Mon Sep 17 00:00:00 2001 From: Ben DiFrancesco Date: Wed, 22 Dec 2021 10:16:43 -0500 Subject: [PATCH] Remove castVoteWithParams without reason parameter --- contracts/governance/Governor.sol | 17 ++--------------- contracts/governance/IGovernor.sol | 11 ----------- .../introspection/SupportsInterface.behavior.js | 1 - 3 files changed, 2 insertions(+), 27 deletions(-) diff --git a/contracts/governance/Governor.sol b/contracts/governance/Governor.sol index b387c6429de..a4046eb47e8 100644 --- a/contracts/governance/Governor.sol +++ b/contracts/governance/Governor.sol @@ -68,10 +68,9 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor { */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { // In addition to the current interfaceId, also support previous version of the interfaceId that did not - // include the castVoteWithParams() and castVoteWithReasonAndParams() functions as standard + // include the castVoteWithReasonAndParams() function as standard return - interfaceId == - (type(IGovernor).interfaceId ^ this.castVoteWithReasonAndParams.selector ^ this.castVoteWithParams.selector) || + interfaceId == (type(IGovernor).interfaceId ^ this.castVoteWithReasonAndParams.selector) || interfaceId == type(IGovernor).interfaceId || super.supportsInterface(interfaceId); } @@ -313,18 +312,6 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor { return _castVote(proposalId, voter, support, "", ""); } - /** - * @dev See {IGovernor-castVoteWithParams}. - */ - function castVoteWithParams( - uint256 proposalId, - uint8 support, - bytes memory params - ) public virtual override returns (uint256) { - address voter = _msgSender(); - return _castVote(proposalId, voter, support, "", params); - } - /** * @dev See {IGovernor-castVoteWithReason}. */ diff --git a/contracts/governance/IGovernor.sol b/contracts/governance/IGovernor.sol index eab778d94dd..3bc1e44837a 100644 --- a/contracts/governance/IGovernor.sol +++ b/contracts/governance/IGovernor.sol @@ -192,17 +192,6 @@ abstract contract IGovernor is IERC165 { */ function castVote(uint256 proposalId, uint8 support) public virtual returns (uint256 balance); - /** - * @dev Cast a vote with additional encoded parameters - * - * Emits a {VoteCast} event. - */ - function castVoteWithParams( - uint256 proposalId, - uint8 support, - bytes memory params - ) public virtual returns (uint256 balance); - /** * @dev Cast a vote with a reason * diff --git a/test/utils/introspection/SupportsInterface.behavior.js b/test/utils/introspection/SupportsInterface.behavior.js index e1c36e218d7..9873fcd6e35 100644 --- a/test/utils/introspection/SupportsInterface.behavior.js +++ b/test/utils/introspection/SupportsInterface.behavior.js @@ -85,7 +85,6 @@ const INTERFACES = { 'propose(address[],uint256[],bytes[],string)', 'execute(address[],uint256[],bytes[],bytes32)', 'castVote(uint256,uint8)', - 'castVoteWithParams(uint256,uint8,bytes)', 'castVoteWithReason(uint256,uint8,string)', 'castVoteWithReasonAndParams(uint256,uint8,string,bytes)', 'castVoteBySig(uint256,uint8,uint8,bytes32,bytes32)',