[][src]Function transaction_builder::encode_freeze_account_script

pub fn encode_freeze_account_script(
    sliding_nonce: u64,
    to_freeze_account: AccountAddress
) -> Script


Freezes the account at address. The sending account of this transaction must be the Treasury Compliance account. The account being frozen cannot be the Libra Root or Treasury Compliance account. After the successful execution of this transaction no transactions may be sent from the frozen account, and the frozen account may not send or receive coins.

Technical Description

Sets the AccountFreezing::FreezingBit to true and emits a AccountFreezing::FreezeAccountEvent. The transaction sender must be the Treasury Compliance account, but the account at to_freeze_account must not be either 0xA550C18 (the Libra Root address), or 0xB1E55ED (the Treasury Compliance address). Note that this is a per-account property e.g., freezing a Parent VASP will not effect the status any of its child accounts and vice versa.


Successful execution of this transaction will emit a AccountFreezing::FreezeAccountEvent on the freeze_event_handle held in the AccountFreezing::FreezeEventsHolder resource published under 0xA550C18 with the frozen_address being the to_freeze_account.


tc_account&signerThe signer reference of the sending account of this transaction. Must be the Treasury Compliance account.
sliding_nonceu64The sliding_nonce (see: SlidingNonce) to be used for this transaction.
to_freeze_accountaddressThe account address to be frozen.

Common Abort Conditions

Error CategoryError ReasonDescription
Errors::NOT_PUBLISHEDSlidingNonce::ESLIDING_NONCEA SlidingNonce resource is not published under tc_account.
Errors::INVALID_ARGUMENTSlidingNonce::ENONCE_TOO_OLDThe sliding_nonce is too old and it's impossible to determine if it's duplicated or not.
Errors::INVALID_ARGUMENTSlidingNonce::ENONCE_TOO_NEWThe sliding_nonce is too far in the future.
Errors::INVALID_ARGUMENTSlidingNonce::ENONCE_ALREADY_RECORDEDThe sliding_nonce has been previously recorded.
Errors::REQUIRES_ADDRESSCoreAddresses::ETREASURY_COMPLIANCEThe sending account is not the Treasury Compliance account.
Errors::REQUIRES_ROLERoles::ETREASURY_COMPLIANCEThe sending account is not the Treasury Compliance account.
Errors::INVALID_ARGUMENTAccountFreezing::ECANNOT_FREEZE_TCto_freeze_account was the Treasury Compliance account (0xB1E55ED).
Errors::INVALID_ARGUMENTAccountFreezing::ECANNOT_FREEZE_LIBRA_ROOTto_freeze_account was the Libra Root account (0xA550C18).

Related Scripts