Skip to content

IDAO ​

Interface · src/common/dao/IDAO.sol

Explained in: The DAO contract

Author: Aragon X - 2022-2024

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

security-contact: sirt@aragon.org

Functions ​

deposit ​

solidity
function deposit(address _token, uint256 _amount, string _reference) external payable

Selector: 0xbfe07da6

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

ParameterTypeDescription
_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.

getTrustedForwarder ​

solidity
function getTrustedForwarder() external view returns (address)

Selector: 0xce1b815f

Getter for the trusted forwarder verifying the meta transaction.

hasPermission ​

solidity
function hasPermission(
    address _where,
    address _who,
    bytes32 _permissionId,
    bytes _data
) external view returns (bool)

Selector: 0xfdef9106

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

ParameterTypeDescription
_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.

isValidSignature ​

solidity
function isValidSignature(bytes32 _hash, bytes _signature) external returns (bytes4)

Selector: 0x1626ba7e

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

ParameterTypeDescription
_hashbytes32The hash of the data to be signed.
_signaturebytesThe signature byte array associated with _hash.

registerStandardCallback ​

solidity
function registerStandardCallback(
    bytes4 _interfaceId,
    bytes4 _callbackSelector,
    bytes4 _magicNumber
) external

Selector: 0xc4a50145

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

ParameterTypeDescription
_interfaceIdbytes4The ID of the interface.
_callbackSelectorbytes4The selector of the callback function.
_magicNumberbytes4The magic number to be registered for the function signature.

setMetadata ​

solidity
function setMetadata(bytes _metadata) external

Selector: 0xee57e36f

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

ParameterTypeDescription
_metadatabytesThe IPFS hash of the new metadata object.

setSignatureValidator ​

solidity
function setSignatureValidator(address) external

Selector: 0x3e2ab0d9

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

Dev: Introduced in v1.0.0. Removed in v1.4.0.

setTrustedForwarder ​

solidity
function setTrustedForwarder(address _trustedForwarder) external

Selector: 0xda742228

Setter for the trusted forwarder verifying the meta transaction.

ParameterTypeDescription
_trustedForwarderaddressThe trusted forwarder address.

Events ​

Deposited ​

solidity
event Deposited(
    address indexed sender,
    address indexed token,
    uint256 amount,
    string _reference
)

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

ParameterTypeDescription
senderaddressThe address of the sender.
tokenaddressThe address of the deposited token.
amountuint256The amount of tokens deposited.
_referencestringThe reference describing the deposit reason.

MetadataSet ​

solidity
event MetadataSet(bytes metadata)

Emitted when the DAO metadata is updated.

ParameterTypeDescription
metadatabytesThe IPFS hash of the new metadata object.

NativeTokenDeposited ​

solidity
event NativeTokenDeposited(address sender, uint256 amount)

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

Dev: 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.

ParameterTypeDescription
senderaddressThe address of the sender.
amountuint256The amount of native tokens deposited.

StandardCallbackRegistered ​

solidity
event StandardCallbackRegistered(
    bytes4 interfaceId,
    bytes4 callbackSelector,
    bytes4 magicNumber
)

Emitted when a standard callback is registered.

ParameterTypeDescription
interfaceIdbytes4The ID of the interface.
callbackSelectorbytes4The selector of the callback function.
magicNumberbytes4The magic number to be registered for the callback function selector.

TrustedForwarderSet ​

solidity
event TrustedForwarderSet(address forwarder)

Emitted when a new TrustedForwarder is set on the DAO.

ParameterTypeDescription
forwarderaddressthe new forwarder address.