Skip to main content

IControllerByPartition

Asset Tokenization Studio Team

IControllerByPartition

Interface for controller-initiated forced transfers and redemptions on a specific partition.

Exposes two write methods that allow an authorised controller or agent to forcibly transfer or redeem tokens from any token holder's balance on a given partition. Both operations require the token to be controllable and not paused, and are restricted to single-partition mode with the default partition.

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.

Can only be called by a user with the controller or agent role. The contract must be controllable and not paused. Only valid in single-partition mode with the default partition.

Parameters​

NameTypeDescription
_partitionbytes32The partition from which tokens are redeemed.
_tokenHolderaddressThe address whose tokens are redeemed.
_valueuint256The amount of tokens to redeem.
_databytesAdditional data attached to the redemption.
_operatorDatabytesAdditional 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.

Can only be called by a user with the controller or agent role. The contract must be controllable and not paused. Only valid in single-partition mode with the default partition.

Parameters​

NameTypeDescription
_partitionbytes32The partition from which tokens are transferred.
_fromaddressThe address from which tokens are transferred.
_toaddressThe address to which tokens are transferred.
_valueuint256The amount of tokens to transfer.
_databytesAdditional data attached to the transfer.
_operatorDatabytesAdditional data attached to the transfer by the operator.

Returns​

NameTypeDescription
_0bytes32The 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​

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.

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​

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.

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​

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.

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.

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.

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.