Skip to main content

ProtectedByPartitionFacet

Asset Tokenization Studio Team

ProtectedByPartitionFacet

Diamond facet that registers the protected partition-scoped transfer and redemption selectors under RESOLVER_KEY_PROTECTED_BY_PARTITION on the Diamond proxy.

Composed via ProtectedByPartition for behaviour and IStaticFunctionSelectors for selector advertisement. Exposes two external selectors: - protectedTransferFromByPartition - protectedRedeemFromByPartition

Methods​

getStaticFunctionSelectors​

function getStaticFunctionSelectors() external pure returns (bytes4[])

Gets all function selectors of a facet

Returns​

NameTypeDescription
_0bytes4[]Face functions selectors

getStaticInterfaceIds​

function getStaticInterfaceIds() external pure returns (bytes4[])

Gets all interfaces ids of a facet.

Returns​

NameTypeDescription
_0bytes4[]Face interface ids

getStaticResolverKey​

function getStaticResolverKey() external pure returns (bytes32 staticResolverKey_)

Gets the static resolver key

Returns​

NameTypeDescription
staticResolverKey_bytes32Static resolver key

initializeProtectedByPartition​

function initializeProtectedByPartition() external nonpayable

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

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

protectedRedeemFromByPartition​

function protectedRedeemFromByPartition(bytes32 _partition, address _from, uint256 _amount, IProtectedPartitions.ProtectionData _protectionData) external nonpayable

Parameters​

NameTypeDescription
_partitionbytes32undefined
_fromaddressundefined
_amountuint256undefined
_protectionDataIProtectedPartitions.ProtectionDataundefined

protectedTransferFromByPartition​

function protectedTransferFromByPartition(bytes32 _partition, address _from, address _to, uint256 _amount, IProtectedPartitions.ProtectionData _protectionData) external nonpayable returns (bytes32)

Parameters​

NameTypeDescription
_partitionbytes32undefined
_fromaddressundefined
_toaddressundefined
_amountuint256undefined
_protectionDataIProtectedPartitions.ProtectionDataundefined

Returns​

NameTypeDescription
_0bytes32undefined

Events​

ProtectedByPartitionInitialized​

event ProtectedByPartitionInitialized()

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

Fires exclusively from initializeProtectedByPartition.

ProtectedRedeemedByPartition​

event ProtectedRedeemedByPartition(address indexed operator, address indexed from, uint256 amount, bytes32 partition, IProtectedPartitions.ProtectionData protectionData)

Emitted when a protected redemption completes successfully.

Parameters​

NameTypeDescription
operator indexedaddressThe address that initiated the redemption (msg.sender).
from indexedaddressThe token holder whose tokens are redeemed.
amountuint256The quantity of tokens redeemed.
partitionbytes32The partition from which tokens are redeemed.
protectionDataIProtectedPartitions.ProtectionDataThe protection metadata used for signature verification.

ProtectedTransferredByPartition​

event ProtectedTransferredByPartition(address indexed operator, address indexed from, address indexed to, uint256 amount, bytes32 partition, IProtectedPartitions.ProtectionData protectionData)

Emitted when a protected transfer completes successfully.

Parameters​

NameTypeDescription
operator indexedaddressThe address that initiated the transfer (msg.sender).
from indexedaddressThe token holder whose tokens are transferred.
to indexedaddressThe recipient of the transferred tokens.
amountuint256The quantity of tokens transferred.
partitionbytes32The partition from which tokens are transferred.
protectionDataIProtectedPartitions.ProtectionDataThe protection metadata used for signature verification.

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.

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

PartitionsAreUnProtected​

error PartitionsAreUnProtected()

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

ProtectedPartitionRoleRequired​

error ProtectedPartitionRoleRequired(bytes32 partition, address sender)

Raised when an account is not authorised for a protected partition.

The reported sender is resolved through EvmAccessors for forwarding support.

Parameters​

NameTypeDescription
partitionbytes32Partition whose access requirement is not satisfied.
senderaddressEffective caller that lacks the required role.

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.

ZeroValue​

error ZeroValue()

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