From 820bfad30e1942771d6c152e8d6c8f6cfb7fd710 Mon Sep 17 00:00:00 2001 From: Ryan Hall Date: Mon, 16 Sep 2024 12:53:58 -0400 Subject: [PATCH] wip --- .../interfaces/{IRMNV2.sol => IRMNRemote.sol} | 2 +- contracts/src/v0.8/ccip/offRamp/OffRamp.sol | 20 +++++++------- contracts/src/v0.8/ccip/onRamp/OnRamp.sol | 16 ++++++------ contracts/src/v0.8/ccip/rmn/RMNRemote.sol | 12 ++++----- contracts/src/v0.8/ccip/test/BaseTest.t.sol | 8 +++--- .../ccip/test/e2e/MultiRampsEnd2End.t.sol | 4 +-- .../src/v0.8/ccip/test/offRamp/OffRamp.t.sol | 26 +++++++++---------- .../v0.8/ccip/test/offRamp/OffRampSetup.t.sol | 12 ++++----- .../src/v0.8/ccip/test/onRamp/OnRamp.t.sol | 12 ++++----- .../v0.8/ccip/test/onRamp/OnRampSetup.t.sol | 4 +-- .../src/v0.8/ccip/test/rmn/RMNRemote.t.sol | 14 +++++----- .../v0.8/ccip/test/rmn/RMNRemoteSetup.t.sol | 10 +++---- 12 files changed, 70 insertions(+), 70 deletions(-) rename contracts/src/v0.8/ccip/interfaces/{IRMNV2.sol => IRMNRemote.sol} (98%) diff --git a/contracts/src/v0.8/ccip/interfaces/IRMNV2.sol b/contracts/src/v0.8/ccip/interfaces/IRMNRemote.sol similarity index 98% rename from contracts/src/v0.8/ccip/interfaces/IRMNV2.sol rename to contracts/src/v0.8/ccip/interfaces/IRMNRemote.sol index 0a66af76efb..536a8237206 100644 --- a/contracts/src/v0.8/ccip/interfaces/IRMNV2.sol +++ b/contracts/src/v0.8/ccip/interfaces/IRMNRemote.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.4; import {Internal} from "../libraries/Internal.sol"; /// @notice This interface contains the only RMN-related functions that might be used on-chain by other CCIP contracts. -interface IRMNV2 { +interface IRMNRemote { /// @notice signature components from RMN nodes struct Signature { bytes32 r; diff --git a/contracts/src/v0.8/ccip/offRamp/OffRamp.sol b/contracts/src/v0.8/ccip/offRamp/OffRamp.sol index 5fcddb486e9..e457157b45a 100644 --- a/contracts/src/v0.8/ccip/offRamp/OffRamp.sol +++ b/contracts/src/v0.8/ccip/offRamp/OffRamp.sol @@ -7,7 +7,7 @@ import {IFeeQuoter} from "../interfaces/IFeeQuoter.sol"; import {IMessageInterceptor} from "../interfaces/IMessageInterceptor.sol"; import {INonceManager} from "../interfaces/INonceManager.sol"; import {IPoolV1} from "../interfaces/IPool.sol"; -import {IRMNV2} from "../interfaces/IRMNV2.sol"; +import {IRMNRemote} from "../interfaces/IRMNRemote.sol"; import {IRouter} from "../interfaces/IRouter.sol"; import {ITokenAdminRegistry} from "../interfaces/ITokenAdminRegistry.sol"; @@ -95,7 +95,7 @@ contract OffRamp is ITypeAndVersion, MultiOCR3Base { // solhint-disable-next-line gas-struct-packing struct StaticConfig { uint64 chainSelector; // ───╮ Destination chainSelector - IRMNV2 rmn; // ─────────────╯ RMN Verification Contract + IRMNRemote rmnRemote; // ───╯ RMN Verification Contract address tokenAdminRegistry; // Token admin registry address address nonceManager; // Nonce manager address } @@ -130,7 +130,7 @@ contract OffRamp is ITypeAndVersion, MultiOCR3Base { struct CommitReport { Internal.PriceUpdates priceUpdates; // Collection of gas and price updates to commit Internal.MerkleRoot[] merkleRoots; // Collection of merkle roots per source chain to commit - IRMNV2.Signature[] rmnSignatures; // RMN signatures on the merkle roots + IRMNRemote.Signature[] rmnSignatures; // RMN signatures on the merkle roots uint256 rmnRawVs; // Raw v values of the RMN signatures } @@ -147,7 +147,7 @@ contract OffRamp is ITypeAndVersion, MultiOCR3Base { /// @dev ChainSelector of this chain uint64 internal immutable i_chainSelector; /// @dev The RMN verification contract - IRMNV2 internal immutable i_rmn; + IRMNRemote internal immutable i_rmnRemote; /// @dev The address of the token admin registry address internal immutable i_tokenAdminRegistry; /// @dev The address of the nonce manager @@ -178,7 +178,7 @@ contract OffRamp is ITypeAndVersion, MultiOCR3Base { SourceChainConfigArgs[] memory sourceChainConfigs ) MultiOCR3Base() { if ( - address(staticConfig.rmn) == address(0) || staticConfig.tokenAdminRegistry == address(0) + address(staticConfig.rmnRemote) == address(0) || staticConfig.tokenAdminRegistry == address(0) || staticConfig.nonceManager == address(0) ) { revert ZeroAddressNotAllowed(); @@ -189,7 +189,7 @@ contract OffRamp is ITypeAndVersion, MultiOCR3Base { } i_chainSelector = staticConfig.chainSelector; - i_rmn = staticConfig.rmn; + i_rmnRemote = staticConfig.rmnRemote; i_tokenAdminRegistry = staticConfig.tokenAdminRegistry; i_nonceManager = staticConfig.nonceManager; emit StaticConfigSet(staticConfig); @@ -357,7 +357,7 @@ contract OffRamp is ITypeAndVersion, MultiOCR3Base { ) internal { uint64 sourceChainSelector = report.sourceChainSelector; bool manualExecution = manualExecGasExecOverrides.length != 0; - if (i_rmn.isCursed(bytes16(uint128(sourceChainSelector)))) { + if (i_rmnRemote.isCursed(bytes16(uint128(sourceChainSelector)))) { if (manualExecution) { // For manual execution we don't want to silently fail so we revert revert CursedByRMN(sourceChainSelector); @@ -785,7 +785,7 @@ contract OffRamp is ITypeAndVersion, MultiOCR3Base { // Verify RMN signatures if (commitReport.merkleRoots.length > 0) { - i_rmn.verify(address(this), commitReport.merkleRoots, commitReport.rmnSignatures, commitReport.rmnRawVs); + i_rmnRemote.verify(address(this), commitReport.merkleRoots, commitReport.rmnSignatures, commitReport.rmnRawVs); } // Check if the report contains price updates @@ -811,7 +811,7 @@ contract OffRamp is ITypeAndVersion, MultiOCR3Base { Internal.MerkleRoot memory root = commitReport.merkleRoots[i]; uint64 sourceChainSelector = root.sourceChainSelector; - if (i_rmn.isCursed(bytes16(uint128(sourceChainSelector)))) { + if (i_rmnRemote.isCursed(bytes16(uint128(sourceChainSelector)))) { revert CursedByRMN(sourceChainSelector); } @@ -900,7 +900,7 @@ contract OffRamp is ITypeAndVersion, MultiOCR3Base { function getStaticConfig() external view returns (StaticConfig memory) { return StaticConfig({ chainSelector: i_chainSelector, - rmn: i_rmn, + rmnRemote: i_rmnRemote, tokenAdminRegistry: i_tokenAdminRegistry, nonceManager: i_nonceManager }); diff --git a/contracts/src/v0.8/ccip/onRamp/OnRamp.sol b/contracts/src/v0.8/ccip/onRamp/OnRamp.sol index 959d831a396..973ff6e1773 100644 --- a/contracts/src/v0.8/ccip/onRamp/OnRamp.sol +++ b/contracts/src/v0.8/ccip/onRamp/OnRamp.sol @@ -7,7 +7,7 @@ import {IFeeQuoter} from "../interfaces/IFeeQuoter.sol"; import {IMessageInterceptor} from "../interfaces/IMessageInterceptor.sol"; import {INonceManager} from "../interfaces/INonceManager.sol"; import {IPoolV1} from "../interfaces/IPool.sol"; -import {IRMNV2} from "../interfaces/IRMNV2.sol"; +import {IRMNRemote} from "../interfaces/IRMNRemote.sol"; import {IRouter} from "../interfaces/IRouter.sol"; import {ITokenAdminRegistry} from "../interfaces/ITokenAdminRegistry.sol"; @@ -58,7 +58,7 @@ contract OnRamp is IEVM2AnyOnRampClient, ITypeAndVersion, OwnerIsCreator { // solhint-disable-next-line gas-struct-packing struct StaticConfig { uint64 chainSelector; // ─────╮ Source chain selector - IRMNV2 rmn; // ───────────────╯ RMN remote address + IRMNRemote rmnRemote; // ─────╯ RMN remote address address nonceManager; // Nonce manager address address tokenAdminRegistry; // Token admin registry address } @@ -111,7 +111,7 @@ contract OnRamp is IEVM2AnyOnRampClient, ITypeAndVersion, OwnerIsCreator { /// @dev The chain ID of the source chain that this contract is deployed to uint64 private immutable i_chainSelector; /// @dev The rmn contract - IRMNV2 private immutable i_rmn; + IRMNRemote private immutable i_rmnRemote; /// @dev The address of the nonce manager address private immutable i_nonceManager; /// @dev The address of the token admin registry @@ -130,14 +130,14 @@ contract OnRamp is IEVM2AnyOnRampClient, ITypeAndVersion, OwnerIsCreator { DestChainConfigArgs[] memory destChainConfigArgs ) { if ( - staticConfig.chainSelector == 0 || address(staticConfig.rmn) == address(0) + staticConfig.chainSelector == 0 || address(staticConfig.rmnRemote) == address(0) || staticConfig.nonceManager == address(0) || staticConfig.tokenAdminRegistry == address(0) ) { revert InvalidConfig(); } i_chainSelector = staticConfig.chainSelector; - i_rmn = staticConfig.rmn; + i_rmnRemote = staticConfig.rmnRemote; i_nonceManager = staticConfig.nonceManager; i_tokenAdminRegistry = staticConfig.tokenAdminRegistry; @@ -312,7 +312,7 @@ contract OnRamp is IEVM2AnyOnRampClient, ITypeAndVersion, OwnerIsCreator { function getStaticConfig() external view returns (StaticConfig memory) { return StaticConfig({ chainSelector: i_chainSelector, - rmn: i_rmn, + rmnRemote: i_rmnRemote, nonceManager: i_nonceManager, tokenAdminRegistry: i_tokenAdminRegistry }); @@ -349,7 +349,7 @@ contract OnRamp is IEVM2AnyOnRampClient, ITypeAndVersion, OwnerIsCreator { emit ConfigSet( StaticConfig({ chainSelector: i_chainSelector, - rmn: i_rmn, + rmnRemote: i_rmnRemote, nonceManager: i_nonceManager, tokenAdminRegistry: i_tokenAdminRegistry }), @@ -479,7 +479,7 @@ contract OnRamp is IEVM2AnyOnRampClient, ITypeAndVersion, OwnerIsCreator { uint64 destChainSelector, Client.EVM2AnyMessage calldata message ) external view returns (uint256 feeTokenAmount) { - if (i_rmn.isCursed(bytes16(uint128(destChainSelector)))) revert CursedByRMN(destChainSelector); + if (i_rmnRemote.isCursed(bytes16(uint128(destChainSelector)))) revert CursedByRMN(destChainSelector); return IFeeQuoter(s_dynamicConfig.feeQuoter).getValidatedFee(destChainSelector, message); } diff --git a/contracts/src/v0.8/ccip/rmn/RMNRemote.sol b/contracts/src/v0.8/ccip/rmn/RMNRemote.sol index 88fdd205771..0d38da22b3d 100644 --- a/contracts/src/v0.8/ccip/rmn/RMNRemote.sol +++ b/contracts/src/v0.8/ccip/rmn/RMNRemote.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.24; import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; -import {IRMNV2} from "../interfaces/IRMNV2.sol"; +import {IRMNRemote} from "../interfaces/IRMNRemote.sol"; import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; import {EnumerableSet} from "../../shared/enumerable/EnumerableSetWithBytes16.sol"; @@ -19,7 +19,7 @@ bytes16 constant LEGACY_CURSE_SUBJECT = 0x01000000000000000000000000000000; bytes16 constant GLOBAL_CURSE_SUBJECT = 0x01000000000000000000000000000001; /// @notice This contract supports verification of RMN reports for any Any2EVM OffRamp. -contract RMNRemote is OwnerIsCreator, ITypeAndVersion, IRMNV2 { +contract RMNRemote is OwnerIsCreator, ITypeAndVersion, IRMNRemote { using EnumerableSet for EnumerableSet.Bytes16Set; error AlreadyCursed(bytes16 subject); @@ -85,7 +85,7 @@ contract RMNRemote is OwnerIsCreator, ITypeAndVersion, IRMNV2 { // │ Verification │ // ================================================================ - /// @inheritdoc IRMNV2 + /// @inheritdoc IRMNRemote function verify( address offrampAddress, Internal.MerkleRoot[] calldata merkleRoots, @@ -224,12 +224,12 @@ contract RMNRemote is OwnerIsCreator, ITypeAndVersion, IRMNV2 { emit Uncursed(subjects); } - /// @inheritdoc IRMNV2 + /// @inheritdoc IRMNRemote function getCursedSubjects() external view returns (bytes16[] memory subjects) { return s_cursedSubjects.values(); } - /// @inheritdoc IRMNV2 + /// @inheritdoc IRMNRemote function isCursed() external view returns (bool) { if (s_cursedSubjects.length() == 0) { return false; @@ -237,7 +237,7 @@ contract RMNRemote is OwnerIsCreator, ITypeAndVersion, IRMNV2 { return s_cursedSubjects.contains(LEGACY_CURSE_SUBJECT) || s_cursedSubjects.contains(GLOBAL_CURSE_SUBJECT); } - /// @inheritdoc IRMNV2 + /// @inheritdoc IRMNRemote function isCursed(bytes16 subject) external view returns (bool) { if (s_cursedSubjects.length() == 0) { return false; diff --git a/contracts/src/v0.8/ccip/test/BaseTest.t.sol b/contracts/src/v0.8/ccip/test/BaseTest.t.sol index f6cd83672e8..0c4d7d632c3 100644 --- a/contracts/src/v0.8/ccip/test/BaseTest.t.sol +++ b/contracts/src/v0.8/ccip/test/BaseTest.t.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.24; // Imports to any non-library are not allowed due to the significant cascading // compile time increase they cause when imported into this base test. -import {IRMNV2} from "../interfaces/IRMNV2.sol"; +import {IRMNRemote} from "../interfaces/IRMNRemote.sol"; import {Internal} from "../libraries/Internal.sol"; import {RateLimiter} from "../libraries/RateLimiter.sol"; import {MockRMN} from "./mocks/MockRMN.sol"; @@ -71,7 +71,7 @@ contract BaseTest is Test { address internal constant ADMIN = 0x11118e64e1FB0c487f25dD6D3601FF6aF8d32E4e; MockRMN internal s_mockRMN; - IRMNV2 internal s_mockRMNRemote; + IRMNRemote internal s_mockRMNRemote; // nonce for pseudo-random number generation, not to be exposed to test suites uint256 private randNonce; @@ -92,9 +92,9 @@ contract BaseTest is Test { // setup mock RMN & RMNRemote s_mockRMN = new MockRMN(); - s_mockRMNRemote = IRMNV2(makeAddr("MOCK RMN REMOTE")); + s_mockRMNRemote = IRMNRemote(makeAddr("MOCK RMN REMOTE")); vm.etch(address(s_mockRMNRemote), bytes("fake bytecode")); - vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSelector(IRMNV2.verify.selector), bytes("")); + vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSelector(IRMNRemote.verify.selector), bytes("")); _setMockRMNGlobalCurse(false); vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSignature("isCursed(bytes16)"), abi.encode(false)); // no curses by defaule } diff --git a/contracts/src/v0.8/ccip/test/e2e/MultiRampsEnd2End.t.sol b/contracts/src/v0.8/ccip/test/e2e/MultiRampsEnd2End.t.sol index 59f727c2512..f000cd8bae4 100644 --- a/contracts/src/v0.8/ccip/test/e2e/MultiRampsEnd2End.t.sol +++ b/contracts/src/v0.8/ccip/test/e2e/MultiRampsEnd2End.t.sol @@ -5,7 +5,7 @@ import {IRMN} from "../../interfaces/IRMN.sol"; import {AuthorizedCallers} from "../../../shared/access/AuthorizedCallers.sol"; import {NonceManager} from "../../NonceManager.sol"; -import {IRMNV2} from "../../interfaces/IRMNV2.sol"; +import {IRMNRemote} from "../../interfaces/IRMNRemote.sol"; import {LockReleaseTokenPool} from "../../pools/LockReleaseTokenPool.sol"; import {TokenAdminRegistry} from "../../tokenAdminRegistry/TokenAdminRegistry.sol"; import "../helpers/MerkleHelper.sol"; @@ -150,7 +150,7 @@ contract MultiRampsE2E is OnRampSetup, OffRampSetup { merkleRoots[1] = MerkleHelper.getMerkleRoot(hashedMessages2); // TODO make these real sigs :) - IRMNV2.Signature[] memory rmnSignatures = new IRMNV2.Signature[](0); + IRMNRemote.Signature[] memory rmnSignatures = new IRMNRemote.Signature[](0); Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](2); roots[0] = Internal.MerkleRoot({ diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRamp.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRamp.t.sol index 73adbb12c0d..c3442944942 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/OffRamp.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRamp.t.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.24; import {IFeeQuoter} from "../../interfaces/IFeeQuoter.sol"; import {IMessageInterceptor} from "../../interfaces/IMessageInterceptor.sol"; -import {IRMNV2} from "../../interfaces/IRMNV2.sol"; +import {IRMNRemote} from "../../interfaces/IRMNRemote.sol"; import {IRouter} from "../../interfaces/IRouter.sol"; import {ITokenAdminRegistry} from "../../interfaces/ITokenAdminRegistry.sol"; @@ -33,7 +33,7 @@ contract OffRamp_constructor is OffRampSetup { function test_Constructor_Success() public { OffRamp.StaticConfig memory staticConfig = OffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, - rmn: s_mockRMNRemote, + rmnRemote: s_mockRMNRemote, tokenAdminRegistry: address(s_tokenAdminRegistry), nonceManager: address(s_inboundNonceManager) }); @@ -102,7 +102,7 @@ contract OffRamp_constructor is OffRampSetup { // Static config OffRamp.StaticConfig memory gotStaticConfig = s_offRamp.getStaticConfig(); assertEq(staticConfig.chainSelector, gotStaticConfig.chainSelector); - assertEq(address(staticConfig.rmn), address(gotStaticConfig.rmn)); + assertEq(address(staticConfig.rmnRemote), address(gotStaticConfig.rmnRemote)); assertEq(staticConfig.tokenAdminRegistry, gotStaticConfig.tokenAdminRegistry); // Dynamic config @@ -154,7 +154,7 @@ contract OffRamp_constructor is OffRampSetup { s_offRamp = new OffRampHelper( OffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, - rmn: s_mockRMNRemote, + rmnRemote: s_mockRMNRemote, tokenAdminRegistry: address(s_tokenAdminRegistry), nonceManager: address(s_inboundNonceManager) }), @@ -180,7 +180,7 @@ contract OffRamp_constructor is OffRampSetup { s_offRamp = new OffRampHelper( OffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, - rmn: s_mockRMNRemote, + rmnRemote: s_mockRMNRemote, tokenAdminRegistry: address(s_tokenAdminRegistry), nonceManager: address(s_inboundNonceManager) }), @@ -200,7 +200,7 @@ contract OffRamp_constructor is OffRampSetup { s_offRamp = new OffRampHelper( OffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, - rmn: IRMNV2(ZERO_ADDRESS), + rmnRemote: IRMNRemote(ZERO_ADDRESS), tokenAdminRegistry: address(s_tokenAdminRegistry), nonceManager: address(s_inboundNonceManager) }), @@ -220,7 +220,7 @@ contract OffRamp_constructor is OffRampSetup { s_offRamp = new OffRampHelper( OffRamp.StaticConfig({ chainSelector: 0, - rmn: s_mockRMNRemote, + rmnRemote: s_mockRMNRemote, tokenAdminRegistry: address(s_tokenAdminRegistry), nonceManager: address(s_inboundNonceManager) }), @@ -240,7 +240,7 @@ contract OffRamp_constructor is OffRampSetup { s_offRamp = new OffRampHelper( OffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, - rmn: s_mockRMNRemote, + rmnRemote: s_mockRMNRemote, tokenAdminRegistry: ZERO_ADDRESS, nonceManager: address(s_inboundNonceManager) }), @@ -260,7 +260,7 @@ contract OffRamp_constructor is OffRampSetup { s_offRamp = new OffRampHelper( OffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, - rmn: s_mockRMNRemote, + rmnRemote: s_mockRMNRemote, tokenAdminRegistry: address(s_tokenAdminRegistry), nonceManager: ZERO_ADDRESS }), @@ -3367,7 +3367,7 @@ contract OffRamp_commit is OffRampSetup { function test_OnlyTokenPriceUpdates_Success() public { // force RMN verification to fail - vm.mockCallRevert(address(s_mockRMNRemote), abi.encodeWithSelector(IRMNV2.verify.selector), bytes("")); + vm.mockCallRevert(address(s_mockRMNRemote), abi.encodeWithSelector(IRMNRemote.verify.selector), bytes("")); Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](0); OffRamp.CommitReport memory commitReport = OffRamp.CommitReport({ @@ -3390,7 +3390,7 @@ contract OffRamp_commit is OffRampSetup { function test_OnlyGasPriceUpdates_Success() public { // force RMN verification to fail - vm.mockCallRevert(address(s_mockRMNRemote), abi.encodeWithSelector(IRMNV2.verify.selector), bytes("")); + vm.mockCallRevert(address(s_mockRMNRemote), abi.encodeWithSelector(IRMNRemote.verify.selector), bytes("")); Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](0); OffRamp.CommitReport memory commitReport = OffRamp.CommitReport({ @@ -3561,7 +3561,7 @@ contract OffRamp_commit is OffRampSetup { function test_FailedRMNVerification_Reverts() public { // force RMN verification to fail - vm.mockCallRevert(address(s_mockRMNRemote), abi.encodeWithSelector(IRMNV2.verify.selector), bytes("")); + vm.mockCallRevert(address(s_mockRMNRemote), abi.encodeWithSelector(IRMNRemote.verify.selector), bytes("")); OffRamp.CommitReport memory commitReport = _constructCommitReport(); vm.expectRevert(); @@ -3769,7 +3769,7 @@ contract OffRamp_afterOC3ConfigSet is OffRampSetup { s_offRamp = new OffRampHelper( OffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, - rmn: s_mockRMNRemote, + rmnRemote: s_mockRMNRemote, tokenAdminRegistry: address(s_tokenAdminRegistry), nonceManager: address(s_inboundNonceManager) }), diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRampSetup.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRampSetup.t.sol index 6b18992f699..0fb4ff50942 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/OffRampSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRampSetup.t.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.24; import {IAny2EVMMessageReceiver} from "../../interfaces/IAny2EVMMessageReceiver.sol"; import {ICommitStore} from "../../interfaces/ICommitStore.sol"; -import {IRMNV2} from "../../interfaces/IRMNV2.sol"; +import {IRMNRemote} from "../../interfaces/IRMNRemote.sol"; import {AuthorizedCallers} from "../../../shared/access/AuthorizedCallers.sol"; import {NonceManager} from "../../NonceManager.sol"; @@ -54,7 +54,7 @@ contract OffRampSetup is FeeQuoterSetup, MultiOCR3BaseSetup { uint64 internal s_latestSequenceNumber; - IRMNV2.Signature[] internal s_rmnSignatures; + IRMNRemote.Signature[] internal s_rmnSignatures; function setUp() public virtual override(FeeQuoterSetup, MultiOCR3BaseSetup) { FeeQuoterSetup.setUp(); @@ -71,13 +71,13 @@ contract OffRampSetup is FeeQuoterSetup, MultiOCR3BaseSetup { _deployOffRamp(s_mockRMNRemote, s_inboundNonceManager); } - function _deployOffRamp(IRMNV2 rmn, NonceManager nonceManager) internal { + function _deployOffRamp(IRMNRemote rmnRemote, NonceManager nonceManager) internal { OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](0); s_offRamp = new OffRampHelper( OffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, - rmn: rmn, + rmnRemote: rmnRemote, tokenAdminRegistry: address(s_tokenAdminRegistry), nonceManager: address(nonceManager) }), @@ -423,7 +423,7 @@ contract OffRampSetup is FeeQuoterSetup, MultiOCR3BaseSetup { s_offRamp = new OffRampHelper( OffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, - rmn: s_mockRMNRemote, + rmnRemote: s_mockRMNRemote, tokenAdminRegistry: address(s_tokenAdminRegistry), nonceManager: address(s_inboundNonceManager) }), @@ -449,7 +449,7 @@ contract OffRampSetup is FeeQuoterSetup, MultiOCR3BaseSetup { RMN.Voter[] memory voters = new RMN.Voter[](1); voters[0] = RMN.Voter({blessVoteAddr: BLESS_VOTE_ADDR, curseVoteAddr: address(9999), blessWeight: 1, curseWeight: 1}); - // Overwrite base mock rmn with real. + // Overwrite base mock rmnRemote with real. s_realRMN = new RMN(RMN.Config({voters: voters, blessWeightThreshold: 1, curseWeightThreshold: 1})); } diff --git a/contracts/src/v0.8/ccip/test/onRamp/OnRamp.t.sol b/contracts/src/v0.8/ccip/test/onRamp/OnRamp.t.sol index 2a7fac892cf..4b45ff4b237 100644 --- a/contracts/src/v0.8/ccip/test/onRamp/OnRamp.t.sol +++ b/contracts/src/v0.8/ccip/test/onRamp/OnRamp.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.24; import {IMessageInterceptor} from "../../interfaces/IMessageInterceptor.sol"; -import {IRMNV2} from "../../interfaces/IRMNV2.sol"; +import {IRMNRemote} from "../../interfaces/IRMNRemote.sol"; import {IRouter} from "../../interfaces/IRouter.sol"; import {BurnMintERC677} from "../../../shared/token/ERC677/BurnMintERC677.sol"; @@ -22,7 +22,7 @@ contract OnRamp_constructor is OnRampSetup { function test_Constructor_Success() public { OnRamp.StaticConfig memory staticConfig = OnRamp.StaticConfig({ chainSelector: SOURCE_CHAIN_SELECTOR, - rmn: s_mockRMNRemote, + rmnRemote: s_mockRMNRemote, nonceManager: address(s_outboundNonceManager), tokenAdminRegistry: address(s_tokenAdminRegistry) }); @@ -53,7 +53,7 @@ contract OnRamp_constructor is OnRampSetup { new OnRampHelper( OnRamp.StaticConfig({ chainSelector: 0, - rmn: s_mockRMNRemote, + rmnRemote: s_mockRMNRemote, nonceManager: address(s_outboundNonceManager), tokenAdminRegistry: address(s_tokenAdminRegistry) }), @@ -67,7 +67,7 @@ contract OnRamp_constructor is OnRampSetup { s_onRamp = new OnRampHelper( OnRamp.StaticConfig({ chainSelector: SOURCE_CHAIN_SELECTOR, - rmn: IRMNV2(address(0)), + rmnRemote: IRMNRemote(address(0)), nonceManager: address(s_outboundNonceManager), tokenAdminRegistry: address(s_tokenAdminRegistry) }), @@ -81,7 +81,7 @@ contract OnRamp_constructor is OnRampSetup { new OnRampHelper( OnRamp.StaticConfig({ chainSelector: SOURCE_CHAIN_SELECTOR, - rmn: s_mockRMNRemote, + rmnRemote: s_mockRMNRemote, nonceManager: address(0), tokenAdminRegistry: address(s_tokenAdminRegistry) }), @@ -95,7 +95,7 @@ contract OnRamp_constructor is OnRampSetup { new OnRampHelper( OnRamp.StaticConfig({ chainSelector: SOURCE_CHAIN_SELECTOR, - rmn: s_mockRMNRemote, + rmnRemote: s_mockRMNRemote, nonceManager: address(s_outboundNonceManager), tokenAdminRegistry: address(0) }), diff --git a/contracts/src/v0.8/ccip/test/onRamp/OnRampSetup.t.sol b/contracts/src/v0.8/ccip/test/onRamp/OnRampSetup.t.sol index 6ecd3a58071..f60cfcc5ae6 100644 --- a/contracts/src/v0.8/ccip/test/onRamp/OnRampSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/onRamp/OnRampSetup.t.sol @@ -139,7 +139,7 @@ contract OnRampSetup is FeeQuoterFeeSetup { OnRampHelper onRamp = new OnRampHelper( OnRamp.StaticConfig({ chainSelector: sourceChainSelector, - rmn: s_mockRMNRemote, + rmnRemote: s_mockRMNRemote, nonceManager: nonceManager, tokenAdminRegistry: tokenAdminRegistry }), @@ -183,7 +183,7 @@ contract OnRampSetup is FeeQuoterFeeSetup { function _assertStaticConfigsEqual(OnRamp.StaticConfig memory a, OnRamp.StaticConfig memory b) internal pure { assertEq(a.chainSelector, b.chainSelector); - assertEq(address(a.rmn), address(b.rmn)); + assertEq(address(a.rmnRemote), address(b.rmnRemote)); assertEq(a.tokenAdminRegistry, b.tokenAdminRegistry); } diff --git a/contracts/src/v0.8/ccip/test/rmn/RMNRemote.t.sol b/contracts/src/v0.8/ccip/test/rmn/RMNRemote.t.sol index f24b3ac9c94..5f46f856691 100644 --- a/contracts/src/v0.8/ccip/test/rmn/RMNRemote.t.sol +++ b/contracts/src/v0.8/ccip/test/rmn/RMNRemote.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.24; -import {IRMNV2} from "../../interfaces/IRMNV2.sol"; +import {IRMNRemote} from "../../interfaces/IRMNRemote.sol"; import {Internal} from "../../libraries/Internal.sol"; import {GLOBAL_CURSE_SUBJECT, LEGACY_CURSE_SUBJECT, RMNRemote} from "../../rmn/RMNRemote.sol"; import {RMNRemoteSetup} from "./RMNRemoteSetup.t.sol"; @@ -115,7 +115,7 @@ contract RMNRemote_setConfig is RMNRemoteSetup { contract RMNRemote_verify_withConfigNotSet is RMNRemoteSetup { function test_verify_reverts() public { Internal.MerkleRoot[] memory merkleRoots = new Internal.MerkleRoot[](0); - IRMNV2.Signature[] memory signatures = new IRMNV2.Signature[](0); + IRMNRemote.Signature[] memory signatures = new IRMNRemote.Signature[](0); vm.expectRevert(RMNRemote.ConfigNotSet.selector); s_rmnRemote.verify(OFF_RAMP_ADDRESS, merkleRoots, signatures, 0); @@ -144,11 +144,11 @@ contract RMNRemote_verify_withConfigSet is RMNRemoteSetup { vm.stopPrank(); vm.prank(OFF_RAMP_ADDRESS); - s_rmnRemote.verify(OFF_RAMP_ADDRESS, s_merkleRoots, new IRMNV2.Signature[](0), s_v); + s_rmnRemote.verify(OFF_RAMP_ADDRESS, s_merkleRoots, new IRMNRemote.Signature[](0), s_v); } function test_verify_InvalidSignature_reverts() public { - IRMNV2.Signature memory sig = s_signatures[s_signatures.length - 1]; + IRMNRemote.Signature memory sig = s_signatures[s_signatures.length - 1]; sig.r = _randomBytes32(); s_signatures.pop(); s_signatures.push(sig); @@ -158,9 +158,9 @@ contract RMNRemote_verify_withConfigSet is RMNRemoteSetup { } function test_verify_OutOfOrderSignatures_not_sorted_reverts() public { - IRMNV2.Signature memory sig1 = s_signatures[s_signatures.length - 1]; + IRMNRemote.Signature memory sig1 = s_signatures[s_signatures.length - 1]; s_signatures.pop(); - IRMNV2.Signature memory sig2 = s_signatures[s_signatures.length - 1]; + IRMNRemote.Signature memory sig2 = s_signatures[s_signatures.length - 1]; s_signatures.pop(); s_signatures.push(sig1); s_signatures.push(sig2); @@ -170,7 +170,7 @@ contract RMNRemote_verify_withConfigSet is RMNRemoteSetup { } function test_verify_OutOfOrderSignatures_duplicateSignature_reverts() public { - IRMNV2.Signature memory sig = s_signatures[s_signatures.length - 2]; + IRMNRemote.Signature memory sig = s_signatures[s_signatures.length - 2]; s_signatures.pop(); s_signatures.push(sig); diff --git a/contracts/src/v0.8/ccip/test/rmn/RMNRemoteSetup.t.sol b/contracts/src/v0.8/ccip/test/rmn/RMNRemoteSetup.t.sol index 6896cb91c6f..ad25abcf1aa 100644 --- a/contracts/src/v0.8/ccip/test/rmn/RMNRemoteSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/rmn/RMNRemoteSetup.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.24; -import {IRMNV2} from "../../interfaces/IRMNV2.sol"; +import {IRMNRemote} from "../../interfaces/IRMNRemote.sol"; import {Internal} from "../../libraries/Internal.sol"; import {RMNRemote} from "../../rmn/RMNRemote.sol"; import {BaseTest} from "../BaseTest.t.sol"; @@ -17,7 +17,7 @@ contract RMNRemoteSetup is BaseTest { Vm.Wallet[] public s_signerWallets; Internal.MerkleRoot[] s_merkleRoots; - IRMNV2.Signature[] s_signatures; + IRMNRemote.Signature[] s_signatures; uint256 internal s_v; bytes16 internal constant curseSubj1 = bytes16(keccak256("subject 1")); @@ -76,7 +76,7 @@ contract RMNRemoteSetup is BaseTest { } for (uint256 i = 0; i < numSigs; i++) { - (uint8 v, IRMNV2.Signature memory sig) = _signDestLaneUpdate(s_merkleRoots, s_signerWallets[i]); + (uint8 v, IRMNRemote.Signature memory sig) = _signDestLaneUpdate(s_merkleRoots, s_signerWallets[i]); s_signatures.push(sig); if (v == 28) { s_v += 1 << i; @@ -103,7 +103,7 @@ contract RMNRemoteSetup is BaseTest { function _signDestLaneUpdate( Internal.MerkleRoot[] memory merkleRoots, Vm.Wallet memory wallet - ) private returns (uint8 sigV, IRMNV2.Signature memory) { + ) private returns (uint8 sigV, IRMNRemote.Signature memory) { (, RMNRemote.Config memory config) = s_rmnRemote.getVersionedConfig(); bytes32 digest = keccak256( abi.encode( @@ -119,7 +119,7 @@ contract RMNRemoteSetup is BaseTest { ) ); (uint8 v, bytes32 r, bytes32 s) = vm.sign(wallet, digest); - return (v, IRMNV2.Signature({r: r, s: s})); + return (v, IRMNRemote.Signature({r: r, s: s})); } /// @notice bubble sort on a storage array of wallets