diff --git a/contracts/src/v0.8/ccip/pools/GHO/UpgradeableBurnMintTokenPool.sol b/contracts/src/v0.8/ccip/pools/GHO/UpgradeableBurnMintTokenPool.sol index 63044b4d7e..58be87812f 100644 --- a/contracts/src/v0.8/ccip/pools/GHO/UpgradeableBurnMintTokenPool.sol +++ b/contracts/src/v0.8/ccip/pools/GHO/UpgradeableBurnMintTokenPool.sol @@ -53,10 +53,4 @@ contract UpgradeableBurnMintTokenPool is Initializable, UpgradeableBurnMintToken function _burn(uint256 amount) internal virtual override { IBurnMintERC20(address(i_token)).burn(amount); } - - /// @notice Returns the revision number - /// @return The revision number - function REVISION() public pure virtual returns (uint256) { - return 1; - } } diff --git a/contracts/src/v0.8/ccip/pools/GHO/UpgradeableLockReleaseTokenPool.sol b/contracts/src/v0.8/ccip/pools/GHO/UpgradeableLockReleaseTokenPool.sol index 9e06e60588..9a30b1e977 100644 --- a/contracts/src/v0.8/ccip/pools/GHO/UpgradeableLockReleaseTokenPool.sol +++ b/contracts/src/v0.8/ccip/pools/GHO/UpgradeableLockReleaseTokenPool.sol @@ -263,10 +263,4 @@ contract UpgradeableLockReleaseTokenPool is Initializable, UpgradeableTokenPool, _setRateLimitConfig(remoteChainSelector, outboundConfig, inboundConfig); } - - /// @notice Returns the revision number - /// @return The revision number - function REVISION() public pure virtual returns (uint256) { - return 1; - } } diff --git a/contracts/src/v0.8/ccip/pools/GHO/diffs/UpgradeableBurnMintTokenPool_diff.md b/contracts/src/v0.8/ccip/pools/GHO/diffs/UpgradeableBurnMintTokenPool_diff.md index 67b07df888..05c3be4d06 100644 --- a/contracts/src/v0.8/ccip/pools/GHO/diffs/UpgradeableBurnMintTokenPool_diff.md +++ b/contracts/src/v0.8/ccip/pools/GHO/diffs/UpgradeableBurnMintTokenPool_diff.md @@ -1,9 +1,9 @@ ```diff diff --git a/src/v0.8/ccip/pools/BurnMintTokenPool.sol b/src/v0.8/ccip/pools/GHO/UpgradeableBurnMintTokenPool.sol -index 9af0f22f4c..63044b4d7e 100644 +index 9af0f22f4c..58be87812f 100644 --- a/src/v0.8/ccip/pools/BurnMintTokenPool.sol +++ b/src/v0.8/ccip/pools/GHO/UpgradeableBurnMintTokenPool.sol -@@ -1,29 +1,62 @@ +@@ -1,28 +1,55 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.19; +pragma solidity ^0.8.0; @@ -75,11 +75,4 @@ index 9af0f22f4c..63044b4d7e 100644 function _burn(uint256 amount) internal virtual override { IBurnMintERC20(address(i_token)).burn(amount); } -+ -+ /// @notice Returns the revision number -+ /// @return The revision number -+ function REVISION() public pure virtual returns (uint256) { -+ return 1; -+ } - } ``` diff --git a/contracts/src/v0.8/ccip/pools/GHO/diffs/UpgradeableLockReleaseTokenPool_diff.md b/contracts/src/v0.8/ccip/pools/GHO/diffs/UpgradeableLockReleaseTokenPool_diff.md index 5d74a3e9da..1e738e3bdf 100644 --- a/contracts/src/v0.8/ccip/pools/GHO/diffs/UpgradeableLockReleaseTokenPool_diff.md +++ b/contracts/src/v0.8/ccip/pools/GHO/diffs/UpgradeableLockReleaseTokenPool_diff.md @@ -1,6 +1,6 @@ ```diff diff --git a/src/v0.8/ccip/pools/LockReleaseTokenPool.sol b/src/v0.8/ccip/pools/GHO/UpgradeableLockReleaseTokenPool.sol -index 1a17fa0398..9e06e60588 100644 +index 1a17fa0398..9a30b1e977 100644 --- a/src/v0.8/ccip/pools/LockReleaseTokenPool.sol +++ b/src/v0.8/ccip/pools/GHO/UpgradeableLockReleaseTokenPool.sol @@ -1,26 +1,39 @@ @@ -187,15 +187,4 @@ index 1a17fa0398..9e06e60588 100644 /// @notice Checks if the pool can accept liquidity. /// @return true if the pool can accept liquidity, false otherwise. function canAcceptLiquidity() external view returns (bool) { -@@ -166,4 +263,10 @@ contract LockReleaseTokenPool is TokenPool, ILiquidityContainer, ITypeAndVersion - - _setRateLimitConfig(remoteChainSelector, outboundConfig, inboundConfig); - } -+ -+ /// @notice Returns the revision number -+ /// @return The revision number -+ function REVISION() public pure virtual returns (uint256) { -+ return 1; -+ } - } ``` diff --git a/contracts/src/v0.8/ccip/test/mocks/MockUpgradeable.sol b/contracts/src/v0.8/ccip/test/mocks/MockUpgradeable.sol index 9e8f501f43..45eeb5c5d7 100644 --- a/contracts/src/v0.8/ccip/test/mocks/MockUpgradeable.sol +++ b/contracts/src/v0.8/ccip/test/mocks/MockUpgradeable.sol @@ -20,12 +20,4 @@ contract MockUpgradeable is Initializable { function initialize() public reinitializer(2) { // Intentionally left bank } - - /** - * @notice Returns the revision number - * @return The revision number - */ - function REVISION() public pure returns (uint256) { - return 2; - } } diff --git a/contracts/src/v0.8/ccip/test/pools/GHO/GhoBaseTest.t.sol b/contracts/src/v0.8/ccip/test/pools/GHO/GhoBaseTest.t.sol index 24b7bd70ca..66d6fc63b5 100644 --- a/contracts/src/v0.8/ccip/test/pools/GHO/GhoBaseTest.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/GHO/GhoBaseTest.t.sol @@ -116,6 +116,11 @@ abstract contract GhoBaseTest is BaseTest { return address(uint160(uint256(implSlot))); } + function _getUpgradeableVersion(address proxy) internal view returns (uint8) { + // version is 1st slot + return uint8(uint256(vm.load(proxy, bytes32(uint256(0))))); + } + function _enableLane(UtilsStorage storage s, uint256 fromId, uint256 toId) internal { // from UpgradeableTokenPool.ChainUpdate[] memory chainUpdate = new UpgradeableTokenPool.ChainUpdate[](1); diff --git a/contracts/src/v0.8/ccip/test/pools/GHO/GhoTokenPoolEthereum.t.sol b/contracts/src/v0.8/ccip/test/pools/GHO/GhoTokenPoolEthereum.t.sol index 7363d71e6b..f2824d7b6f 100644 --- a/contracts/src/v0.8/ccip/test/pools/GHO/GhoTokenPoolEthereum.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/GHO/GhoTokenPoolEthereum.t.sol @@ -627,7 +627,7 @@ contract GhoTokenPoolEthereum_setBridgeLimitAdmin is GhoTokenPoolEthereumSetup { contract GhoTokenPoolEthereum_upgradeability is GhoTokenPoolEthereumSetup { function testInitialization() public { // Upgradeability - assertEq(s_ghoTokenPool.REVISION(), 1); + assertEq(_getUpgradeableVersion(address(s_ghoTokenPool)), 1); vm.startPrank(PROXY_ADMIN); (bool ok, bytes memory result) = address(s_ghoTokenPool).staticcall( abi.encodeWithSelector(TransparentUpgradeableProxy.admin.selector) @@ -654,17 +654,17 @@ contract GhoTokenPoolEthereum_upgradeability is GhoTokenPoolEthereumSetup { TransparentUpgradeableProxy(payable(address(s_ghoTokenPool))).upgradeToAndCall(address(newImpl), mockImpleParams); vm.startPrank(OWNER); - assertEq(s_ghoTokenPool.REVISION(), 2); + assertEq(_getUpgradeableVersion(address(s_ghoTokenPool)), 2); } function testUpgradeAdminReverts() public { vm.expectRevert(); TransparentUpgradeableProxy(payable(address(s_ghoTokenPool))).upgradeToAndCall(address(0), bytes("")); - assertEq(s_ghoTokenPool.REVISION(), 1); + assertEq(_getUpgradeableVersion(address(s_ghoTokenPool)), 1); vm.expectRevert(); TransparentUpgradeableProxy(payable(address(s_ghoTokenPool))).upgradeTo(address(0)); - assertEq(s_ghoTokenPool.REVISION(), 1); + assertEq(_getUpgradeableVersion(address(s_ghoTokenPool)), 1); } function testChangeAdmin() public { diff --git a/contracts/src/v0.8/ccip/test/pools/GHO/GhoTokenPoolRemote.t.sol b/contracts/src/v0.8/ccip/test/pools/GHO/GhoTokenPoolRemote.t.sol index bba33d8066..dd784e68c1 100644 --- a/contracts/src/v0.8/ccip/test/pools/GHO/GhoTokenPoolRemote.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/GHO/GhoTokenPoolRemote.t.sol @@ -182,7 +182,7 @@ contract GhoTokenPoolRemote_releaseOrMint is GhoTokenPoolRemoteSetup { contract GhoTokenPoolEthereum_upgradeability is GhoTokenPoolRemoteSetup { function testInitialization() public { // Upgradeability - assertEq(s_pool.REVISION(), 1); + assertEq(_getUpgradeableVersion(address(s_pool)), 1); vm.startPrank(PROXY_ADMIN); (bool ok, bytes memory result) = address(s_pool).staticcall( abi.encodeWithSelector(TransparentUpgradeableProxy.admin.selector) @@ -209,17 +209,17 @@ contract GhoTokenPoolEthereum_upgradeability is GhoTokenPoolRemoteSetup { TransparentUpgradeableProxy(payable(address(s_pool))).upgradeToAndCall(address(newImpl), mockImpleParams); vm.startPrank(OWNER); - assertEq(s_pool.REVISION(), 2); + assertEq(_getUpgradeableVersion(address(s_pool)), 2); } function testUpgradeAdminReverts() public { vm.expectRevert(); TransparentUpgradeableProxy(payable(address(s_pool))).upgradeToAndCall(address(0), bytes("")); - assertEq(s_pool.REVISION(), 1); + assertEq(_getUpgradeableVersion(address(s_pool)), 1); vm.expectRevert(); TransparentUpgradeableProxy(payable(address(s_pool))).upgradeTo(address(0)); - assertEq(s_pool.REVISION(), 1); + assertEq(_getUpgradeableVersion(address(s_pool)), 1); } function testChangeAdmin() public {