Skip to main content

IProtectedPartitions

Asset Tokenization Studio Team

IProtectedPartitions

Interface for the protected-partitions capability, which restricts token transfers to holders of the appropriate partition role when protection is active.

Methods​

arePartitionsProtected​

function arePartitionsProtected() external view returns (bool)

Returns whether the protected partitions mode is active

If true, transfers are restricted to accounts having the required role for the partition

Returns​

NameTypeDescription
_0boolbool true if the protected partitions mode is active, false otherwise

calculateRoleForPartition​

function calculateRoleForPartition(bytes32 _partition) external pure returns (bytes32 roleForPartition_)

Calculates the role required to transfer tokens from a given partition

Parameters​

NameTypeDescription
_partitionbytes32The partition to calculate the role for

Returns​

NameTypeDescription
roleForPartition_bytes32The role required to transfer tokens from the given partition

initializeProtectedPartitions​

function initializeProtectedPartitions(bool _arePartitionsProtected) external nonpayable returns (bool success_)

Initialises the protected-partitions capability with the given starting state.

Called once during token deployment; reverts if the facet has already been registered.

Parameters​

NameTypeDescription
_arePartitionsProtectedboolInitial protection state; true enables protection immediately.

Returns​

NameTypeDescription
success_boolAlways true when the call does not revert.

protectPartitions​

function protectPartitions() external nonpayable returns (bool success_)

Activates the protected partitions mode.

Disables free token transfers; callers must hold the required role for the partition.

Returns​

NameTypeDescription
success_boolTrue when activation succeeds without reverting.

unprotectPartitions​

function unprotectPartitions() external nonpayable returns (bool success_)

Deactivates the protected partitions mode.

Re-enables free token transfers regardless of partition role.

Returns​

NameTypeDescription
success_boolTrue when deactivation succeeds without reverting.

Events​

PartitionsProtected​

event PartitionsProtected(address indexed operator)

Emitted when the protected-partition mode is activated.

Parameters​

NameTypeDescription
operator indexedaddressThe address that called protectPartitions.

PartitionsUnProtected​

event PartitionsUnProtected(address indexed operator)

Emitted when the protected-partition mode is deactivated.

Parameters​

NameTypeDescription
operator indexedaddressThe address that called unprotectPartitions.

ProtectedPartitionsInitialized​

event ProtectedPartitionsInitialized(bool arePartitionsProtected)

Emitted once when the protected partitions capability is initialised on a token.

Fires exclusively from initializeProtectedPartitions after the storage write succeeds.

Parameters​

NameTypeDescription
arePartitionsProtectedboolInitial protection state set at deployment time.

ProtectedRedeemFrom​

event ProtectedRedeemFrom(bytes32 indexed partition, address indexed operator, address indexed from, uint256 value, uint256 deadline, uint256 nonce, bytes signature)

Emitted when a signature-authorised redemption executes under protected-partition mode.

Parameters​

NameTypeDescription
partition indexedbytes32Partition from which the tokens are redeemed.
operator indexedaddressThe address that submitted the protected redemption.
from indexedaddressThe holder whose tokens are being redeemed; must be the signer.
valueuint256Number of tokens redeemed.
deadlineuint256Signature validity deadline supplied with the operation.
nonceuint256Holder nonce consumed by this operation.
signaturebytesEIP-712 signature provided by the holder.

ProtectedTransferFrom​

event ProtectedTransferFrom(bytes32 indexed partition, address indexed operator, address indexed from, address to, uint256 value, uint256 deadline, uint256 nonce, bytes signature)

Emitted when a signature-authorised transfer executes under protected-partition mode.

Parameters​

NameTypeDescription
partition indexedbytes32Partition from which the tokens are transferred.
operator indexedaddressThe address that submitted the protected transfer.
from indexedaddressThe holder whose tokens are being transferred; must be the signer.
toaddressRecipient of the transferred tokens.
valueuint256Number of tokens transferred.
deadlineuint256Signature validity deadline supplied with the operation.
nonceuint256Holder nonce consumed by this operation.
signaturebytesEIP-712 signature provided by the holder.

Errors​

PartitionsAreProtected​

error PartitionsAreProtected()

Reverts when an operation that requires unprotected mode is attempted while partitions are protected.

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.

PartitionsAreUnProtected​

error PartitionsAreUnProtected()

Reverts when a protected-mode operation is attempted but partitions are not currently protected.