pub fn create_challenge_txhandler(
kickoff_txhandler: &TxHandler,
operator_reimbursement_address: &Address,
paramset: &'static ProtocolParamset,
) -> Result<TxHandler, BridgeError>
Expand description
Creates a TxHandler
for the challenge
transaction.
This transaction is used to reimburse an operator for a valid challenge, intended to cover their costs for sending asserts transactions, and potentially cover their opportunity cost as their reimbursements are delayed due to the challenge. This cost of a challenge is also used to disincentivize sending challenges for kickoffs that are correct. In case the challenge is correct and operator is proved to be malicious, the challenge cost will be reimbursed using the operator’s collateral that’s locked in Citrea.
§Inputs
- KickoffTx: Challenge utxo
§Outputs
- Operator reimbursement output
- OP_RETURN output (containing EVM address of the challenger, for reimbursement if the challenge is correct)
§Arguments
kickoff_txhandler
- The kickoff transaction handler that the challenge belongs to.operator_reimbursement_address
- The address to reimburse the operator to cover their costs.challenger_evm_address
- The EVM address of the challenger, for reimbursement if the challenge is correct.paramset
- Protocol parameter set.
§Returns
A TxHandler
for the challenge transaction, or a BridgeError
if construction fails.