Skip to content

Commit

Permalink
add get proposalid in the interface
Browse files Browse the repository at this point in the history
  • Loading branch information
novaknole committed Aug 27, 2024
1 parent f4dc570 commit 5306a73
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions contracts/src/plugin/extensions/proposal/IProposal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ interface IProposal {
/// @return bool Returns if proposal can be executed or not.
function canExecute(uint256 proposalId) external returns (bool);

/// @notice Creates a proposal Id.
/// @param actions The actions that will be executed after the proposal passes.
/// @param metadata The custom metadata that is passed when creating a proposal.
/// @return proposalId The id of the proposal.
function getProposalId(
IDAO.Action[] memory actions,
bytes memory metadata
) external returns (uint256);

/// @notice Returns the proposal count determining the next proposal ID.
/// @dev This function has been deprecated but due to backwards compatibility, it still stays in the interface
/// but returns maximum value of uint256 to let consumers know not to depend on it anymore.
Expand Down
3 changes: 2 additions & 1 deletion contracts/src/plugin/extensions/proposal/Proposal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ abstract contract Proposal is IProposal, ERC165 {
_interfaceId ==
type(IProposal).interfaceId ^
IProposal.createProposal.selector ^
IProposal.canExecute.selector ||
IProposal.canExecute.selector ^
IProposal.getProposalId.selector ||
_interfaceId == type(IProposal).interfaceId ||
super.supportsInterface(_interfaceId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ abstract contract ProposalUpgradeable is IProposal, ERC165Upgradeable {
_interfaceId ==
type(IProposal).interfaceId ^
IProposal.createProposal.selector ^
IProposal.canExecute.selector ||
IProposal.canExecute.selector ^
IProposal.getProposalId.selector ||
_interfaceId == type(IProposal).interfaceId ||
super.supportsInterface(_interfaceId);
}
Expand Down

0 comments on commit 5306a73

Please sign in to comment.