Skip to main content

IComplianceByPartition

Asset Tokenization Studio Team

IComplianceByPartition

Interface for partition-aware transfer-eligibility and redemption checks.

Read-only counterpart of IComplianceFacet for multi-partition mode. Both methods short-circuit with the EIP-1066 PAUSED status code when the token is paused.

Methods​

canRedeemByPartition​

function canRedeemByPartition(address _from, bytes32 _partition, uint256 _value, bytes _data, bytes _operatorData) external view returns (bool status_, bytes1 code_, bytes32 reason_)

Checks whether a redemption can be executed on a specific partition.

Assumes that if the caller has an admin role the redemption will be performed using the associated method.

Parameters​

NameTypeDescription
_fromaddressThe address whose tokens would be redeemed.
_partitionbytes32The partition the redemption would happen in.
_valueuint256The amount of tokens to redeem.
_databytesAdditional data attached to the redemption check.
_operatorDatabytesAdditional data attached by the operator.

Returns​

NameTypeDescription
status_boolTrue when the redemption is allowed.
code_bytes1EIP-1066 status code describing the result.
reason_bytes32Additional reason data tied to the status code.

canTransferByPartition​

function canTransferByPartition(address _from, address _to, bytes32 _partition, uint256 _value, bytes _data, bytes _operatorData) external view returns (bool status_, bytes1 code_, bytes32 reason_)

Checks whether a transfer can be executed on a specific partition.

Assumes that if the caller has an admin role the transfer will be performed using the associated method. For example, if msg.sender is an operator of _to, the transfer will be performed using operatorTransferByPartition. Using other methods can lead to inconsistent results.

Parameters​

NameTypeDescription
_fromaddressThe sender address.
_toaddressThe recipient address.
_partitionbytes32The partition the transfer would happen in.
_valueuint256The amount of tokens to transfer.
_databytesAdditional data attached to the transfer check.
_operatorDatabytesAdditional data attached by the operator.

Returns​

NameTypeDescription
status_boolTrue when the transfer is allowed.
code_bytes1EIP-1066 status code describing the result.
reason_bytes32Additional reason data tied to the status code.

initializeComplianceByPartition​

function initializeComplianceByPartition() external nonpayable

Initialises the compliance by partition capability on the token.

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

Events​

ComplianceByPartitionInitialized​

event ComplianceByPartitionInitialized()

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

Fires exclusively from initializeComplianceByPartition.