ControllerByPartition
Asset Tokenization Studio Team
ControllerByPartition
Abstract implementation of controller-initiated forced transfers and redemptions on a specific partition. Delegates into TokenCoreOps so semantics match ERC1410Management exactly.
Inherits modifier guards from Modifiers. Intended to be used only through ControllerByPartitionFacet.
Methods
controllerRedeemByPartition
function controllerRedeemByPartition(bytes32 _partition, address _tokenHolder, uint256 _value, bytes _data, bytes _operatorData) external nonpayable
Forces a redemption in a partition from a token holder.
Emits {RedeemedByPartition} via TokenCoreOps.redeemByPartition.
Parameters
| Name | Type | Description |
|---|---|---|
| _partition | bytes32 | The partition from which tokens are redeemed. |
| _tokenHolder | address | The address whose tokens are redeemed. |
| _value | uint256 | The amount of tokens to redeem. |
| _data | bytes | Additional data attached to the redemption. |
| _operatorData | bytes | Additional data attached to the redemption by the operator. |
controllerTransferByPartition
function controllerTransferByPartition(bytes32 _partition, address _from, address _to, uint256 _value, bytes _data, bytes _operatorData) external nonpayable returns (bytes32)
Forces a transfer in a partition from a token holder to a destination address.
Emits {TransferByPartition} via TokenCoreOps.transferByPartition.
Parameters
| Name | Type | Description |
|---|---|---|
| _partition | bytes32 | The partition from which tokens are transferred. |
| _from | address | The address from which tokens are transferred. |
| _to | address | The address to which tokens are transferred. |
| _value | uint256 | The amount of tokens to transfer. |
| _data | bytes | Additional data attached to the transfer. |
| _operatorData | bytes | Additional data attached to the transfer by the operator. |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | bytes32 | The partition from which the tokens were transferred. |
initializeControllerByPartition
function initializeControllerByPartition() external nonpayable
Initialises the controller by partition capability on the token.
Callable once; subsequent calls revert with FacetAlreadyRegistered. Requires DEFAULT_ADMIN_ROLE. Called by the factory during deployment.
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
| Name | Type | Description |
|---|---|---|
operator indexed | address | Newly authorised operator address. |
tokenHolder indexed | address | Token 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
| Name | Type | Description |
|---|---|---|
partition indexed | bytes32 | Partition the authorisation applies to. |
operator indexed | address | Newly authorised operator address. |
tokenHolder indexed | address | Token holder who granted the authorisation. |
ControllerByPartitionInitialized
event ControllerByPartitionInitialized()
Emitted once when the controller by partition capability is initialised on a token.
Fires exclusively from initializeControllerByPartition.
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
| Name | Type | Description |
|---|---|---|
partition indexed | bytes32 | Partition the tokens were issued into. |
operator indexed | address | Address that performed the issuance. |
to indexed | address | Recipient of the issued tokens. |
| value | uint256 | Token quantity issued. |
| data | bytes | Caller-supplied data attached to the issuance. |
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
| Name | Type | Description |
|---|---|---|
partition indexed | bytes32 | Partition the tokens were redeemed from. |
operator indexed | address | Address that performed the redemption. |
from indexed | address | Token holder whose tokens were redeemed. |
| value | uint256 | Token quantity redeemed. |
| data | bytes | Caller-supplied data attached to the redemption. |
| operatorData | bytes | Operator-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
| Name | Type | Description |
|---|---|---|
operator indexed | address | Operator whose authorisation was revoked. |
tokenHolder indexed | address | Token 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
| Name | Type | Description |
|---|---|---|
partition indexed | bytes32 | Partition the revocation applies to. |
operator indexed | address | Operator whose authorisation was revoked. |
tokenHolder indexed | address | Token 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
| Name | Type | Description |
|---|---|---|
fromPartition indexed | bytes32 | Source partition. |
| operator | address | Address that initiated the transfer. |
from indexed | address | Token holder whose balance decreased. |
to indexed | address | Recipient whose balance increased. |
| value | uint256 | Token quantity transferred. |
| data | bytes | Caller-supplied data. |
| operatorData | bytes | Operator-supplied data. |
Errors
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. |
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
| Name | Type | Description |
|---|---|---|
| configId | bytes32 | Resolver-proxy configuration whose operational status was checked. |
| versionId | uint256 | Configuration 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
| Name | Type | Description |
|---|---|---|
| facetId | bytes32 | Identifier of the offending facet. |
| lastVersion | uint256 | Last 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
| Name | Type | Description |
|---|---|---|
| account | address | Address that was checked. |
| partition | bytes32 | Partition 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
| Name | Type | Description |
|---|---|---|
| partition | bytes32 | The disallowed partition supplied by the caller. |
TokenHolderNotFound
error TokenHolderNotFound(address tokenHolder)
Thrown when an operation targets a token holder address that has no registered balance.
Parameters
| Name | Type | Description |
|---|---|---|
| tokenHolder | address | The address that was not found. |
TokenIsNotControllable
error TokenIsNotControllable()
Thrown when an operation requires the token to be controllable but it is not.
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
| Name | Type | Description |
|---|---|---|
| operator | address | Address that attempted the operation. |
| tokenHolder | address | Token holder whose tokens were targeted. |
| partition | bytes32 | Partition on which authorisation was checked. |
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. |
WalletRecovered
error WalletRecovered()
Thrown when attempting to recover a wallet that has already been recovered.
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.