BusinessLogicResolver
Asset Tokenization Studio Team
Business Logic Resolver
Maintains versioned business logic registrations and resolver-proxy configurations.
Combines business-logic version resolution with diamond-cut configuration management. Initialisation grants the default admin role to the caller and must occur once.
Methods
acceptOwnership
function acceptOwnership(bytes32 _configId) external nonpayable
Finalises an ownership handover initiated by the current owner.
Gated by {onlyUnpaused} and {onlyConfigurationPendingOwner}: only the nominated pending owner can finalise the handover, and only while the diamond is unpaused. Snapshots the outgoing owner via {_getOwner} before overwriting it, promotes the caller to owner via {_setOwner}, and clears the pending slot via {_removePendingOwner}. Emits {OwnershipAccepted} with the captured previous owner and the caller as the new owner.
Parameters
| Name | Type | Description |
|---|---|---|
| _configId | bytes32 | Configuration whose pending handover is being accepted. |
addSelectorsToBlacklist
function addSelectorsToBlacklist(bytes32 _configurationId, bytes4[] _selectors) external nonpayable
Adds a list of selectors to the blacklist
Restricted to default admins while unpaused. Blacklisted selectors are rejected when future configurations register facet selectors for the same configuration.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | the configuration key to be checked. |
| _selectors | bytes4[] | list of selectors to be added to the blacklist |
applyRoles
function applyRoles(bytes32[] _roles, bool[] _actives, address _account) external nonpayable
Applies multiple role grants or revocations to an account in a single transaction.
Requires the token to be unpaused, equal-length arrays, and no duplicate role entries. Per-role admin checks are enforced inside the storage layer.
Parameters
| Name | Type | Description |
|---|---|---|
| _roles | bytes32[] | Array of role identifiers to process. |
| _actives | bool[] | Corresponding flags; true grants the role, false revokes it. |
| _account | address | The account to which roles are applied. |
cancelBatchConfiguration
function cancelBatchConfiguration(bytes32 _configurationId) external nonpayable
Discards an in-progress batch configuration, dropping every facet appended so far for the pending version.
Emits {DiamondBatchConfigurationCancelled}. Has no effect once the version has been finalised via a _isLastBatch = true call.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | Configuration key whose pending batch should be cancelled. |
checkResolverProxyConfigurationRegistered
function checkResolverProxyConfigurationRegistered(bytes32 _configurationId, uint256 _version) external view
Reverts if the (configurationId, version) pair is not a registered, finalised configuration.
Intended to gate resolver-proxy operations; reverts with {ResolverProxyConfigurationNoRegistered} when the lookup fails.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | Configuration key to verify. |
| _version | uint256 | Version to verify; must be > 0. Read {getLatestVersionByConfiguration} first when the latest is required. |
createBatchConfiguration
function createBatchConfiguration(bytes32 _configurationId, IDiamondCutManager.FacetConfiguration[] _facetConfigurations, bool _isLastBatch, bytes _data) external nonpayable
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | undefined |
| _facetConfigurations | IDiamondCutManager.FacetConfiguration[] | undefined |
| _isLastBatch | bool | undefined |
| _data | bytes | undefined |
createConfiguration
function createConfiguration(bytes32 _configurationId, IDiamondCutManager.FacetConfiguration[] _facetConfigurations, bytes _data) external nonpayable
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | undefined |
| _facetConfigurations | IDiamondCutManager.FacetConfiguration[] | undefined |
| _data | bytes | undefined |
getBusinessLogicCount
function getBusinessLogicCount() external view returns (uint256 businessLogicCount_)
Returns the total number of business logic keys currently registered in the resolver.
Returns
| Name | Type | Description |
|---|---|---|
| businessLogicCount_ | uint256 | The count of registered business logic keys. |
getBusinessLogicKeys
function getBusinessLogicKeys(uint256 _pageIndex, uint256 _pageLength) external view returns (bytes32[] businessLogicKeys_)
Returns a list of business logic keys
Parameters
| Name | Type | Description |
|---|---|---|
| _pageIndex | uint256 | members to skip : _pageIndex * _pageLength |
| _pageLength | uint256 | number of members to return |
Returns
| Name | Type | Description |
|---|---|---|
| businessLogicKeys_ | bytes32[] | list of business logic keys |
getConfigurations
function getConfigurations(uint256 _pageIndex, uint256 _pageLength) external view returns (bytes32[] configurationIds_)
Returns a paginated slice of registered configuration ids.
Pagination is used to keep gas bounded on large registries; out-of-range pages return an empty array rather than reverting.
Parameters
| Name | Type | Description |
|---|---|---|
| _pageIndex | uint256 | Page index; entries skipped equal _pageIndex * _pageLength. |
| _pageLength | uint256 | Maximum number of entries to return. |
Returns
| Name | Type | Description |
|---|---|---|
| configurationIds_ | bytes32[] | Slice of configuration ids for the requested page. |
getConfigurationsLength
function getConfigurationsLength() external view returns (uint256 configurationsLength_)
Returns the number of distinct configuration keys registered in the manager.
Returns
| Name | Type | Description |
|---|---|---|
| configurationsLength_ | uint256 | Total count of registered configuration ids. |
getFacetAddressByConfigurationIdVersionAndFacetId
function getFacetAddressByConfigurationIdVersionAndFacetId(bytes32 _configurationId, uint256 _version, bytes32 _facetId) external view returns (address facetAddress_)
Returns the address of a facet inside a configuration version.
Returns address(0) when the facet is not part of the configuration version.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | Configuration key to query. |
| _version | uint256 | Version to query; must be > 0. Read {getLatestVersionByConfiguration} first when the latest is required. |
| _facetId | bytes32 | Facet key to look up. |
Returns
| Name | Type | Description |
|---|---|---|
| facetAddress_ | address | Address of the facet, or address(0) if unregistered. |
getFacetAddressesByConfigurationIdAndVersion
function getFacetAddressesByConfigurationIdAndVersion(bytes32 _configurationId, uint256 _version, uint256 _pageIndex, uint256 _pageLength) external view returns (address[] facetAddresses_)
Returns a paginated slice of facet addresses registered for a configuration version.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | Configuration key to query. |
| _version | uint256 | Version to query; must be > 0. Read {getLatestVersionByConfiguration} first when the latest is required. |
| _pageIndex | uint256 | Page index; entries skipped equal _pageIndex * _pageLength. |
| _pageLength | uint256 | Maximum number of entries to return. |
Returns
| Name | Type | Description |
|---|---|---|
| facetAddresses_ | address[] | Slice of facet addresses for the requested page. |
getFacetByConfigurationIdVersionAndFacetId
function getFacetByConfigurationIdVersionAndFacetId(bytes32 _configurationId, uint256 _version, bytes32 _facetId) external view returns (struct IDiamondLoupe.Facet facet_)
Returns the full facet record (id, address, selectors, interface ids) for a facet inside a configuration version.
Returns a zero-valued {IDiamondLoupe.Facet} when the facet is not part of the configuration version.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | Configuration key to query. |
| _version | uint256 | Version to query; must be > 0. Read {getLatestVersionByConfiguration} first when the latest is required. |
| _facetId | bytes32 | Facet key to look up. |
Returns
| Name | Type | Description |
|---|---|---|
| facet_ | IDiamondLoupe.Facet | Facet record for _facetId. |
getFacetConfigurationsByConfigurationIdAndVersion
function getFacetConfigurationsByConfigurationIdAndVersion(bytes32 _configurationId, uint256 _version, uint256 _start, uint256 _end) external view returns (struct IDiamondCutManager.FacetConfiguration[] facetConfigurations_)
Returns the (facet id, facet version) tuples registered for a configuration version over a half-open index range.
Slice semantics differ from the page-based helpers: _start is inclusive and _end is exclusive, allowing callers to express arbitrary windows.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | Configuration key to query. |
| _version | uint256 | Version to query; must be > 0. Read {getLatestVersionByConfiguration} first when the latest is required. |
| _start | uint256 | Inclusive start index of the slice. |
| _end | uint256 | Exclusive end index of the slice. |
Returns
| Name | Type | Description |
|---|---|---|
| facetConfigurations_ | IDiamondCutManager.FacetConfiguration[] | Slice of {FacetConfiguration} entries for the window. |
getFacetIdByConfigurationIdVersionAndSelector
function getFacetIdByConfigurationIdVersionAndSelector(bytes32 _configurationId, uint256 _version, bytes4 _selector) external view returns (bytes32 facetId_)
Returns the facet id that owns a selector inside a configuration version.
Returns bytes32(0) when the selector is not registered.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | Configuration key to query. |
| _version | uint256 | Version to query; must be > 0. Read {getLatestVersionByConfiguration} first when the latest is required. |
| _selector | bytes4 | Selector to look up. |
Returns
| Name | Type | Description |
|---|---|---|
| facetId_ | bytes32 | Facet id owning _selector, or bytes32(0) if none. |
getFacetIdsByConfigurationIdAndVersion
function getFacetIdsByConfigurationIdAndVersion(bytes32 _configurationId, uint256 _version, uint256 _pageIndex, uint256 _pageLength) external view returns (bytes32[] facetIds_)
Returns a paginated slice of facet ids registered for a configuration version.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | Configuration key to query. |
| _version | uint256 | Version to query; must be > 0. Read {getLatestVersionByConfiguration} first when the latest is required. |
| _pageIndex | uint256 | Page index; entries skipped equal _pageIndex * _pageLength. |
| _pageLength | uint256 | Maximum number of entries to return. |
Returns
| Name | Type | Description |
|---|---|---|
| facetIds_ | bytes32[] | Slice of facet ids for the requested page. |
getFacetSelectorsByConfigurationIdVersionAndFacetId
function getFacetSelectorsByConfigurationIdVersionAndFacetId(bytes32 _configurationId, uint256 _version, bytes32 _facetId, uint256 _pageIndex, uint256 _pageLength) external view returns (bytes4[] facetSelectors_)
Returns a paginated slice of selectors registered for a facet inside a configuration version.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | Configuration key to query. |
| _version | uint256 | Version to query; must be > 0. Read {getLatestVersionByConfiguration} first when the latest is required. |
| _facetId | bytes32 | Facet key whose selectors are returned. |
| _pageIndex | uint256 | Page index; entries skipped equal _pageIndex * _pageLength. |
| _pageLength | uint256 | Maximum number of entries to return. |
Returns
| Name | Type | Description |
|---|---|---|
| facetSelectors_ | bytes4[] | Slice of selectors for the requested page. |
getFacetSelectorsLengthByConfigurationIdVersionAndFacetId
function getFacetSelectorsLengthByConfigurationIdVersionAndFacetId(bytes32 _configurationId, uint256 _version, bytes32 _facetId) external view returns (uint256 facetSelectorsLength_)
Returns the number of selectors registered for a facet inside a configuration version.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | Configuration key to query. |
| _version | uint256 | Version to query; must be > 0. Read {getLatestVersionByConfiguration} first when the latest is required. |
| _facetId | bytes32 | Facet key whose selectors are counted. |
Returns
| Name | Type | Description |
|---|---|---|
| facetSelectorsLength_ | uint256 | Count of selectors owned by the facet in the version. |
getFacetVersionByConfigurationIdVersionAndFacetId
function getFacetVersionByConfigurationIdVersionAndFacetId(bytes32 _configurationId, uint256 _version, bytes32 _facetId) external view returns (uint256 facetVersion_)
Returns the pinned facet version stored inside a configuration version.
Reverts with {FacetIdNotRegistered} when the facet is not part of the configuration version, and with {VersionZero} when _version is 0.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | Configuration key to query. |
| _version | uint256 | Version to query; must be > 0. Read {getLatestVersionByConfiguration} first when the latest is required. |
| _facetId | bytes32 | Facet key to look up. |
Returns
| Name | Type | Description |
|---|---|---|
| facetVersion_ | uint256 | Pinned facet version inside the configuration version. |
getFacetsByConfigurationIdAndVersion
function getFacetsByConfigurationIdAndVersion(bytes32 _configurationId, uint256 _version, uint256 _pageIndex, uint256 _pageLength) external view returns (struct IDiamondLoupe.Facet[] facets_)
Returns a paginated slice of facets for a configuration version, including each facet's address, selectors, and advertised interface ids.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | Configuration key to query. |
| _version | uint256 | Version to query; must be > 0. Read {getLatestVersionByConfiguration} first when the latest is required. |
| _pageIndex | uint256 | Page index; entries skipped equal _pageIndex * _pageLength. |
| _pageLength | uint256 | Maximum number of entries to return. |
Returns
| Name | Type | Description |
|---|---|---|
| facets_ | IDiamondLoupe.Facet[] | Slice of {IDiamondLoupe.Facet} entries for the requested page. |
getFacetsLengthByConfigurationIdAndVersion
function getFacetsLengthByConfigurationIdAndVersion(bytes32 _configurationId, uint256 _version) external view returns (uint256 facetsLength_)
Returns the number of facets registered under a configuration version.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | Configuration key to query. |
| _version | uint256 | Version to query; must be > 0. Read {getLatestVersionByConfiguration} first when the latest is required. |
Returns
| Name | Type | Description |
|---|---|---|
| facetsLength_ | uint256 | Count of facets in the configuration version. |
getLatestVersion
function getLatestVersion(bytes32 _businessLogicKey) external view returns (uint256 latestVersion_)
Returns the latest registered version for the given business logic key.
Parameters
| Name | Type | Description |
|---|---|---|
| _businessLogicKey | bytes32 | The bytes32 key identifying the business logic to query. |
Returns
| Name | Type | Description |
|---|---|---|
| latestVersion_ | uint256 | The latest registered version for that key; 0 if never registered. |
getLatestVersionByConfiguration
function getLatestVersionByConfiguration(bytes32 _configurationId) external view returns (uint256 latestVersion_)
Returns the latest registered version of a configuration.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | Configuration key to query. |
Returns
| Name | Type | Description |
|---|---|---|
| latestVersion_ | uint256 | Latest finalised version, or 0 when no version is registered. |
getLatestVersions
function getLatestVersions(bytes32[] _businessLogicKeys) external view returns (uint256[] latestVersions_)
Batched variant of getLatestVersion that resolves many keys in a single call.
Iterates over all supplied keys and returns zero for keys with no registered version.
Parameters
| Name | Type | Description |
|---|---|---|
| _businessLogicKeys | bytes32[] | keys of the business logics to query. |
Returns
| Name | Type | Description |
|---|---|---|
| latestVersions_ | uint256[] | latest version per key, in the same order as _businessLogicKeys. |
getOwner
function getOwner(bytes32 _configId) external view returns (address owner_)
Returns the current owner of a configuration.
Parameters
| Name | Type | Description |
|---|---|---|
| _configId | bytes32 | Configuration to query. |
Returns
| Name | Type | Description |
|---|---|---|
| owner_ | address | Address that currently owns configId, or the zero address when no owner has been recorded. |
getPendingOwner
function getPendingOwner(bytes32 _configId) external view returns (address pendingOwner_)
Returns the pending owner of a configuration, if any.
Parameters
| Name | Type | Description |
|---|---|---|
| _configId | bytes32 | Configuration to query. |
Returns
| Name | Type | Description |
|---|---|---|
| pendingOwner_ | address | Address currently nominated to accept ownership, or the zero address when no transfer is in flight. |
getReplacementAddress
function getReplacementAddress(address _replacedAddress) external view returns (address replacementAddress_)
Returns the replacement address for a given address, or address(0) if none exists
Parameters
| Name | Type | Description |
|---|---|---|
| _replacedAddress | address | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| replacementAddress_ | address | the replacement address, or address(0) if none exists |
getRoleCountFor
function getRoleCountFor(address _account) external view returns (uint256 roleCount_)
Returns the number of roles currently assigned to an account.
Parameters
| Name | Type | Description |
|---|---|---|
| _account | address | The account to query. |
Returns
| Name | Type | Description |
|---|---|---|
| roleCount_ | uint256 | The number of roles held by _account. |
getRoleMemberCount
function getRoleMemberCount(bytes32 _role) external view returns (uint256 memberCount_)
Returns the number of accounts currently holding a role.
Parameters
| Name | Type | Description |
|---|---|---|
| _role | bytes32 | The role identifier to query. |
Returns
| Name | Type | Description |
|---|---|---|
| memberCount_ | uint256 | The number of accounts assigned to _role. |
getRoleMembers
function getRoleMembers(bytes32 _role, uint256 _pageIndex, uint256 _pageLength) external view returns (address[] members_)
Returns a paginated slice of accounts holding a role.
_The list offset is computed as \_pageIndex _ \_pageLength. Returns an empty array when the offset meets or exceeds the member count for the role.*
Parameters
| Name | Type | Description |
|---|---|---|
| _role | bytes32 | The role identifier to query. |
| _pageIndex | uint256 | Zero-based page index. |
| _pageLength | uint256 | Maximum number of addresses to return per page. |
Returns
| Name | Type | Description |
|---|---|---|
| members_ | address[] | Array of account addresses holding _role for the requested page. |
getRolesFor
function getRolesFor(address _account, uint256 _pageIndex, uint256 _pageLength) external view returns (bytes32[] roles_)
Returns a paginated slice of roles assigned to an account.
_The list offset is computed as \_pageIndex _ \_pageLength. Returns an empty array when the offset meets or exceeds the role count for the account.*
Parameters
| Name | Type | Description |
|---|---|---|
| _account | address | The account to query. |
| _pageIndex | uint256 | Zero-based page index. |
| _pageLength | uint256 | Maximum number of roles to return per page. |
Returns
| Name | Type | Description |
|---|---|---|
| roles_ | bytes32[] | Array of role identifiers held by _account for the requested page. |
getSelectorsBlacklist
function getSelectorsBlacklist(bytes32 _configurationId, uint256 _pageIndex, uint256 _pageLength) external view returns (bytes4[] selectors_)
Returns the list of selectors in the blacklist
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | the configuration key to be checked. |
| _pageIndex | uint256 | members to skip : _pageIndex * _pageLength |
| _pageLength | uint256 | number of members to return |
Returns
| Name | Type | Description |
|---|---|---|
| selectors_ | bytes4[] | List of the selectors in the blacklist |
getVersionStatus
function getVersionStatus(bytes32 _businessLogicKey, uint256 _version) external view returns (enum IBusinessLogicResolver.VersionStatus status_)
Returns the current status of a given version for a business logic key.
Parameters
| Name | Type | Description |
|---|---|---|
| _businessLogicKey | bytes32 | The bytes32 key identifying the business logic to query. |
| _version | uint256 | The version number to inspect. |
Returns
| Name | Type | Description |
|---|---|---|
| status_ | enum IBusinessLogicResolver.VersionStatus | The VersionStatus (NONE, ACTIVATED, or DEACTIVATED) for that version. |
grantRole
function grantRole(bytes32 _role, address _account) external nonpayable returns (bool success_)
Grants a role to an account.
Requires the token to be unpaused and the caller to hold the admin role of _role.
Parameters
| Name | Type | Description |
|---|---|---|
| _role | bytes32 | The role identifier to grant. |
| _account | address | The account to receive the role. |
Returns
| Name | Type | Description |
|---|---|---|
| success_ | bool | True if the role was successfully granted. |
hasRole
function hasRole(bytes32 _role, address _account) external view returns (bool)
Checks whether an account holds a specific role.
Parameters
| Name | Type | Description |
|---|---|---|
| _role | bytes32 | The role identifier to check. |
| _account | address | The account to check. |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | True if _account holds _role, false otherwise. |
initializeAccessControl
function initializeAccessControl() external nonpayable
Initialises the AccessControl capability on the token.
Callable once; subsequent calls revert with FacetAlreadyRegistered. Requires DEFAULT_ADMIN_ROLE. Called by the factory during deployment.
initializeBusinessLogicResolver
function initializeBusinessLogicResolver() external nonpayable returns (bool success_)
Initialises the Business Logic Resolver storage. Must be called once before any registration operations; subsequent calls revert.
Grants DEFAULT_ADMIN_ROLE to the current EVM sender and marks the resolver as initialised before emitting BusinessLogicResolverInitialized.
Returns
| Name | Type | Description |
|---|---|---|
| success_ | bool | True when initialisation succeeds without reverting. |
initializePause
function initializePause() external nonpayable
Initialises the pause capability on the token.
Callable once; subsequent calls revert with FacetAlreadyRegistered. Requires DEFAULT_ADMIN_ROLE. Called by the factory during deployment.
isBusinessLogicResolver
function isBusinessLogicResolver() external pure returns (bool isBusinessLogicResolver_)
Identity marker used to confirm a candidate address is a genuine IBusinessLogicResolver, checked via low-level call() rather than a direct interface call (see DiamondCut::onlyValidBusinessLogicResolver).
Returns
| Name | Type | Description |
|---|---|---|
| isBusinessLogicResolver_ | bool | Always true for a real BusinessLogicResolver. |
isResolverProxyConfigurationRegistered
function isResolverProxyConfigurationRegistered(bytes32 _configurationId, uint256 _version) external view returns (bool isRegistered_)
Non-reverting variant of {checkResolverProxyConfigurationRegistered}.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | Configuration key to check. |
| _version | uint256 | Version to check; must be > 0. Read {getLatestVersionByConfiguration} first when the latest is required. |
Returns
| Name | Type | Description |
|---|---|---|
| isRegistered_ | bool | True when the configuration version is registered and finalised. |
pause
function pause() external nonpayable returns (bool success_)
Sets the token's internal pause flag, blocking all guarded operations.
Requires ROLE_PAUSER and the token to be currently unpaused. Reverts with IsPaused if the token is already paused. Emits Paused.
Returns
| Name | Type | Description |
|---|---|---|
| success_ | bool | True if the token was successfully paused. |
paused
function paused() external view returns (bool)
Checks whether the token is currently paused.
Returns true if the token's own pause flag is set, or if any registered external pause contract returns true from its isPaused() call (OR semantics). created to be compatible with ERC3643
Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | True if the token is paused by any source, false otherwise. |
registerBusinessLogics
function registerBusinessLogics(IBusinessLogicResolver.BusinessLogicRegistryData[] _businessLogics) external nonpayable
Parameters
| Name | Type | Description |
|---|---|---|
| _businessLogics | IBusinessLogicResolver.BusinessLogicRegistryData[] | undefined |
removeReplacementAddress
function removeReplacementAddress(address _replacedAddress) external nonpayable
Removes the replacement address for a given address
Parameters
| Name | Type | Description |
|---|---|---|
| _replacedAddress | address | undefined |
removeSelectorsFromBlacklist
function removeSelectorsFromBlacklist(bytes32 _configurationId, bytes4[] _selectors) external nonpayable
Removes a list of selectors from the blacklist
Restricted to default admins while unpaused. Removing a selector only affects subsequent validation and does not mutate already activated configurations.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | the configuration key to be checked. |
| _selectors | bytes4[] | list of selectors to be removed from the blacklist |
renounceRole
function renounceRole(bytes32 _role) external nonpayable returns (bool success_)
Allows the caller to renounce a role held by their own account.
Requires the token to be unpaused. No admin role required; acts on msg.sender. Reverts with CannotRenounceSoleAdmin if the caller is the sole DEFAULT_ADMIN_ROLE holder.
Parameters
| Name | Type | Description |
|---|---|---|
| _role | bytes32 | The role identifier to renounce. |
Returns
| Name | Type | Description |
|---|---|---|
| success_ | bool | True if the role was successfully renounced. |
resolveBusinessLogicByVersion
function resolveBusinessLogicByVersion(bytes32 _businessLogicKey, uint256 _version) external view returns (address businessLogicAddress_)
Returns the implementation address for a specific version of a business logic.
Parameters
| Name | Type | Description |
|---|---|---|
| _businessLogicKey | bytes32 | Key of the business logic. Business Logic must be active. |
| _version | uint256 | The version number to resolve. |
Returns
| Name | Type | Description |
|---|---|---|
| businessLogicAddress_ | address | The implementation address registered at that version. |
resolveLatestBusinessLogic
function resolveLatestBusinessLogic(bytes32 _businessLogicKey) external view returns (address businessLogicAddress_)
Returns the business logic address for the latest version.
Parameters
| Name | Type | Description |
|---|---|---|
| _businessLogicKey | bytes32 | Key of the business logic. Business Logic must be active. |
Returns
| Name | Type | Description |
|---|---|---|
| businessLogicAddress_ | address | The implementation address registered at the latest version. |
resolveResolverProxyCall
function resolveResolverProxyCall(bytes _resolverProxyConfiguration, bytes4 _selector) external view returns (address facetAddress_)
Resolves the facet address that implements a selector for a given configuration and version.
Used by resolver proxies during dispatch. Returns address(0) when no facet claims the selector.
Parameters
| Name | Type | Description |
|---|---|---|
| _resolverProxyConfiguration | bytes | Resolver proxy full configuration. |
| _selector | bytes4 | Function selector being dispatched. |
Returns
| Name | Type | Description |
|---|---|---|
| facetAddress_ | address | Address of the facet that owns _selector, or address(0) if the selector is not registered for the given configuration/version. |
resolveResolverProxyCall
function resolveResolverProxyCall(bytes32 _configurationId, uint256 _version, bytes4 _selector) external view returns (address facetAddress_)
Resolves the facet address that implements a selector for a given configuration and version.
Used by resolver proxies during dispatch. Returns address(0) when no facet claims the selector.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | Configuration key bound to the resolver proxy. |
| _version | uint256 | Version bound to the resolver proxy; must be > 0. Read {getLatestVersionByConfiguration} first when the latest is required. |
| _selector | bytes4 | Function selector being dispatched. |
Returns
| Name | Type | Description |
|---|---|---|
| facetAddress_ | address | Address of the facet that owns _selector, or address(0) if the selector is not registered for the given configuration/version. |
resolveSupportsInterface
function resolveSupportsInterface(bytes32 _configurationId, uint256 _version, bytes4 _interfaceId) external view returns (bool exists_)
Reports whether an interface id is advertised by any facet inside the given configuration and version.
Powers ERC-165 lookups on resolver proxies.
Parameters
| Name | Type | Description |
|---|---|---|
| _configurationId | bytes32 | Configuration key bound to the resolver proxy. |
| _version | uint256 | Version bound to the resolver proxy; must be > 0. Read {getLatestVersionByConfiguration} first when the latest is required. |
| _interfaceId | bytes4 | Interface identifier to test. |
Returns
| Name | Type | Description |
|---|---|---|
| exists_ | bool | True if _interfaceId is supported by the configuration version. |
revokeRole
function revokeRole(bytes32 _role, address _account) external nonpayable returns (bool success_)
Revokes a role from an account.
Requires the token to be unpaused and the caller to hold the admin role of _role.
Parameters
| Name | Type | Description |
|---|---|---|
| _role | bytes32 | The role identifier to revoke. |
| _account | address | The account to lose the role. |
Returns
| Name | Type | Description |
|---|---|---|
| success_ | bool | True if the role was successfully revoked. |
setVersionStatus
function setVersionStatus(bytes32 _businessLogicKey, uint256 _version, enum IBusinessLogicResolver.VersionStatus _status) external nonpayable
Sets the status of a registered business logic version.
Restricted to DEFAULT_ADMIN_ROLE. Reverts with InvalidVersionStatus when _status is VersionStatus.NONE, and with BusinessLogicVersionDoesNotExist when _version is zero or has never been registered for _businessLogicKey. Marking a version DEACTIVATED prevents it from being selected into any new resolver-proxy configuration, but does not affect configurations that already reference it.
Parameters
| Name | Type | Description |
|---|---|---|
| _businessLogicKey | bytes32 | The bytes32 key identifying the business logic to update. |
| _version | uint256 | The version number to update. |
| _status | enum IBusinessLogicResolver.VersionStatus | The new status (ACTIVATED or DEACTIVATED) to assign to the version. |
transferOwnership
function transferOwnership(bytes32 _configId, address _newOwner) external nonpayable
Nominates _newOwner as the pending owner of _configId.
Gated by {onlyUnpaused} and {onlyConfigurationOwner}: only the existing owner can nominate a successor, and only while the diamond is unpaused. Stores _newOwner as the pending owner without touching the current owner; finalisation happens in {acceptOwnership}. Emits {OwnershipTransfered} with the caller as the outgoing owner.
Parameters
| Name | Type | Description |
|---|---|---|
| _configId | bytes32 | Configuration whose ownership is being handed over. |
| _newOwner | address | Address to record as pending owner. |
unpause
function unpause() external nonpayable returns (bool success_)
Clears the token's internal pause flag, restoring guarded operations.
Requires ROLE_PAUSER and the token's internal flag to be set. Reverts with IsUnpaused if the internal flag is already cleared. Emits Unpaused. Note: if any external pause contract remains paused, isPaused will still return true after this call.
Returns
| Name | Type | Description |
|---|---|---|
| success_ | bool | True if the internal pause flag was successfully cleared. |
updateReplacementAddress
function updateReplacementAddress(address _replacedAddress, address _replacementAddress) external nonpayable
Updates the replacement address for a given address
Parameters
| Name | Type | Description |
|---|---|---|
| _replacedAddress | address | undefined |
| _replacementAddress | address | undefined |
Events
AccessControlInitialized
event AccessControlInitialized()
Emitted once when the AccessControl capability is initialised on a token.
Fires exclusively from initializeAccessControl after the registration succeeds.
BusinessLogicResolverInitialized
event BusinessLogicResolverInitialized()
Emitted once when the BLR itself is initialised.
Fires exclusively from initializeBusinessLogicResolver after the storage write succeeds.
BusinessLogicsRegistered
event BusinessLogicsRegistered(IBusinessLogicResolver.BusinessLogicRegistryData[] businessLogics, uint256[] newLatestVersions)
Event emitted when Business Logic(s) are registered (updated or added).
Parameters
| Name | Type | Description |
|---|---|---|
| businessLogics | IBusinessLogicResolver.BusinessLogicRegistryData[] | list of registered Business Logics. |
| newLatestVersions | uint256[] | new latest version per registered key, in the same order as businessLogics. |
DiamondBatchConfigurationCancelled
event DiamondBatchConfigurationCancelled(bytes32 indexed configurationId, uint256 indexed version)
Emitted when an in-progress batch configuration is discarded.
Parameters
| Name | Type | Description |
|---|---|---|
configurationId indexed | bytes32 | Configuration key whose pending batch was cancelled. |
version indexed | uint256 | Version number that was being assembled and is now dropped. |
DiamondBatchConfigurationCreated
event DiamondBatchConfigurationCreated(bytes32 configurationId, IDiamondCutManager.FacetConfiguration[] facetConfigurations, bool isLastBatch, uint256 version, bytes data)
Emitted on every {createBatchConfiguration} call, including the final batch.
Parameters
| Name | Type | Description |
|---|---|---|
| configurationId | bytes32 | Configuration key being assembled. |
| facetConfigurations | IDiamondCutManager.FacetConfiguration[] | Facets appended in this batch. |
| isLastBatch | bool | True when this call finalises the configuration version. |
| version | uint256 | Version number being assembled for this configuration. |
| data | bytes | Additional data passed to the configuration. |
DiamondConfigurationCreated
event DiamondConfigurationCreated(bytes32 configurationId, IDiamondCutManager.FacetConfiguration[] facetConfigurations, uint256 version, bytes data)
Emitted when a configuration is created atomically via {createConfiguration}.
Parameters
| Name | Type | Description |
|---|---|---|
| configurationId | bytes32 | Configuration key that was registered. |
| facetConfigurations | IDiamondCutManager.FacetConfiguration[] | Facets (id, version) that compose the new configuration. |
| version | uint256 | Version number assigned to the newly created configuration. |
| data | bytes | Additional data passed to the configuration. |
EffectivelyRolesApplied
event EffectivelyRolesApplied(bytes32[] roles, bool[] actives)
Emitted when one or more role changes are effectively applied.
roles and actives are parallel arrays containing the role states that resulted in effective storage mutations.
Parameters
| Name | Type | Description |
|---|---|---|
| roles | bytes32[] | The roles whose assigned state changed. |
| actives | bool[] | The effective state applied to each role; true granted and false revoked. |
OwnershipAccepted
event OwnershipAccepted(bytes32 indexed configId, address previousOwner, address newOwner)
Emitted when the pending owner finalises the ownership handover.
Fired by {acceptOwnership} after the configuration owner has been updated and the pending owner slot cleared.
Parameters
| Name | Type | Description |
|---|---|---|
configId indexed | bytes32 | Configuration whose ownership has changed. |
| previousOwner | address | Address that previously owned the configuration. |
| newOwner | address | Caller that accepted ownership and now holds the configuration. |
OwnershipTransfered
event OwnershipTransfered(bytes32 indexed configId, address owner, address pendingOwner)
Emitted when the current owner nominates a new owner for a configuration.
Fired by {transferOwnership} before the handover is accepted; the existing owner remains in control until {acceptOwnership} is invoked by newOwner.
Parameters
| Name | Type | Description |
|---|---|---|
configId indexed | bytes32 | Configuration whose ownership is being transferred. |
| owner | address | Current owner that initiated the transfer. |
| pendingOwner | address | Address nominated as the pending owner. |
PauseInitialized
event PauseInitialized()
Emitted once when the pause capability is initialised on a token.
Fires exclusively from initializePause.
Paused
event Paused(address indexed operator)
Emitted when the token's internal pause flag is set to true.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | Address of the caller who triggered the pause. |
ReplacementAddressRemoved
event ReplacementAddressRemoved(address indexed replacedAddress, address indexed replacementAddressRemoved)
Event emitted when a replacement address is removed
Parameters
| Name | Type | Description |
|---|---|---|
replacedAddress indexed | address | address for which the replacement is being removed. |
replacementAddressRemoved indexed | address | removed replacement address. |
ReplacementAddressUpdated
event ReplacementAddressUpdated(address indexed replacedAddress, address indexed replacementAddress)
Event emitted when an old address is replaced with a new one
Parameters
| Name | Type | Description |
|---|---|---|
replacedAddress indexed | address | old address been replaced. |
replacementAddress indexed | address | new address replacing the old one. |
RoleGranted
event RoleGranted(address indexed operator, address indexed account, bytes32 indexed role)
Emitted when a role is granted to an account.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | The address that performed the grant. |
account indexed | address | The account that received the role. |
role indexed | bytes32 | The role that was granted. |
RoleRenounced
event RoleRenounced(address indexed account, bytes32 indexed role)
Emitted when an account voluntarily renounces a role it holds.
Parameters
| Name | Type | Description |
|---|---|---|
account indexed | address | The account that renounced the role. |
role indexed | bytes32 | The role that was renounced. |
RoleRevoked
event RoleRevoked(address indexed operator, address indexed account, bytes32 indexed role)
Emitted when a role is revoked from an account.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | The address that performed the revocation. |
account indexed | address | The account from which the role was revoked. |
role indexed | bytes32 | The role that was revoked. |
RolesApplied
event RolesApplied(bytes32[] roles, bool[] actives, address account)
Emitted when multiple role operations are requested for an account.
roles and actives are parallel arrays and must have the same length. Entries represent the requested role state changes, not necessarily only the effective storage mutations.
Parameters
| Name | Type | Description |
|---|---|---|
| roles | bytes32[] | The roles processed by the batch operation. |
| actives | bool[] | The requested state for each role; true grants and false revokes. |
| account | address | The account for which the role operations are requested. |
Unpaused
event Unpaused(address indexed operator)
Emitted when the token's internal pause flag is cleared to false.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | Address of the caller who triggered the unpause. |
VersionStatusUpdated
event VersionStatusUpdated(bytes32 indexed businessLogicKey, uint256 version, enum IBusinessLogicResolver.VersionStatus status)
Event emitted when a business logic version's status is updated.
Parameters
| Name | Type | Description |
|---|---|---|
businessLogicKey indexed | bytes32 | Business logic key whose version status changed. |
| version | uint256 | Version number whose status changed. |
| status | enum IBusinessLogicResolver.VersionStatus | New status assigned to the version. |
Errors
AccountAssignedToRole
error AccountAssignedToRole(bytes32 role, address account)
Thrown when attempting to grant a role to an account that already holds it.
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The role the account already holds. |
| account | address | The account already assigned to the role. |
AccountHasNoRole
error AccountHasNoRole(address account, bytes32 role)
Thrown when an account does not hold a required role.
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The account that lacks the role. |
| role | bytes32 | The role that is not held. |
AccountHasNoRoles
error AccountHasNoRoles(address account, bytes32[] roles)
Thrown when an account does not hold any of the specified roles.
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The account that lacks the roles. |
| roles | bytes32[] | The roles that are not held. |
AccountNotAssignedToRole
error AccountNotAssignedToRole(bytes32 role, address account)
Thrown when attempting to revoke or renounce a role from an account that does not hold it.
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The role the account does not hold. |
| account | address | The account not assigned to the role. |
AlreadyInitialized
error AlreadyInitialized()
Reverts when an initialisation routine is invoked more than once.
Used by contracts or facets that must be initialised exactly once.
BusinessLogicKeyDuplicated
error BusinessLogicKeyDuplicated(bytes32 businessLogicKey)
Thrown when two entries in a registration batch share the same business logic key.
Parameters
| Name | Type | Description |
|---|---|---|
| businessLogicKey | bytes32 | The duplicated key found in the batch. |
BusinessLogicKeyMismatch
error BusinessLogicKeyMismatch(address implementation, bytes32 actualKey, bytes32 expectedKey)
Thrown when the key reported by the implementation contract differs from the expected key.
Parameters
| Name | Type | Description |
|---|---|---|
| implementation | address | Address of the implementation whose key was checked. |
| actualKey | bytes32 | The resolver key returned by the implementation. |
| expectedKey | bytes32 | The resolver key that was expected at registration time. |
BusinessLogicVersionDoesNotExist
error BusinessLogicVersionDoesNotExist(uint256 version)
Thrown when the requested version has never been registered for any business logic key.
Parameters
| Name | Type | Description |
|---|---|---|
| version | uint256 | The version number that does not exist in the registry. |
CannotRenounceSoleAdmin
error CannotRenounceSoleAdmin()
Thrown when the sole holder of DEFAULT_ADMIN_ROLE attempts to renounce it, which would permanently lock all admin-gated functions.
ContradictoryValuesInArray
error ContradictoryValuesInArray(uint256 lowerIndex, uint256 upperIndex)
Reverts when ordered array values contradict expected ordering.
Indicates that two indexed values cannot both satisfy the required monotonic or range invariant.
Parameters
| Name | Type | Description |
|---|---|---|
| lowerIndex | uint256 | Lower array index involved in the contradiction. |
| upperIndex | uint256 | Upper array index involved in the contradiction. |
DeactivatedVersionNotAllowed
error DeactivatedVersionNotAllowed(bytes32 facetId, uint256 version)
Thrown when a configuration selects a facet version whose status has been set to DEACTIVATED. Configurations that already reference the version are unaffected; this only blocks the version from being selected into a new configuration.
Parameters
| Name | Type | Description |
|---|---|---|
| facetId | bytes32 | Facet id whose selected version is deactivated. |
| version | uint256 | Deactivated version that was selected. |
DefaultValueForConfigurationIdNotPermitted
error DefaultValueForConfigurationIdNotPermitted()
Thrown when bytes32(0) is supplied as a configuration id, which is reserved.
DuplicatedFacetInConfiguration
error DuplicatedFacetInConfiguration(bytes32 facetId)
Thrown when the same facet id appears more than once within a configuration.
Parameters
| Name | Type | Description |
|---|---|---|
| facetId | bytes32 | Duplicated facet id. |
EmptyFacetConfigurationNotPermitted
error EmptyFacetConfigurationNotPermitted(bytes32 configurationId)
Thrown when attempting to activate a configuration that contains no facets, which would brick any ResolverProxy following the latest version.
Parameters
| Name | Type | Description |
|---|---|---|
| configurationId | bytes32 | Configuration key that was supplied with an empty facet list. |
FacetAlreadyRegistered
error FacetAlreadyRegistered(bytes32 facetId, uint256 lastVersion)
Raised when an initialiser tries to register a facet that already has a non-zero last registered version (i.e. the facet is being re-initialised on a fresh install).
Parameters
| Name | Type | Description |
|---|---|---|
| facetId | bytes32 | Identifier of the offending facet. |
| lastVersion | uint256 | Last version recorded for that facet at the time of the check. |
FacetIdNotRegistered
error FacetIdNotRegistered(bytes32 configurationId, bytes32 facetId)
Thrown when a configuration references a facet id that is not registered in the business-logic resolver.
Parameters
| Name | Type | Description |
|---|---|---|
| configurationId | bytes32 | Configuration being created or modified. |
| facetId | bytes32 | Unknown facet id that triggered the revert. |
InvalidReplacedAddress
error InvalidReplacedAddress(address replacedAddress)
Thrown when a replaced address is already been used as replacement of other addresses.
Parameters
| Name | Type | Description |
|---|---|---|
| replacedAddress | address | Replaced address. |
InvalidReplacementAddress
error InvalidReplacementAddress(address replacementAddress)
Thrown when a replacement address is already been replaced.
Parameters
| Name | Type | Description |
|---|---|---|
| replacementAddress | address | Replacement address that is already been replaced and thus cannot replaced another one. |
InvalidResolverProxyConfiguration
error InvalidResolverProxyConfiguration(bytes _resolverProxyConfiguration)
Thrown when the provided encoded proxy configuration does not respect the standard.
Parameters
| Name | Type | Description |
|---|---|---|
| _resolverProxyConfiguration | bytes | wrong encoded proxy configuration. |
InvalidVersionStatus
error InvalidVersionStatus()
Thrown when setVersionStatus is called with VersionStatus.NONE, which represents an unregistered version rather than a settable lifecycle state.
IsPaused
error IsPaused()
Thrown when an operation that requires the token to be unpaused is attempted while the token is paused (own flag or any external pause contract).
IsUnpaused
error IsUnpaused()
Thrown when unpause is called while the token's internal pause flag is already cleared.
NotOwner
error NotOwner(bytes32 configId, address sender, address owner)
Raised when the caller is not the current owner of the configuration.
Parameters
| Name | Type | Description |
|---|---|---|
| configId | bytes32 | Configuration that was accessed. |
| sender | address | Caller that attempted the owner-only action. |
| owner | address | Address currently holding ownership of configId. |
NotPendingOwner
error NotPendingOwner(bytes32 configId, address sender, address pendingOwner)
Raised when the caller is not the pending owner of the configuration.
Parameters
| Name | Type | Description |
|---|---|---|
| configId | bytes32 | Configuration whose pending handover was targeted. |
| sender | address | Caller that attempted to accept ownership. |
| pendingOwner | address | Address currently nominated as pending owner of configId. |
OngoingBatchConfigurationNotPermitted
error OngoingBatchConfigurationNotPermitted(bytes32 configurationId)
Thrown when {createConfiguration} is called for a configuration id that already has an in-progress batch, which would prematurely finalise the incomplete batch and absorb any facets that were intended for subsequent batch additions.
Parameters
| Name | Type | Description |
|---|---|---|
| configurationId | bytes32 | Configuration key whose batch is currently open. |
ResolverProxyConfigurationNoRegistered
error ResolverProxyConfigurationNoRegistered(bytes32 resolverProxyConfigurationId, uint256 version)
Thrown when a (configurationId, version) pair is referenced but has not been registered (or is still mid-batch and therefore not yet finalised).
Parameters
| Name | Type | Description |
|---|---|---|
| resolverProxyConfigurationId | bytes32 | Configuration key that was looked up. |
| version | uint256 | Version that was looked up. |
RolesAndActivesLengthMismatch
error RolesAndActivesLengthMismatch(uint256 rolesLength, uint256 activesLength)
Thrown when the roles and actives arrays passed to applyRoles differ in length.
Parameters
| Name | Type | Description |
|---|---|---|
| rolesLength | uint256 | Length of the roles array. |
| activesLength | uint256 | Length of the actives array. |
SelectorAlreadyRegistered
error SelectorAlreadyRegistered(bytes32 configurationId, uint256 version, bytes32 facetId, bytes4 selector)
Thrown when a selector is already registered under another facet for the same (configurationId, version), which would create an ambiguous dispatch.
Parameters
| Name | Type | Description |
|---|---|---|
| configurationId | bytes32 | Configuration where the clash was detected. |
| version | uint256 | Version where the clash was detected. |
| facetId | bytes32 | Facet attempting to register the selector. |
| selector | bytes4 | Selector that is already mapped to a different facet. |
SelectorBlacklisted
error SelectorBlacklisted(bytes4 selector)
Thrown when attempting to register a selector that is globally blacklisted.
Parameters
| Name | Type | Description |
|---|---|---|
| selector | bytes4 | Function selector that is forbidden. |
Unimplemented
error Unimplemented()
Indicates that a requested operation is not implemented by this resolver.
Reserved for interface compatibility or future extension points.
UnrecognizedResolverProxyVersion
error UnrecognizedResolverProxyVersion(bytes8 _resolverProxyVersion)
Thrown when the provided proxy version does not match any BLR compatible standard.
Parameters
| Name | Type | Description |
|---|---|---|
| _resolverProxyVersion | bytes8 | proxy version that is not compatible with the BLR. |
VersionZero
error VersionZero(bytes32 configurationId)
Thrown when a configuration version of 0 is supplied to an entry point that requires an explicit version pin.
Callers that want the most recent registered version must read it first via {getLatestVersionByConfiguration} and pass that value.
Parameters
| Name | Type | Description |
|---|---|---|
| configurationId | bytes32 | Configuration key that was looked up. |
WalletRecovered
error WalletRecovered()
Thrown when attempting to recover a wallet that has already been recovered.
ZeroAddressNotAllowed
error ZeroAddressNotAllowed()
Reverts when the zero address is supplied where it is not permitted.
Prevents invalid account, contract, or recipient references.
ZeroKeyNotValidForBusinessLogic
error ZeroKeyNotValidForBusinessLogic()
Thrown when a registration attempt uses the zero bytes32 value as the business logic key.