After some experimentation, we would need a revertContext object to correctly handle a revert.
The following format should address any use case
revertContext:
address asset -> address of the asset (empty is gas token)
uint64 amount
bytes revertMessage -> an arbitrary message that can be set during the initiation of a CCTX, this allow the contract to handle custom revert logic with context from the initial inbound (like for example setting the address of the user that should be refunded for a smart contract to handle onRevert)
revertContext can be used on ZEVM and EVM.
revertContext is passed to all functions handling revert until onRevert. Example: withdrawAndRevert -> revertWithERC20 -> onRevert
change onRevert interface to just take revertContext in argument
Other change to consider:
Consolidate the event emitted between executeRevert and revertWithERC20 into a single Reverted event that emit the RevertContext
After some experimentation, we would need a revertContext object to correctly handle a revert.
The following format should address any use case
revertContext
can be used on ZEVM and EVM.revertContext
is passed to all functions handling revert until onRevert. Example: withdrawAndRevert -> revertWithERC20 -> onRevertchange onRevert interface to just take revertContext in argument
Other change to consider:
executeRevert
andrevertWithERC20
into a singleReverted
event that emit the RevertContext