Skip to main content

Proposal

Description

An abstract contract containing the traits and internal functionality to create and execute proposals that can be inherited by non-upgradeable DAO plugins.

Implementation

public function proposalCount

Returns the proposal count determining the next proposal ID.

function proposalCount() public view returns (uint256)
OutputTypeDescription
0uint256The proposal count.

public function supportsInterface

Checks if this or the parent contract supports an interface by its ID.

function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool)
InputTypeDescription
_interfaceIdbytes4The ID of the interface.
Output
0boolReturns true if the interface is supported.

internal function _createProposalId

Creates a proposal ID.

function _createProposalId() internal returns (uint256 proposalId)
OutputTypeDescription
proposalIduint256The proposal ID.

internal function _createProposal

Internal function to create a proposal.

function _createProposal(address _creator, bytes _metadata, uint64 _startDate, uint64 _endDate, struct IDAO.Action[] _actions, uint256 _allowFailureMap) internal virtual returns (uint256 proposalId)
InputTypeDescription
_creatoraddress
_metadatabytesThe proposal metadata.
_startDateuint64The start date of the proposal in seconds.
_endDateuint64The end date of the proposal in seconds.
_actionsstruct IDAO.Action[]The actions that will be executed after the proposal passes.
_allowFailureMapuint256A bitmap allowing the proposal to succeed, even if individual actions might revert. If the bit at index i is 1, the proposal succeeds even if the ith action reverts. A failure map value of 0 requires every action to not revert.
Output
proposalIduint256The ID of the proposal.

internal function _executeProposal

Internal function to execute a proposal.

function _executeProposal(contract IDAO _dao, uint256 _proposalId, struct IDAO.Action[] _actions, uint256 _allowFailureMap) internal virtual returns (bytes[] execResults, uint256 failureMap)
InputTypeDescription
_daocontract IDAO
_proposalIduint256The ID of the proposal to be executed.
_actionsstruct IDAO.Action[]The array of actions to be executed.
_allowFailureMapuint256A bitmap allowing the proposal to succeed, even if individual actions might revert. If the bit at index i is 1, the proposal succeeds even if the ith action reverts. A failure map value of 0 requires every action to not revert.
Output
execResultsbytes[]The array with the results of the executed actions.
failureMapuint256The failure map encoding which actions have failed.
© 2024