forked from smartcontractkit/ccip
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: dynamically fetch dest gas amt
- Loading branch information
1 parent
758cbc3
commit 6044944
Showing
4 changed files
with
101 additions
and
38 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
contracts/src/v0.8/ccip/test/helpers/interfaces/IEVM2EVMOffRamp.sol
This file contains 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,17 @@ | ||
pragma solidity ^0.8.0; | ||
|
||
import {ITypeAndVersion} from "../../../../shared/interfaces/ITypeAndVersion.sol"; | ||
import {IAny2EVMOffRamp} from "../../../interfaces/IAny2EVMOffRamp.sol"; | ||
import {Internal} from "../../../libraries/Internal.sol"; | ||
|
||
interface IEVM2EVMOffRamp_1_2 is IAny2EVMOffRamp, ITypeAndVersion { | ||
function executeSingleMessage(Internal.EVM2EVMMessage memory message, bytes[] memory offchainTokenData) external; | ||
} | ||
|
||
interface IEVM2EVMOffRamp_1_5 is IAny2EVMOffRamp, ITypeAndVersion { | ||
function executeSingleMessage( | ||
Internal.EVM2EVMMessage calldata message, | ||
bytes[] calldata offchainTokenData, | ||
uint32[] memory tokenGasOverrides | ||
) external; | ||
} |
46 changes: 46 additions & 0 deletions
46
contracts/src/v0.8/ccip/test/helpers/interfaces/IEVM2EVMOnRamp.sol
This file contains 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,46 @@ | ||
pragma solidity ^0.8.0; | ||
|
||
import {ITypeAndVersion} from "../../../../shared/interfaces/ITypeAndVersion.sol"; | ||
import {IEVM2AnyOnRamp} from "../../../interfaces/IEVM2AnyOnRamp.sol"; | ||
|
||
interface IEVM2EVMOnRamp_1_2 is IEVM2AnyOnRamp, ITypeAndVersion {} | ||
|
||
interface IEVM2EVMOnRamp_1_5 is IEVM2AnyOnRamp, ITypeAndVersion { | ||
struct TokenTransferFeeConfig { | ||
uint32 minFeeUSDCents; // ──────────╮ Minimum fee to charge per token transfer, multiples of 0.01 USD | ||
uint32 maxFeeUSDCents; // │ Maximum fee to charge per token transfer, multiples of 0.01 USD | ||
uint16 deciBps; // │ Basis points charged on token transfers, multiples of 0.1bps, or 1e-5 | ||
uint32 destGasOverhead; // │ Gas charged to execute the token transfer on the destination chain | ||
// │ Extra data availability bytes that are returned from the source pool and sent | ||
uint32 destBytesOverhead; // │ to the destination pool. Must be >= Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES | ||
bool aggregateRateLimitEnabled; // │ Whether this transfer token is to be included in Aggregate Rate Limiting | ||
bool isEnabled; // ─────────────────╯ Whether this token has custom transfer fees | ||
} | ||
|
||
struct DynamicConfig { | ||
address router; // ──────────────────────────╮ Router address | ||
uint16 maxNumberOfTokensPerMsg; // │ Maximum number of distinct ERC20 token transferred per message | ||
uint32 destGasOverhead; // │ Gas charged on top of the gasLimit to cover destination chain costs | ||
uint16 destGasPerPayloadByte; // │ Destination chain gas charged for passing each byte of `data` payload to receiver | ||
uint32 destDataAvailabilityOverheadGas; // ──╯ Extra data availability gas charged on top of the message, e.g. for OCR | ||
uint16 destGasPerDataAvailabilityByte; // ───╮ Amount of gas to charge per byte of message data that needs availability | ||
uint16 destDataAvailabilityMultiplierBps; // │ Multiplier for data availability gas, multiples of bps, or 0.0001 | ||
address priceRegistry; // │ Price registry address | ||
uint32 maxDataBytes; // │ Maximum payload data size in bytes | ||
uint32 maxPerMsgGasLimit; // ────────────────╯ Maximum gas limit for messages targeting EVMs | ||
// │ | ||
// The following three properties are defaults, they can be overridden by setting the TokenTransferFeeConfig for a token | ||
uint16 defaultTokenFeeUSDCents; // ──────────╮ Default token fee charged per token transfer | ||
uint32 defaultTokenDestGasOverhead; // │ Default gas charged to execute the token transfer on the destination chain | ||
bool enforceOutOfOrder; // ──────────────────╯ Whether to enforce the allowOutOfOrderExecution extraArg value to be true. | ||
} | ||
|
||
/// @notice Gets the transfer fee config for a given token. | ||
function getTokenTransferFeeConfig( | ||
address token | ||
) external view returns (TokenTransferFeeConfig memory tokenTransferFeeConfig); | ||
|
||
/// @notice Returns the dynamic onRamp config. | ||
/// @return dynamicConfig the configuration. | ||
function getDynamicConfig() external view returns (DynamicConfig memory dynamicConfig); | ||
} |
This file contains 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 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