diff --git a/contracts/CHANGELOG.md b/contracts/CHANGELOG.md index d49634b8..8de73b41 100644 --- a/contracts/CHANGELOG.md +++ b/contracts/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Use [OpenZepplin v4.9.6](https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v4.9.6). -- Updated hardhat configuration to use the `commons- config` networks. +- Updated hardhat configuration to use the `commons-config` networks. ## v1.4.0 diff --git a/contracts/src/mocks/plugin/extensions/proposal/ProposalMock.sol b/contracts/src/mocks/plugin/extensions/proposal/ProposalMock.sol index 6af16ee6..ef45b0a2 100644 --- a/contracts/src/mocks/plugin/extensions/proposal/ProposalMock.sol +++ b/contracts/src/mocks/plugin/extensions/proposal/ProposalMock.sol @@ -20,7 +20,7 @@ contract ProposalMock is Proposal { bytes memory ) external returns (uint256 proposalId) {} - function canExecute(uint256 proposalId) external view returns (bool) {} + function hasSucceeded(uint256 proposalId) external view returns (bool) {} function customProposalParamsABI() external view returns (string memory) {} } diff --git a/contracts/src/mocks/plugin/extensions/proposal/ProposalUpgradeableMock.sol b/contracts/src/mocks/plugin/extensions/proposal/ProposalUpgradeableMock.sol index 4f1fdcd8..b951e7be 100644 --- a/contracts/src/mocks/plugin/extensions/proposal/ProposalUpgradeableMock.sol +++ b/contracts/src/mocks/plugin/extensions/proposal/ProposalUpgradeableMock.sol @@ -20,7 +20,7 @@ contract ProposalUpgradeableMock is ProposalUpgradeable { bytes memory ) external returns (uint256 proposalId) {} - function canExecute(uint256 proposalId) external view returns (bool) {} + function hasSucceeded(uint256 proposalId) external view returns (bool) {} function customProposalParamsABI() external view returns (string memory) {} } diff --git a/contracts/src/plugin/extensions/proposal/IProposal.sol b/contracts/src/plugin/extensions/proposal/IProposal.sol index 9d775281..f7fbcbbb 100644 --- a/contracts/src/plugin/extensions/proposal/IProposal.sol +++ b/contracts/src/plugin/extensions/proposal/IProposal.sol @@ -46,10 +46,11 @@ interface IProposal { bytes memory data ) external returns (uint256 proposalId); - /// @notice Whether proposal can be executed or not. + /// @notice Whether proposal succeeded or not. + /// @dev Note that this must not include time window checks and only make a decision based on the thresholds. /// @param proposalId The id of the proposal. - /// @return bool Returns if proposal can be executed or not. - function canExecute(uint256 proposalId) external view returns (bool); + /// @return bool Returns if proposal has been succeeded or not without including time window checks. + function hasSucceeded(uint256 proposalId) external view returns (bool); /// @notice The human-readable abi format for extra params included in `data` of `createProposal`. /// @dev Used for UI to easily detect what extra params the contract expects. diff --git a/contracts/src/plugin/extensions/proposal/Proposal.sol b/contracts/src/plugin/extensions/proposal/Proposal.sol index 93aed44f..2da16fd6 100644 --- a/contracts/src/plugin/extensions/proposal/Proposal.sol +++ b/contracts/src/plugin/extensions/proposal/Proposal.sol @@ -32,12 +32,12 @@ abstract contract Proposal is IProposal, ERC165 { function supportsInterface(bytes4 _interfaceId) public view virtual override returns (bool) { // In addition to the current interfaceId, also support previous version of the interfaceId // that did not include the following functions: - // `createProposal, canExecute, customProposalParamsABI`. + // `createProposal`, `hasSucceeded`, `customProposalParamsABI`. return _interfaceId == type(IProposal).interfaceId ^ IProposal.createProposal.selector ^ - IProposal.canExecute.selector ^ + IProposal.hasSucceeded.selector ^ IProposal.customProposalParamsABI.selector || _interfaceId == type(IProposal).interfaceId || super.supportsInterface(_interfaceId); diff --git a/contracts/src/plugin/extensions/proposal/ProposalUpgradeable.sol b/contracts/src/plugin/extensions/proposal/ProposalUpgradeable.sol index 37cbdae8..4df873c1 100644 --- a/contracts/src/plugin/extensions/proposal/ProposalUpgradeable.sol +++ b/contracts/src/plugin/extensions/proposal/ProposalUpgradeable.sol @@ -38,12 +38,12 @@ abstract contract ProposalUpgradeable is IProposal, ERC165Upgradeable { function supportsInterface(bytes4 _interfaceId) public view virtual override returns (bool) { // In addition to the current interfaceId, also support previous version of the interfaceId // that did not include the following functions: - // `createProposal, canExecute, customProposalParamsABI`. + // `createProposal`, `hasSucceeded`, `customProposalParamsABI`. return _interfaceId == type(IProposal).interfaceId ^ IProposal.createProposal.selector ^ - IProposal.canExecute.selector ^ + IProposal.hasSucceeded.selector ^ IProposal.customProposalParamsABI.selector || _interfaceId == type(IProposal).interfaceId || super.supportsInterface(_interfaceId);