-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multi-OffRamp - per-chain configs (#761)
## Motivation Implements per-chain source configs in the MultiOffRamp, which allows an OffRamp to support more than one source configuration ## Solution Modifies the MultiOffRamp configs to be per-chain, along with getters and setters. Puts TODOs for execution and other functional parts **Focus**: The focus of the PR are the source config state, event, set/get and constructor changes **Out of scope for this PR:** * State changes to be per-chain * Per-chain ARL * Full test coverage for non-config setters / getters
- Loading branch information
1 parent
828be93
commit 499bfa7
Showing
12 changed files
with
3,831 additions
and
61 deletions.
There are no files selected for viewing
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,5 @@ | ||
--- | ||
"ccip": minor | ||
--- | ||
|
||
Per-chain configs for MultiOffRamp |
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,5 @@ | ||
--- | ||
"@chainlink/contracts-ccip": minor | ||
--- | ||
|
||
Per-chain configs for MultiOffRamp |
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
186 changes: 127 additions & 59 deletions
186
contracts/src/v0.8/ccip/offRamp/EVM2EVMMultiOffRamp.sol
Large diffs are not rendered by default.
Oops, something went wrong.
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
29 changes: 29 additions & 0 deletions
29
contracts/src/v0.8/ccip/test/helpers/EVM2EVMMultiOffRampHelper.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,29 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity 0.8.19; | ||
|
||
import {Client} from "../../libraries/Client.sol"; | ||
import {Internal} from "../../libraries/Internal.sol"; | ||
import {RateLimiter} from "../../libraries/RateLimiter.sol"; | ||
import {EVM2EVMMultiOffRamp} from "../../offRamp/EVM2EVMMultiOffRamp.sol"; | ||
import {IgnoreContractSize} from "./IgnoreContractSize.sol"; | ||
|
||
contract EVM2EVMMultiOffRampHelper is EVM2EVMMultiOffRamp, IgnoreContractSize { | ||
constructor( | ||
StaticConfig memory staticConfig, | ||
SourceChainConfigArgs[] memory sourceChainConfigs, | ||
RateLimiter.Config memory rateLimiterConfig | ||
) EVM2EVMMultiOffRamp(staticConfig, sourceChainConfigs, rateLimiterConfig) {} | ||
|
||
function metadataHash(uint64 sourceChainSelector, address onRamp) external view returns (bytes32) { | ||
return _metadataHash(sourceChainSelector, onRamp, Internal.EVM_2_EVM_MESSAGE_HASH); | ||
} | ||
|
||
function releaseOrMintTokens( | ||
Client.EVMTokenAmount[] memory sourceTokenAmounts, | ||
EVM2EVMMultiOffRamp.Any2EVMMessageRoute memory messageRoute, | ||
bytes[] calldata sourceTokenData, | ||
bytes[] calldata offchainTokenData | ||
) external returns (Client.EVMTokenAmount[] memory) { | ||
return _releaseOrMintTokens(sourceTokenAmounts, messageRoute, sourceTokenData, offchainTokenData); | ||
} | ||
} |
Oops, something went wrong.