archway-network / archway

Archway Network
https://archway.io
Other
72 stars 99 forks source link

feat(x/callback): Handle callback fees #517

Closed spoo-bar closed 9 months ago

spoo-bar commented 9 months ago

Handle fees in the following way for the following events

  1. RequestCallback When a callback is being registered, calculate the appropriate futureReservationFee, blockReservationFee, transactionFee and ensure that the amount sent in the tx matches the expected amount. Any surplus is stored as surplusFees. Send all the tokens to the module account.

  2. CancelCallback transactionFee - Refund completely futureReservationFee - Send to FeeCollector blockReservationFee - Send to FeeCollector surplusFees - Refund completely

  3. ExecuteCallback transactionFee - Calculate the amount of gas consumed and the total tx fees for that amount of gas. If the tx fees is lesser than what was paid, refund the rest to the address who reserved the callback. Send the tx fees to fee_collector. futureReservationFee - Send to FeeCollector blockReservationFee - Send to FeeCollector surplusFees - Send to FeeCollector

spoo-bar commented 9 months ago

Implemented with https://github.com/archway-network/archway/pull/518