OPERATION
cancel_transfer
@mount("ft4.crosschain.cancel_transfer")
operation cancel_transfer(init_transfer_tx: gtx_transaction, init_tx_op_index: integer, previous_hop_tx: gtx_transaction, op_index: integer, hop_index: integer)Cancels a crosschain transfer that has expired. This operation must be called in place
of apply_transfer to start the transfer canceling process. unapply_transfer must
then be called on all previous chains to bring the funds back to the sender account.
Throws "TRANSFER NOT EXPIRED" if the transfer has not yet expired.
Throws in various cases of misconfiguration. Some examples:
- the transfer has already been applied, canceled or unapplied on this chain.
- the chain at
hop_indexon the init transaction is not this chain - the
op_indexonprevious_hop_txdoes not point to:init_transferwhenhop_indexis 0apply_transferotherwise
- the
init_tx_op_indexdoes not point toinit_transferon itsinit_transfer_tx - the operation preceding
init_transferis not an auth operation - arguments found in
init_transfer_txandprevious_hop_txdo not match hop_indexis out of boundsprevious_hop_txhas not been sent to the chain that comes before this one on the transfer hops
Throws if the transaction is missing the iccf_proof operation, which demonstrates that
the block containing the previous_hop_tx has been anchored from the previous chain.
Anyone can call this operation, but it needs to include an iccf_proof operation that
apply_transfer was performed on the previous chain.
Parameters
- init_transfer_tx — the transaction containing the
init_transferoperation which corresponds to the transfer to cancel - init_tx_op_index — the index of the
init_transferoperation ininit_transfer_tx - previous_hop_tx — the transaction containing the
apply_transferoperation of the previous hop - op_index — the index of the
apply_transferorinit_transferoperation inprevious_hop_tx - hop_index — which index in the hops array provided in the original transaction this chain represents.
See Also
- [core.auth.is_auth_op] — for information on auth operations
- [core.crosschain.applied_transfers] — to know more about the crosschain transfer workflow
- [core.crosschain.canceled_transfers] — to know more about transfer canceling
- [crosschain.unapply_transfer] — for information on
© 2024 Chromia