Skip to main content

RecoveryFacet

Asset Tokenization Studio Team

RecoveryFacet

Diamond facet exposing lost-wallet recovery operations.

Registers two selectors: recoveryAddress and isAddressRecovered. All business logic is provided by the {Recovery} abstract contract.

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

initializeRecovery​

function initializeRecovery() external nonpayable

Initialises the recovery capability on the token.

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

isAddressRecovered​

function isAddressRecovered(address _wallet) external view returns (bool)

Returns whether a wallet address has been marked as recovered.

Parameters​

NameTypeDescription
_walletaddressAddress to query.

Returns​

NameTypeDescription
_0boolTrue if the address has previously been recovered via {recoveryAddress}.

recoveryAddress​

function recoveryAddress(address _lostWallet, address _newWallet, address _investorOnchainID) external nonpayable returns (bool success_)

Transfers the token balance and frozen amounts of a lost wallet to a new wallet, marking the lost wallet as recovered.

Caller must hold ROLE_AGENT. The lost wallet must not have already been recovered, must carry no pending locks, holds, or clearings, and the token must be single-partition. Emits {RecoverySuccess} on success.

Parameters​

NameTypeDescription
_lostWalletaddressAddress of the wallet that was lost.
_newWalletaddressAddress of the replacement wallet that will receive the balances.
_investorOnchainIDaddressOn-chain identity address of the investor (may be zero address).

Returns​

NameTypeDescription
success_booltrue when the recovery completes successfully.

Events​

AgentAdded​

event AgentAdded(address indexed agent)

Emitted when an agent is granted transfer-management permissions.

Parameters​

NameTypeDescription
agent indexedaddressAddress of the newly added agent.

AgentRemoved​

event AgentRemoved(address indexed agent)

Emitted when an agent's transfer-management permissions are revoked.

Parameters​

NameTypeDescription
agent indexedaddressAddress of the removed agent.

ComplianceAdded​

event ComplianceAdded(address indexed compliance)

Emitted when the compliance contract address is updated.

Parameters​

NameTypeDescription
compliance indexedaddressAddress of the newly wired compliance contract.

DelegateVotesChanged​

event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance)

Emitted when delegate votes change due to balance changes

Parameters​

NameTypeDescription
delegate indexedaddressThe delegate whose votes changed
previousBalanceuint256The previous vote balance
newBalanceuint256The new vote balance

IdentityRegistryAdded​

event IdentityRegistryAdded(address indexed identityRegistry)

Emitted when the identity registry contract address is updated.

Parameters​

NameTypeDescription
identityRegistry indexedaddressAddress of the newly wired identity registry.

RecoveryInitialized​

event RecoveryInitialized()

Emitted once when the recovery capability is initialised on a token.

Fires exclusively from initializeRecovery.

RecoverySuccess​

event RecoverySuccess(address lostWallet, address newWallet, address investorOnchainID)

Emitted when a lost wallet is successfully recovered to a new address.

Parameters​

NameTypeDescription
lostWalletaddressAddress of the wallet that was lost.
newWalletaddressAddress of the replacement wallet.
investorOnchainIDaddressOnchainID of the investor performing the recovery.

Transfer​

event Transfer(address indexed from, address indexed to, uint256 value)

Emitted whenever tokens move between accounts, are minted, or are burned.

Parameters​

NameTypeDescription
from indexedaddressSource account (zero address on mint).
to indexedaddressDestination account (zero address on burn).
valueuint256Amount of tokens transferred.

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.

UpdatedTokenInformation​

event UpdatedTokenInformation(string indexed newName, string indexed newSymbol, uint8 newDecimals, string newVersion, address indexed newOnchainID)

Emitted when core token metadata is updated.

Parameters​

NameTypeDescription
newName indexedstringNew token name.
newSymbol indexedstringNew token symbol.
newDecimalsuint8New decimal precision.
newVersionstringNew token version string.
newOnchainID indexedaddressNew onchainID address associated with the token.

Errors​

AbafChangeForBlockForbidden​

error AbafChangeForBlockForbidden(uint256 blockNumber)

Raised when attempting to change ABAF for a block that is forbidden

Parameters​

NameTypeDescription
blockNumberuint256The block number that is forbidden

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.

AddressNotVerified​

error AddressNotVerified()

Thrown when a transfer target address has not passed identity verification.

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.

CannotRecoverWallet​

error CannotRecoverWallet()

Thrown when wallet recovery preconditions are not met (e.g. identity mismatch).

ComplianceCallFailed​

error ComplianceCallFailed()

Thrown when an external call to the compliance contract reverts or returns false.

ComplianceNotAllowed​

error ComplianceNotAllowed()

Thrown when a transfer is blocked by the compliance module.

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.

IdentityRegistryCallFailed​

error IdentityRegistryCallFailed()

Thrown when an external call to the identity registry reverts or returns false.

InputAmountsArrayLengthMismatch​

error InputAmountsArrayLengthMismatch()

Thrown when the lengths of two input amount arrays do not match.

InputBoolArrayLengthMismatch​

error InputBoolArrayLengthMismatch()

Thrown when the lengths of two input boolean arrays do not match.

InsufficientBalance​

error InsufficientBalance(address account, uint256 balance, uint256 value, bytes32 partition)

Thrown when a transfer or redemption is attempted with insufficient partition balance.

Parameters​

NameTypeDescription
accountaddressThe account whose balance was checked.
balanceuint256The actual balance available.
valueuint256The amount that was requested.
partitionbytes32The partition that was checked.

InsufficientFrozenBalance​

error InsufficientFrozenBalance(address user, uint256 requestedUnfreeze, uint256 availableFrozen, bytes32 partition)

Thrown when an unfreeze request exceeds the address's available frozen balance.

Parameters​

NameTypeDescription
useraddressAddress whose frozen balance was checked.
requestedUnfreezeuint256Amount the caller attempted to unfreeze.
availableFrozenuint256Actual frozen balance available for unfreezing.
partitionbytes32Partition on which the frozen balance was checked.

InvalidFreezeAmount​

error InvalidFreezeAmount()

Reverts when a partial token freeze is attempted with a zero amount.

Checked at the start of ERC3643StorageWrapper.freezeTokens, the entry point for partial token freezes. Freezing zero tokens is semantically invalid and rejected early.

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.

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.

SnapshotIdDoesNotExists​

error SnapshotIdDoesNotExists(uint256 snapshotId)

Thrown when the requested snapshot identifier has never been taken on this token.

Parameters​

NameTypeDescription
snapshotIduint256The unrecognised snapshot identifier that was supplied.

SnapshotIdNull​

error SnapshotIdNull()

Thrown when a snapshot identifier of zero is supplied; zero is reserved and never assigned to a valid snapshot.

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.

UnexpectedError​

error UnexpectedError(bytes4 _errorId)

Reverts when an unreachable validation state is detected.

Replaces assertions for defensive handling of logically impossible states.

Parameters​

NameTypeDescription
_errorIdbytes4Identifier of the unexpected validation condition.

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.