Calculate the total cost in origin native tokens. This is done by using the exchange rate between the destination native token and the origin native token, destination gas prices, and the total amount of gas being paid for. If there's an overpayment, refunds are sent to the _refundAddress. If there's an underpayment, revert
To avoid needing to build out the infrastructure to report token exchange rates and gas prices from day 1, we can tap into the existing LayerZero prices where we can. Therefore the contract should let the owner configure the source of the exchange rates / gas prices
We should still build out the ability in the contract for our own infrastructure to write token exchange rate and gas price updates. This should probably be done in a similar way to how LayerZero does it -- writing the exchange rate and gas price to a single storage slot, etc
We want the "base IGP" (as it's been referenced by https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/1298 and associated issues) to be the place where the on-chain fee quoting calculation exists.
At a high level, this IGP should:
_refundAddress
. If there's an underpayment, revertquoteGasPayment
(see https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/1296 for suggested interface) that can be used to estimate paymentThis issue tracks: