From 1f2cd43292dd840c50c0ed5e526f7b43f0a2c6bb Mon Sep 17 00:00:00 2001 From: Ryan Hall Date: Mon, 23 Sep 2024 16:36:22 -0400 Subject: [PATCH 1/3] update pragma to most restrictive dependancy or feature needs in ccip contracts --- contracts/src/v0.8/ccip/applications/CCIPClientExample.sol | 2 +- contracts/src/v0.8/ccip/applications/CCIPReceiver.sol | 2 +- contracts/src/v0.8/ccip/applications/DefensiveExample.sol | 4 ++-- contracts/src/v0.8/ccip/applications/PingPongDemo.sol | 2 +- contracts/src/v0.8/ccip/applications/SelfFundedPingPong.sol | 2 +- .../v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol | 2 +- .../src/v0.8/ccip/capability/libraries/CCIPConfigTypes.sol | 2 +- contracts/src/v0.8/ccip/interfaces/IFeeQuoter.sol | 2 +- contracts/src/v0.8/ccip/interfaces/IPriceRegistry.sol | 2 +- contracts/src/v0.8/ccip/interfaces/IRMNV2.sol | 2 +- contracts/src/v0.8/ccip/interfaces/IRouterClient.sol | 2 +- contracts/src/v0.8/ccip/libraries/Internal.sol | 2 +- contracts/src/v0.8/ccip/libraries/MerkleMultiProof.sol | 2 +- contracts/src/v0.8/ccip/libraries/RateLimiter.sol | 2 +- contracts/src/v0.8/ccip/ocr/MultiOCR3Base.sol | 2 +- contracts/src/v0.8/ccip/ocr/OCR2Base.sol | 2 +- contracts/src/v0.8/ccip/ocr/OCR2BaseNoChecks.sol | 2 +- contracts/src/v0.8/ccip/pools/LegacyPoolWrapper.sol | 2 +- .../ccip/test/helpers/MaybeRevertingBurnMintTokenPool.sol | 2 +- contracts/src/v0.8/ccip/test/helpers/MessageHasher.sol | 2 +- contracts/src/v0.8/ccip/test/helpers/ReportCodec.sol | 2 +- contracts/src/v0.8/ccip/test/legacy/BurnMintTokenPool1_2.sol | 4 ++-- contracts/src/v0.8/ccip/test/mocks/MockRouter.sol | 2 +- 23 files changed, 25 insertions(+), 25 deletions(-) diff --git a/contracts/src/v0.8/ccip/applications/CCIPClientExample.sol b/contracts/src/v0.8/ccip/applications/CCIPClientExample.sol index 77816ceadb..82de08ea64 100644 --- a/contracts/src/v0.8/ccip/applications/CCIPClientExample.sol +++ b/contracts/src/v0.8/ccip/applications/CCIPClientExample.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; import {IRouterClient} from "../interfaces/IRouterClient.sol"; diff --git a/contracts/src/v0.8/ccip/applications/CCIPReceiver.sol b/contracts/src/v0.8/ccip/applications/CCIPReceiver.sol index 1d4937c77a..208c4e47ce 100644 --- a/contracts/src/v0.8/ccip/applications/CCIPReceiver.sol +++ b/contracts/src/v0.8/ccip/applications/CCIPReceiver.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; import {IAny2EVMMessageReceiver} from "../interfaces/IAny2EVMMessageReceiver.sol"; diff --git a/contracts/src/v0.8/ccip/applications/DefensiveExample.sol b/contracts/src/v0.8/ccip/applications/DefensiveExample.sol index 89435ccbf1..f0501b5d90 100644 --- a/contracts/src/v0.8/ccip/applications/DefensiveExample.sol +++ b/contracts/src/v0.8/ccip/applications/DefensiveExample.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; import {IRouterClient} from "../interfaces/IRouterClient.sol"; @@ -8,7 +8,7 @@ import {CCIPClientExample} from "./CCIPClientExample.sol"; import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/utils/SafeERC20.sol"; -import {EnumerableMap} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/structs/EnumerableMap.sol"; +import {EnumerableMap} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/structs/EnumerableMap.sol"; contract DefensiveExample is CCIPClientExample { using EnumerableMap for EnumerableMap.Bytes32ToUintMap; diff --git a/contracts/src/v0.8/ccip/applications/PingPongDemo.sol b/contracts/src/v0.8/ccip/applications/PingPongDemo.sol index b902c47618..567ad3c27d 100644 --- a/contracts/src/v0.8/ccip/applications/PingPongDemo.sol +++ b/contracts/src/v0.8/ccip/applications/PingPongDemo.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; import {IRouterClient} from "../interfaces/IRouterClient.sol"; diff --git a/contracts/src/v0.8/ccip/applications/SelfFundedPingPong.sol b/contracts/src/v0.8/ccip/applications/SelfFundedPingPong.sol index f9e4fd0aa6..09c81ad5de 100644 --- a/contracts/src/v0.8/ccip/applications/SelfFundedPingPong.sol +++ b/contracts/src/v0.8/ccip/applications/SelfFundedPingPong.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity 0.8.24; import {Router} from "../Router.sol"; import {Client} from "../libraries/Client.sol"; diff --git a/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol b/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol index 6d0b0f72a5..d09dbeb65a 100644 --- a/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol +++ b/contracts/src/v0.8/ccip/capability/interfaces/IOCR3ConfigEncoder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; import {CCIPConfigTypes} from "../libraries/CCIPConfigTypes.sol"; diff --git a/contracts/src/v0.8/ccip/capability/libraries/CCIPConfigTypes.sol b/contracts/src/v0.8/ccip/capability/libraries/CCIPConfigTypes.sol index 59ddb39b5a..e5d77b02e5 100644 --- a/contracts/src/v0.8/ccip/capability/libraries/CCIPConfigTypes.sol +++ b/contracts/src/v0.8/ccip/capability/libraries/CCIPConfigTypes.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; import {Internal} from "../../libraries/Internal.sol"; diff --git a/contracts/src/v0.8/ccip/interfaces/IFeeQuoter.sol b/contracts/src/v0.8/ccip/interfaces/IFeeQuoter.sol index 4fa9cbfec4..84d430410b 100644 --- a/contracts/src/v0.8/ccip/interfaces/IFeeQuoter.sol +++ b/contracts/src/v0.8/ccip/interfaces/IFeeQuoter.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; import {Client} from "../libraries/Client.sol"; import {Internal} from "../libraries/Internal.sol"; diff --git a/contracts/src/v0.8/ccip/interfaces/IPriceRegistry.sol b/contracts/src/v0.8/ccip/interfaces/IPriceRegistry.sol index ed69b7b0cd..583a2e890b 100644 --- a/contracts/src/v0.8/ccip/interfaces/IPriceRegistry.sol +++ b/contracts/src/v0.8/ccip/interfaces/IPriceRegistry.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; import {Internal} from "../libraries/Internal.sol"; diff --git a/contracts/src/v0.8/ccip/interfaces/IRMNV2.sol b/contracts/src/v0.8/ccip/interfaces/IRMNV2.sol index ba6f652e36..0a66af76ef 100644 --- a/contracts/src/v0.8/ccip/interfaces/IRMNV2.sol +++ b/contracts/src/v0.8/ccip/interfaces/IRMNV2.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; import {Internal} from "../libraries/Internal.sol"; diff --git a/contracts/src/v0.8/ccip/interfaces/IRouterClient.sol b/contracts/src/v0.8/ccip/interfaces/IRouterClient.sol index 9805a41bbd..27913b597d 100644 --- a/contracts/src/v0.8/ccip/interfaces/IRouterClient.sol +++ b/contracts/src/v0.8/ccip/interfaces/IRouterClient.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; import {Client} from "../libraries/Client.sol"; diff --git a/contracts/src/v0.8/ccip/libraries/Internal.sol b/contracts/src/v0.8/ccip/libraries/Internal.sol index 13ffc56b91..90b36adb7b 100644 --- a/contracts/src/v0.8/ccip/libraries/Internal.sol +++ b/contracts/src/v0.8/ccip/libraries/Internal.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; import {MerkleMultiProof} from "../libraries/MerkleMultiProof.sol"; import {Client} from "./Client.sol"; diff --git a/contracts/src/v0.8/ccip/libraries/MerkleMultiProof.sol b/contracts/src/v0.8/ccip/libraries/MerkleMultiProof.sol index fed8a1165b..95f52bdc52 100644 --- a/contracts/src/v0.8/ccip/libraries/MerkleMultiProof.sol +++ b/contracts/src/v0.8/ccip/libraries/MerkleMultiProof.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; library MerkleMultiProof { /// @notice Leaf domain separator, should be used as the first 32 bytes of a leaf's preimage. diff --git a/contracts/src/v0.8/ccip/libraries/RateLimiter.sol b/contracts/src/v0.8/ccip/libraries/RateLimiter.sol index 40ac3ca213..84914749e0 100644 --- a/contracts/src/v0.8/ccip/libraries/RateLimiter.sol +++ b/contracts/src/v0.8/ccip/libraries/RateLimiter.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; /// @notice Implements Token Bucket rate limiting. /// @dev uint128 is safe for rate limiter state. diff --git a/contracts/src/v0.8/ccip/ocr/MultiOCR3Base.sol b/contracts/src/v0.8/ccip/ocr/MultiOCR3Base.sol index f3e4d5a9ed..2e698cd230 100644 --- a/contracts/src/v0.8/ccip/ocr/MultiOCR3Base.sol +++ b/contracts/src/v0.8/ccip/ocr/MultiOCR3Base.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; import {ITypeAndVersion} from "../../shared/interfaces/ITypeAndVersion.sol"; diff --git a/contracts/src/v0.8/ccip/ocr/OCR2Base.sol b/contracts/src/v0.8/ccip/ocr/OCR2Base.sol index 52a6df2f3a..74c8e47917 100644 --- a/contracts/src/v0.8/ccip/ocr/OCR2Base.sol +++ b/contracts/src/v0.8/ccip/ocr/OCR2Base.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; import {OCR2Abstract} from "./OCR2Abstract.sol"; diff --git a/contracts/src/v0.8/ccip/ocr/OCR2BaseNoChecks.sol b/contracts/src/v0.8/ccip/ocr/OCR2BaseNoChecks.sol index a79df8d589..8bada2c378 100644 --- a/contracts/src/v0.8/ccip/ocr/OCR2BaseNoChecks.sol +++ b/contracts/src/v0.8/ccip/ocr/OCR2BaseNoChecks.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; import {OwnerIsCreator} from "../../shared/access/OwnerIsCreator.sol"; import {OCR2Abstract} from "./OCR2Abstract.sol"; diff --git a/contracts/src/v0.8/ccip/pools/LegacyPoolWrapper.sol b/contracts/src/v0.8/ccip/pools/LegacyPoolWrapper.sol index bc5adb0b2d..43326681e5 100644 --- a/contracts/src/v0.8/ccip/pools/LegacyPoolWrapper.sol +++ b/contracts/src/v0.8/ccip/pools/LegacyPoolWrapper.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; +pragma solidity 0.8.24; import {IPoolPriorTo1_5} from "../interfaces/IPoolPriorTo1_5.sol"; diff --git a/contracts/src/v0.8/ccip/test/helpers/MaybeRevertingBurnMintTokenPool.sol b/contracts/src/v0.8/ccip/test/helpers/MaybeRevertingBurnMintTokenPool.sol index 73e764ae03..7290e91509 100644 --- a/contracts/src/v0.8/ccip/test/helpers/MaybeRevertingBurnMintTokenPool.sol +++ b/contracts/src/v0.8/ccip/test/helpers/MaybeRevertingBurnMintTokenPool.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity 0.8.24; import {IBurnMintERC20} from "../../../shared/token/ERC20/IBurnMintERC20.sol"; diff --git a/contracts/src/v0.8/ccip/test/helpers/MessageHasher.sol b/contracts/src/v0.8/ccip/test/helpers/MessageHasher.sol index deffb617ca..ea8ba98d44 100644 --- a/contracts/src/v0.8/ccip/test/helpers/MessageHasher.sol +++ b/contracts/src/v0.8/ccip/test/helpers/MessageHasher.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; import {Client} from "../../libraries/Client.sol"; import {Internal} from "../../libraries/Internal.sol"; diff --git a/contracts/src/v0.8/ccip/test/helpers/ReportCodec.sol b/contracts/src/v0.8/ccip/test/helpers/ReportCodec.sol index 73962fb91f..2e50124ab4 100644 --- a/contracts/src/v0.8/ccip/test/helpers/ReportCodec.sol +++ b/contracts/src/v0.8/ccip/test/helpers/ReportCodec.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity 0.8.24; import {Internal} from "../../libraries/Internal.sol"; import {OffRamp} from "../../offRamp/OffRamp.sol"; diff --git a/contracts/src/v0.8/ccip/test/legacy/BurnMintTokenPool1_2.sol b/contracts/src/v0.8/ccip/test/legacy/BurnMintTokenPool1_2.sol index 444e488b3c..c50006d2c4 100644 --- a/contracts/src/v0.8/ccip/test/legacy/BurnMintTokenPool1_2.sol +++ b/contracts/src/v0.8/ccip/test/legacy/BurnMintTokenPool1_2.sol @@ -1,5 +1,5 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.0; +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; import {ITypeAndVersion} from "../../../shared/interfaces/ITypeAndVersion.sol"; import {IPoolPriorTo1_5} from "../../interfaces/IPoolPriorTo1_5.sol"; diff --git a/contracts/src/v0.8/ccip/test/mocks/MockRouter.sol b/contracts/src/v0.8/ccip/test/mocks/MockRouter.sol index 9181fb37c2..88a1740886 100644 --- a/contracts/src/v0.8/ccip/test/mocks/MockRouter.sol +++ b/contracts/src/v0.8/ccip/test/mocks/MockRouter.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.4; import {IAny2EVMMessageReceiver} from "../../interfaces/IAny2EVMMessageReceiver.sol"; import {IRouter} from "../../interfaces/IRouter.sol"; From ae187f1630e5de26cd7308aa639a5606e4ba1d0d Mon Sep 17 00:00:00 2001 From: Ryan Hall Date: Tue, 24 Sep 2024 17:17:21 -0400 Subject: [PATCH 2/3] update snapshot --- contracts/gas-snapshots/ccip.gas-snapshot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot index 00f9512d00..5d00beeae3 100644 --- a/contracts/gas-snapshots/ccip.gas-snapshot +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -123,7 +123,7 @@ CommitStore_verify:test_NotBlessed_Success() (gas: 61473) CommitStore_verify:test_Paused_Revert() (gas: 18568) CommitStore_verify:test_TooManyLeaves_Revert() (gas: 36848) DefensiveExampleTest:test_HappyPath_Success() (gas: 200200) -DefensiveExampleTest:test_Recovery() (gas: 424479) +DefensiveExampleTest:test_Recovery() (gas: 424476) E2E:test_E2E_3MessagesSuccess_gas() (gas: 1106985) EVM2EVMOffRamp__releaseOrMintToken:test__releaseOrMintToken_NotACompatiblePool_Revert() (gas: 38322) EVM2EVMOffRamp__releaseOrMintToken:test__releaseOrMintToken_Success() (gas: 104438) From 1f5db67980015861de39b7747b82bb14ca7a9b99 Mon Sep 17 00:00:00 2001 From: Ryan Hall Date: Wed, 25 Sep 2024 10:27:20 -0400 Subject: [PATCH 3/3] update license --- contracts/src/v0.8/ccip/test/legacy/BurnMintTokenPool1_2.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/src/v0.8/ccip/test/legacy/BurnMintTokenPool1_2.sol b/contracts/src/v0.8/ccip/test/legacy/BurnMintTokenPool1_2.sol index c50006d2c4..44de2787c6 100644 --- a/contracts/src/v0.8/ccip/test/legacy/BurnMintTokenPool1_2.sol +++ b/contracts/src/v0.8/ccip/test/legacy/BurnMintTokenPool1_2.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: BUSL pragma solidity ^0.8.20; import {ITypeAndVersion} from "../../../shared/interfaces/ITypeAndVersion.sol";