ForceCancelOrder
Ask AI
ForceCancelOrder closes an order that blocks its group's rounds. As with CancelOrder, accrued output and unsold input go to the order owner; the caller receives nothing but the freed storage deposit of the order's execution logs. It returns the refunded input and the output paid.
The order must have rounds left and be, as checked on-chain:
- below the minimum per execution a new order of its token needs now (reason below_min_amount), or
- in a due round that, as quoted now, credits it less than one output unit after its execution fee (no_order_output), or
- the largest order (by amountPerExecution, ties included) of a due round that no pool can fill as quoted now while a pool fills part of it, with some output, within the price limit (exceeds_pool_capacity). A round that needs several orders gone is shrunk one largest order per call.
Any other order reverts with "order does not block its group". DCAOrderForceCancelled reports the reason.
Only accounts holding the role assigned to the ForceCancelOrder selector in gno.land/r/gnoswap/order/keeper (DCAKeeperRole at deployment). Reverts while the withdraw operation is halted.
Command
# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.
gnokey maketx call -pkgpath "gno.land/r/gnoswap/order/dca" -func "ForceCancelOrder" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/order/dca" -func "ForceCancelOrder" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx