Skip to main content

IDAO

Description

The interface required for DAOs within the Aragon App DAO framework.

Implementation

public struct Action

struct Action {
address to;
uint256 value;
bytes data;
}

external function hasPermission

Checks if an address has permission on a contract via a permission identifier and considers if ANY_ADDRESS was used in the granting process.

function hasPermission(address _where, address _who, bytes32 _permissionId, bytes _data) external view returns (bool)
InputTypeDescription
_whereaddressThe address of the contract.
_whoaddressThe address of a EOA or contract to give the permissions.
_permissionIdbytes32The permission identifier.
_databytesThe optional data passed to the PermissionCondition registered.
Output
0boolReturns true if the address has permission, false if not.

external function setMetadata

Updates the DAO metadata (e.g., an IPFS hash).

function setMetadata(bytes _metadata) external
InputTypeDescription
_metadatabytesThe IPFS hash of the new metadata object.

event MetadataSet

Emitted when the DAO metadata is updated.

event MetadataSet(bytes metadata)
InputTypeDescription
metadatabytesThe IPFS hash of the new metadata object.

external function execute

Executes a list of actions. If a zero allow-failure map is provided, a failing action reverts the entire execution. If a non-zero allow-failure map is provided, allowed actions can fail without the entire call being reverted.

function execute(bytes32 _callId, struct IDAO.Action[] _actions, uint256 _allowFailureMap) external returns (bytes[], uint256)
InputTypeDescription
_callIdbytes32The ID of the call. The definition of the value of callId is up to the calling contract and can be used, e.g., as a nonce.
_actionsstruct IDAO.Action[]The array of actions.
_allowFailureMapuint256A bitmap allowing execution to succeed, even if individual actions might revert. If the bit at index i is 1, the execution succeeds even if the ith action reverts. A failure map value of 0 requires every action to not revert.
Output
0bytes[]The array of results obtained from the executed actions in bytes.
1uint256The resulting failure map containing the actions have actually failed.

event Executed

Emitted when a proposal is executed.

event Executed(address actor, bytes32 callId, struct IDAO.Action[] actions, uint256 allowFailureMap, uint256 failureMap, bytes[] execResults)
InputTypeDescription
actoraddressThe address of the caller.
callIdbytes32The ID of the call.
actionsstruct IDAO.Action[]The array of actions executed.
allowFailureMapuint256The allow failure map encoding which actions are allowed to fail.
failureMapuint256The failure map encoding which actions have failed.
execResultsbytes[]The array with the results of the executed actions.

The value of callId is defined by the component/contract calling the execute function. A Plugin implementation can use it, for example, as a nonce.

event StandardCallbackRegistered

Emitted when a standard callback is registered.

event StandardCallbackRegistered(bytes4 interfaceId, bytes4 callbackSelector, bytes4 magicNumber)
InputTypeDescription
interfaceIdbytes4The ID of the interface.
callbackSelectorbytes4The selector of the callback function.
magicNumberbytes4The magic number to be registered for the callback function selector.

external function deposit

Deposits (native) tokens to the DAO contract with a reference string.

function deposit(address _token, uint256 _amount, string _reference) external payable
InputTypeDescription
_tokenaddressThe address of the token or address(0) in case of the native token.
_amountuint256The amount of tokens to deposit.
_referencestringThe reference describing the deposit reason.

event Deposited

Emitted when a token deposit has been made to the DAO.

event Deposited(address sender, address token, uint256 amount, string _reference)
InputTypeDescription
senderaddressThe address of the sender.
tokenaddressThe address of the deposited token.
amountuint256The amount of tokens deposited.
_referencestringThe reference describing the deposit reason.

event NativeTokenDeposited

Emitted when a native token deposit has been made to the DAO.

event NativeTokenDeposited(address sender, uint256 amount)
InputTypeDescription
senderaddressThe address of the sender.
amountuint256The amount of native tokens deposited.

This event is intended to be emitted in the receive function and is therefore bound by the gas limitations for send/transfer calls introduced by ERC-2929.

external function setTrustedForwarder

Setter for the trusted forwarder verifying the meta transaction.

function setTrustedForwarder(address _trustedForwarder) external
InputTypeDescription
_trustedForwarderaddressThe trusted forwarder address.

external function getTrustedForwarder

Getter for the trusted forwarder verifying the meta transaction.

function getTrustedForwarder() external view returns (address)
OutputTypeDescription
0addressThe trusted forwarder address.

event TrustedForwarderSet

Emitted when a new TrustedForwarder is set on the DAO.

event TrustedForwarderSet(address forwarder)
InputTypeDescription
forwarderaddressthe new forwarder address.

external function isValidSignature

Checks whether a signature is valid for a provided hash according to ERC-1271.

function isValidSignature(bytes32 _hash, bytes _signature) external returns (bytes4)
InputTypeDescription
_hashbytes32The hash of the data to be signed.
_signaturebytesThe signature byte array associated with _hash.
Output
0bytes4Returns the bytes4 magic value 0x1626ba7e if the signature is valid and 0xffffffff if not.

external function registerStandardCallback

Registers an ERC standard having a callback by registering its ERC-165 interface ID and callback function signature.

function registerStandardCallback(bytes4 _interfaceId, bytes4 _callbackSelector, bytes4 _magicNumber) external
InputTypeDescription
_interfaceIdbytes4The ID of the interface.
_callbackSelectorbytes4The selector of the callback function.
_magicNumberbytes4The magic number to be registered for the function signature.

external function setSignatureValidator

Removed function being left here to not corrupt the IDAO interface ID. Any call will revert.

function setSignatureValidator(address) external

Introduced in v1.0.0. Removed in v1.4.0.

© 2025