Core Contracts API
The natspec generated API for the core contracts. You can also find the contracts on the following repository.
Core
DAO
Public API of the Aragon DAO framework.
NativeTokenDepositAmountMismatch(uint256 expected, uint256 actual) error
Thrown if there is a mismatch between the expected and actually deposited amount of native tokens.
ProtocolVersionUpgradeNotSupported(uint8[3] protocolVersion) error
Thrown if an upgrade is not supported from a specific protocol version .
initialize(bytes _metadata, address _initialOwner, address _trustedForwarder, string daoURI_) external
Initializes the DAO by - setting the reentrancy status variable to _NOT_ENTERED - registering the [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID - setting the trusted forwarder for meta transactions - giving the ROOT_PERMISSION_ID permission to the initial owner (that should be revoked and transferred to the DAO after setup).
This method is required to support [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822).
initializeFrom(uint8[3] _previousProtocolVersion, bytes _initData) external
Initializes the DAO after an upgrade from a previous protocol version.
setTrustedForwarder(address _newTrustedForwarder) external
Setter for the trusted forwarder verifying the meta transaction.
getTrustedForwarder() → address external
Getter for the trusted forwarder verifying the meta transaction.
hasPermission(address _where, address _who, bytes32 _permissionId, bytes _data) → bool external
Checks if an address has permission on a contract via a permission identifier and considers if ANY_ADDRESS was used in the granting process.
execute(bytes32 _callId, struct Action[] _actions, uint256 _allowFailureMap) → bytes[] execResults, uint256 failureMap external
deposit(address _token, uint256 _amount, string _reference) external
Deposits (native) tokens to the DAO contract with a reference string.
setSignatureValidator(address) external
Removed function being left here to not corrupt the IDAO interface ID. Any call will revert.
Introduced in v1.0.0. Removed in v1.4.0.
isValidSignature(bytes32 _hash, bytes _signature) → bytes4 external
Checks whether a signature is valid for a provided hash according to [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271).
Relays the validation logic determining who is allowed to sign on behalf of the DAO to its permission manager. Caller specific bypassing can be set direct granting (i.e., grant({_where: dao, _who: specificErc1271Caller, _permissionId: VALIDATE_SIGNATURE_PERMISSION_ID})). Caller specific signature validation logic can be set by granting with a PermissionCondition (i.e., grantWithCondition({_where: dao, _who: specificErc1271Caller, _permissionId: VALIDATE_SIGNATURE_PERMISSION_ID, _condition: yourConditionImplementation})) Generic signature validation logic can be set for all calling contracts by granting with a PermissionCondition to PermissionManager.ANY_ADDR() (i.e., grantWithCondition({_where: dao, _who: PermissionManager.ANY_ADDR(), _permissionId: VALIDATE_SIGNATURE_PERMISSION_ID, _condition: yourConditionImplementation})).
registerStandardCallback(bytes4 _interfaceId, bytes4 _callbackSelector, bytes4 _magicNumber) external
Registers an ERC standard having a callback by registering its [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID and callback function signature.
daoURI() → string external
A distinct Uniform Resource Identifier (URI) pointing to a JSON object following the "EIP-4824 DAO JSON-LD Schema". This JSON file splits into four URIs: membersURI, proposalsURI, activityLogURI, and governanceURI. The membersURI should point to a JSON file that conforms to the "EIP-4824 Members JSON-LD Schema". The proposalsURI should point to a JSON file that conforms to the "EIP-4824 Proposals JSON-LD Schema". The activityLogURI should point to a JSON file that conforms to the "EIP-4824 Activity Log JSON-LD Schema". The governanceURI should point to a flatfile, normatively a .md file. Each of the JSON files named above can be statically hosted or dynamically-generated.
IDAO
The interface required for DAOs within the Aragon App DAO framework.
hasPermission(address _where, address _who, bytes32 _permissionId, bytes _data) → bool external
Checks if an address has permission on a contract via a permission identifier and considers if ANY_ADDRESS was used in the granting process.
StandardCallbackRegistered(bytes4 interfaceId, bytes4 callbackSelector, bytes4 magicNumber) event
Emitted when a standard callback is registered.
deposit(address _token, uint256 _amount, string _reference) external
Deposits (native) tokens to the DAO contract with a reference string.
Deposited(address sender, address token, uint256 amount, string _reference) event
Emitted when a token deposit has been made to the DAO.
NativeTokenDeposited(address sender, uint256 amount) event
Emitted when a native token deposit has been made to the DAO.
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](https://eips.ethereum.org/EIPS/eip-2929).
setTrustedForwarder(address _trustedForwarder) external
Setter for the trusted forwarder verifying the meta transaction.
getTrustedForwarder() → address external
Getter for the trusted forwarder verifying the meta transaction.
isValidSignature(bytes32 _hash, bytes _signature) → bytes4 external
Checks whether a signature is valid for a provided hash according to [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271).
registerStandardCallback(bytes4 _interfaceId, bytes4 _callbackSelector, bytes4 _magicNumber) external
Registers an ERC standard having a callback by registering its [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID and callback function signature.
PermissionManager
The abstract permission manager used in a DAO, its associated plugins, and other framework-related components.
Unauthorized(address where, address who, bytes32 permissionId) error
Thrown if a call is unauthorized.
PermissionAlreadyGrantedForDifferentCondition(address where, address who, bytes32 permissionId, address currentCondition, address newCondition) error
Thrown if a permission has been already granted with a different condition.
This makes sure that condition on the same permission can not be overwriten by a different condition.
PermissionsForAnyAddressDisallowed() error
Thrown for ROOT_PERMISSION_ID or EXECUTE_PERMISSION_ID permission grants where who or where is ANY_ADDR.
AnyAddressDisallowedForWhoAndWhere() error
Thrown for permission grants where who and where are both ANY_ADDR.
GrantWithConditionNotSupported() error
Thrown if Operation.GrantWithCondition is requested as an operation but the method does not support it.
Granted(bytes32 permissionId, address here, address where, address who, address condition) event
Emitted when a permission permission is granted in the context here to the address _who for the contract _where.
Revoked(bytes32 permissionId, address here, address where, address who) event
Emitted when a permission permission is revoked in the context here from the address _who for the contract _where.
grant(address _where, address _who, bytes32 _permissionId) external
Grants permission to an address to call methods in a contract guarded by an auth modifier with the specified permission identifier.
Requires the ROOT_PERMISSION_ID permission.Note, that granting permissions with _who or _where equal to ANY_ADDR does not replace other permissions with specific _who and _where addresses that exist in parallel.
grantWithCondition(address _where, address _who, bytes32 _permissionId, contract IPermissionCondition _condition) external
revoke(address _where, address _who, bytes32 _permissionId) external
Revokes permission from an address to call methods in a target contract guarded by an auth modifier with the specified permission identifier.
Requires the ROOT_PERMISSION_ID permission.Note, that revoking permissions with _who or _where equal to ANY_ADDR does not revoke other permissions with specific _who and _where addresses that exist in parallel.
applySingleTargetPermissions(address _where, struct PermissionLib.SingleTargetPermission[] items) external
isGranted(address _where, address _who, bytes32 _permissionId, bytes _data) → bool public
Checks if the caller address has permission on the target contract via a permission identifier and relays the answer to a condition contract if this was declared during the granting process.
_checkCondition(address _condition, address _where, address _who, bytes32 _permissionId, bytes _data) → bool internal
CallbackHandler
This callback handling functionality is intended to be used by executor contracts (i.e., DAO.sol).
UnknownCallback(bytes4 callbackSelector, bytes4 magicNumber) error
Thrown if the callback function is not registered.