Skip to content

SelectorCondition ​

Contract · src/SelectorCondition.sol

Explained in: SelectorCondition

Author: AragonX 2025

Inherits: ERC165, IPermissionCondition, DaoAuthorizable

A permission that only allows a specified group of function selectors to be invoked within DAO.execute()

Constructor ​

constructor ​

solidity
constructor(IDAO _dao, bytes4[] _initialSelectors)

Functions ​

allowedSelectors ​

solidity
function allowedSelectors(bytes4) external view returns (bool)

Selector: 0x85f168eb

allowSelector ​

solidity
function allowSelector(bytes4 _selector) external

Selector: 0x932b3d68

Marks the given selector as allowed

ParameterTypeDescription
_selectorbytes4The function selector to start allowing

dao ​

solidity
function dao() external view returns (IDAO)

Selector: 0x4162169f

Returns the DAO contract.

disallowSelector ​

solidity
function disallowSelector(bytes4 _selector) external

Selector: 0x1611ce60

Marks the given selector as disallowed

ParameterTypeDescription
_selectorbytes4The function selector to stop allowing

isGranted ​

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

Selector: 0x2675fdd0

Checks if a call is permitted.

ParameterTypeDescription
_whereaddressThe address of the target contract.
_whoaddressThe address (EOA or contract) for which the permissions are checked.
_permissionIdbytes32The permission identifier.
_databytesOptional data passed to the PermissionCondition implementation.
ReturnsTypeDescription
isPermittedboolReturns true if the call is permitted.

supportsInterface ​

solidity
function supportsInterface(bytes4 _interfaceId) external view returns (bool)

Selector: 0x01ffc9a7

Checks if an interface is supported by this or its parent contract.

ParameterTypeDescription
_interfaceIdbytes4The ID of the interface.

Events ​

SelectorAllowed ​

solidity
event SelectorAllowed(bytes4 selector)

SelectorDisallowed ​

solidity
event SelectorDisallowed(bytes4 selector)

Errors ​

AlreadyAllowed ​

solidity
error AlreadyAllowed(bytes4 selector)

AlreadyDisallowed ​

solidity
error AlreadyDisallowed(bytes4 selector)

DaoUnauthorized ​

solidity
error DaoUnauthorized(address dao, address where, address who, bytes32 permissionId)

Thrown if a call is unauthorized in the associated DAO.

ParameterTypeDescription
daoaddressThe associated DAO.
whereaddressThe context in which the authorization reverted.
whoaddressThe address (EOA or contract) missing the permission.
permissionIdbytes32The permission identifier.

Constants ​

Public, so each is also readable through a generated getter.

MANAGE_SELECTORS_PERMISSION_ID ​

solidity
bytes32 public constant MANAGE_SELECTORS_PERMISSION_ID = keccak256("MANAGE_SELECTORS_PERMISSION");

Value: 0x485a22b473de7ee3091c71c5ce05019fd1466a1650b1228784a9bcd5b7bed510