-
Notifications
You must be signed in to change notification settings - Fork 22
FeeQuoter simplification, fix non-evm & apply link discount #1408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RensR
wants to merge
5
commits into
develop
Choose a base branch
from
feeQuoter
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
116 changes: 45 additions & 71 deletions
116
ccv/chains/evm/gobindings/generated/latest/fee_quoter/fee_quoter.go
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.4; | ||
|
|
||
| import {Client} from "../libraries/Client.sol"; | ||
| import {Internal} from "../libraries/Internal.sol"; | ||
|
|
||
| interface ILegacyFeeQuoter { | ||
| /// @notice Converts the extraArgs to the latest version and returns the converted message fee in juels. | ||
| /// @notice Validates pool return data. | ||
| /// @param destChainSelector destination chain selector to process, must be a configured valid chain. | ||
| /// @param feeToken token address used to pay for message fees, must be a configured valid fee token. | ||
| /// @param feeTokenAmount Fee token amount. | ||
| /// @param extraArgs Message extra args that were passed in by the client. | ||
| /// @param messageReceiver Message receiver address in bytes from EVM2AnyMessage.receiver | ||
| /// @return msgFeeJuels message fee in juels. | ||
| /// @return isOutOfOrderExecution true if the message should be executed out of order. | ||
| /// @return convertedExtraArgs extra args converted to the latest family-specific args version. | ||
| /// @return tokenReceiver token receiver address in bytes on destination chain | ||
| function processMessageArgs( | ||
| uint64 destChainSelector, | ||
| address feeToken, | ||
| uint256 feeTokenAmount, | ||
| bytes calldata extraArgs, | ||
| bytes calldata messageReceiver | ||
| ) | ||
| external | ||
| view | ||
| returns ( | ||
| uint256 msgFeeJuels, | ||
| bool isOutOfOrderExecution, | ||
| bytes memory convertedExtraArgs, | ||
| bytes memory tokenReceiver | ||
| ); | ||
|
|
||
| /// @notice Validates the ccip message & returns the fee. | ||
| /// @param destChainSelector The destination chain selector. | ||
| /// @param message The message to get quote for. | ||
| /// @return feeTokenAmount The amount of fee token needed for the fee, in smallest denomination of the fee token. | ||
| function getValidatedFee( | ||
| uint64 destChainSelector, | ||
| Client.EVM2AnyMessage calldata message | ||
| ) external view returns (uint256 feeTokenAmount); | ||
|
|
||
| /// @notice Convert a given token amount to target token amount. | ||
| /// @dev this function assumes that no more than 1e59 dollars are sent as payment. | ||
| /// If more is sent, the multiplication of feeTokenAmount and feeTokenValue will overflow. | ||
| /// Since there isn't even close to 1e59 dollars in the world economy this is safe. | ||
| /// @param fromToken The given token address. | ||
| /// @param fromTokenAmount The given token amount. | ||
| /// @param toToken The target token address. | ||
| /// @return toTokenAmount The target token amount. | ||
| function convertTokenAmount( | ||
| address fromToken, | ||
| uint256 fromTokenAmount, | ||
| address toToken | ||
| ) external view returns (uint256 toTokenAmount); | ||
|
|
||
| /// @notice Gets the fee token price and the gas price, both denominated in dollars. | ||
| /// @param token The source token to get the price for. | ||
| /// @param destChainSelector The destination chain to get the gas price for. | ||
| /// @return tokenPrice The price of the feeToken in 1e18 dollars per base unit. | ||
| /// @return gasPrice The price of gas in 1e18 dollars per base unit. | ||
| function getTokenAndGasPrices( | ||
| address token, | ||
| uint64 destChainSelector | ||
| ) external view returns (uint224 tokenPrice, uint224 gasPrice); | ||
|
|
||
| /// @notice Validates pool return data. | ||
| /// @param destChainSelector Destination chain selector to which the token amounts are sent to. | ||
| /// @param onRampTokenTransfers Token amounts with populated pool return data. | ||
| /// @param sourceTokenAmounts Token amounts originally sent in a Client.EVM2AnyMessage message. | ||
| /// @return destExecDataPerToken Destination chain execution data. | ||
| function processPoolReturnData( | ||
| uint64 destChainSelector, | ||
| Internal.EVM2AnyTokenTransfer[] calldata onRampTokenTransfers, | ||
| Client.EVMTokenAmount[] calldata sourceTokenAmounts | ||
| ) external view returns (bytes[] memory destExecDataPerToken); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracted to clearly show what can be removed in future versions and what doesn't have to be written for net-new non-evms