Skip to main content

OperatorByPartition

Asset Tokenization Studio Team

OperatorByPartition

Abstract implementation of IOperatorByPartition.

Storage reads and writes delegate to ERC1410StorageWrapper. Token-lifecycle operations (operator transfer and redemption) are orchestrated via TokenCoreOps. Intended to be inherited solely by OperatorByPartitionFacet.

Methods​

authorizeOperatorByPartition​

function authorizeOperatorByPartition(bytes32 _partition, address _operator) external nonpayable

Authorises an operator to manage a specific partition of msg.sender's tokens.

Emits {AuthorizedOperatorByPartition}.

Parameters​

NameTypeDescription
_partitionbytes32The partition the operator is authorised for.
_operatoraddressThe address being authorised as operator.

initializeOperatorByPartition​

function initializeOperatorByPartition() external nonpayable

Initialises the operator-by-partition capability on the token.

Callable once; subsequent calls revert with FacetAlreadyRegistered. Requires DEFAULT_ADMIN_ROLE. Called by the factory during deployment.

isOperatorForPartition​

function isOperatorForPartition(bytes32 _partition, address _operator, address _tokenHolder) external view returns (bool)

Returns whether _operator is an authorised operator for a specific partition of _tokenHolder.

Returns true if _operator has been authorised for all partitions of _tokenHolder (via authorizeOperator) OR has explicit per-partition approval (via authorizeOperatorByPartition). Read-only; no access control applied.

Parameters​

NameTypeDescription
_partitionbytes32The partition to query.
_operatoraddressThe operator address to check.
_tokenHolderaddressThe token holder whose partition is being queried.

Returns​

NameTypeDescription
_0boolbool true if _operator is authorised for _partition of _tokenHolder.

operatorRedeemByPartition​

function operatorRedeemByPartition(bytes32 _partition, address _tokenHolder, uint256 _value, bytes _data, bytes _operatorData) external nonpayable

Decreases the total supply and the partition balance of a token holder on behalf of an authorised operator.

Emits {RedeemedByPartition} via TokenCoreOps.redeemByPartition.

Parameters​

NameTypeDescription
_partitionbytes32The partition from which tokens are redeemed.
_tokenHolderaddressThe address whose tokens are redeemed.
_valueuint256The number of tokens to redeem.
_databytesAdditional data attached to the redemption (passed to hooks).
_operatorDatabytesAdditional data attached by the operator.

operatorTransferByPartition​

function operatorTransferByPartition(IERC1410Types.OperatorTransferData _operatorTransferData) external nonpayable returns (bytes32)

Parameters​

NameTypeDescription
_operatorTransferDataIERC1410Types.OperatorTransferDataundefined

Returns​

NameTypeDescription
_0bytes32undefined

revokeOperatorByPartition​

function revokeOperatorByPartition(bytes32 _partition, address _operator) external nonpayable

Revokes a previously authorised operator from a specific partition of msg.sender's tokens.

Emits {RevokedOperatorByPartition}.

Parameters​

NameTypeDescription
_partitionbytes32The partition from which the operator is de-authorised.
_operatoraddressThe address being de-authorised.

Events​

AuthorizedOperator​

event AuthorizedOperator(address indexed operator, address indexed tokenHolder)

Emitted when an operator is authorised to manage all partitions of a token holder.

Parameters​

NameTypeDescription
operator indexedaddressNewly authorised operator address.
tokenHolder indexedaddressToken holder who granted the authorisation.

AuthorizedOperatorByPartition​

event AuthorizedOperatorByPartition(bytes32 indexed partition, address indexed operator, address indexed tokenHolder)

Emitted when an operator is authorised for a specific partition of a token holder.

Parameters​

NameTypeDescription
partition indexedbytes32Partition the authorisation applies to.
operator indexedaddressNewly authorised operator address.
tokenHolder indexedaddressToken holder who granted the authorisation.

IssuedByPartition​

event IssuedByPartition(bytes32 indexed partition, address indexed operator, address indexed to, uint256 value, bytes data)

Emitted when new tokens are issued into a partition.

Parameters​

NameTypeDescription
partition indexedbytes32Partition the tokens were issued into.
operator indexedaddressAddress that performed the issuance.
to indexedaddressRecipient of the issued tokens.
valueuint256Token quantity issued.
databytesCaller-supplied data attached to the issuance.

OperatorByPartitionInitialized​

event OperatorByPartitionInitialized()

Emitted once when the operator-by-partition capability is initialised on a token.

Fires exclusively from initializeOperatorByPartition.

RedeemedByPartition​

event RedeemedByPartition(bytes32 indexed partition, address indexed operator, address indexed from, uint256 value, bytes data, bytes operatorData)

Emitted when tokens are redeemed from a partition.

Parameters​

NameTypeDescription
partition indexedbytes32Partition the tokens were redeemed from.
operator indexedaddressAddress that performed the redemption.
from indexedaddressToken holder whose tokens were redeemed.
valueuint256Token quantity redeemed.
databytesCaller-supplied data attached to the redemption.
operatorDatabytesOperator-supplied data attached to the redemption.

RevokedOperator​

event RevokedOperator(address indexed operator, address indexed tokenHolder)

Emitted when an operator's authorisation over all partitions of a token holder is revoked.

Parameters​

NameTypeDescription
operator indexedaddressOperator whose authorisation was revoked.
tokenHolder indexedaddressToken holder who revoked the authorisation.

RevokedOperatorByPartition​

event RevokedOperatorByPartition(bytes32 indexed partition, address indexed operator, address indexed tokenHolder)

Emitted when an operator's authorisation for a specific partition of a token holder is revoked.

Parameters​

NameTypeDescription
partition indexedbytes32Partition the revocation applies to.
operator indexedaddressOperator whose authorisation was revoked.
tokenHolder indexedaddressToken holder who revoked the authorisation.

TransferByPartition​

event TransferByPartition(bytes32 indexed fromPartition, address operator, address indexed from, address indexed to, uint256 value, bytes data, bytes operatorData)

Emitted when tokens are transferred from one partition to another or within the same partition.

Parameters​

NameTypeDescription
fromPartition indexedbytes32Source partition.
operatoraddressAddress that initiated the transfer.
from indexedaddressToken holder whose balance decreased.
to indexedaddressRecipient whose balance increased.
valueuint256Token quantity transferred.
databytesCaller-supplied data.
operatorDatabytesOperator-supplied data.

Errors​

AccountHasNoRole​

error AccountHasNoRole(address account, bytes32 role)

Thrown when an account does not hold a required role.

Parameters​

NameTypeDescription
accountaddressThe account that lacks the role.
rolebytes32The role that is not held.

AssetNotOperational​

error AssetNotOperational(bytes32 configId, uint256 versionId)

Raised by InitializerStorageWrapper.checkOperational (and the related isConfigVersionOperational helper) when an operation is attempted on a configuration version that has not yet been marked operational.

Parameters​

NameTypeDescription
configIdbytes32Resolver-proxy configuration whose operational status was checked.
versionIduint256Configuration version whose operational status was checked.

Deactivated​

error Deactivated()

Thrown when an operation guarded by onlyActivated is attempted on a token whose deactivation flag has already been set.

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​

NameTypeDescription
facetIdbytes32Identifier of the offending facet.
lastVersionuint256Last version recorded for that facet at the time of the check.

InvalidPartition​

error InvalidPartition(address account, bytes32 partition)

Thrown when an account does not hold or is not associated with the specified partition.

Parameters​

NameTypeDescription
accountaddressAddress that was checked.
partitionbytes32Partition that was not found for the account.

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).

NotAllowedInMultiPartitionMode​

error NotAllowedInMultiPartitionMode()

Thrown when a single-partition operation is attempted on a multi-partition token.

PartitionNotAllowedInSinglePartitionMode​

error PartitionNotAllowedInSinglePartitionMode(bytes32 partition)

Thrown when a multi-partition operation specifies a partition not permitted in single-partition mode.

Parameters​

NameTypeDescription
partitionbytes32The disallowed partition supplied by the caller.

PartitionsAreProtectedAndNoRole​

error PartitionsAreProtectedAndNoRole(address account, bytes32 role)

Reverts when a transfer is attempted while partitions are protected and the caller does not hold the required partition role.

Parameters​

NameTypeDescription
accountaddressThe caller lacking the required role.
rolebytes32The role that would have been needed to proceed.

TokenHolderNotFound​

error TokenHolderNotFound(address tokenHolder)

Thrown when an operation targets a token holder address that has no registered balance.

Parameters​

NameTypeDescription
tokenHolderaddressThe address that was not found.

Unauthorized​

error Unauthorized(address operator, address tokenHolder, bytes32 partition)

Thrown when the caller is not an authorised operator for the token holder on the given partition.

Parameters​

NameTypeDescription
operatoraddressAddress that attempted the operation.
tokenHolderaddressToken holder whose tokens were targeted.
partitionbytes32Partition on which authorisation was checked.

UnrecognizedResolverProxyVersion​

error UnrecognizedResolverProxyVersion(bytes8 _resolverProxyVersion)

Thrown when the provided proxy version does not match any BLR compatible standard.

Parameters​

NameTypeDescription
_resolverProxyVersionbytes8proxy version that is not compatible with the BLR.

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.

ZeroPartition​

error ZeroPartition()

Thrown when the zero bytes32 value is supplied as a partition identifier.

ZeroValue​

error ZeroValue()

Thrown when a zero token amount is supplied to an operation that requires a positive value.