Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHO CCIP 1.5.1 Upgrade Eth<>Arb #557

Merged
merged 69 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
24a3f7d
Add proposal for Gho Incident Report 20231113 (#1)
parth-15 Dec 5, 2023
4aa6143
fix: Make new impl constant (#3)
miguelmtzinf Dec 6, 2023
27dd485
fix: Amend AIP text (#4)
miguelmtzinf Dec 6, 2023
2f242a6
test: Tweak default tests with borrow cap update (#5)
miguelmtzinf Dec 7, 2023
4812d01
fix: lint issue (#6)
parth-15 Dec 7, 2023
43a7687
test: Add diffs from test running (#7)
miguelmtzinf Dec 7, 2023
4c79bb9
fix: Add payload address (#8)
miguelmtzinf Dec 7, 2023
76cd4b6
fix: Fix payload address in script (#9)
miguelmtzinf Dec 7, 2023
120f564
fix: Remove unneeded diff file (#10)
miguelmtzinf Dec 7, 2023
4d6a3d9
Merge branch 'bgd-labs:main' into main
miguelmtzinf Dec 13, 2023
4cb8573
Merge branch 'bgd-labs:main' into main
miguelmtzinf Jan 16, 2024
0e39df3
Merge branch 'bgd-labs:main' into main
miguelmtzinf May 28, 2024
11a6d50
Merge branch 'bgd-labs:main' into main
miguelmtzinf Jun 14, 2024
ea78e25
Merge branch 'bgd-labs:main' into main
miguelmtzinf Jun 17, 2024
b6499dc
Merge branch 'bgd-labs:main' into main
miguelmtzinf Jun 26, 2024
e38aca8
Merge branch 'bgd-labs:main' into main
miguelmtzinf Jul 29, 2024
4c4426f
Merge branch 'bgd-labs:main' into main
miguelmtzinf Jul 30, 2024
3b23dc7
Merge branch 'bgd-labs:main' into main
miguelmtzinf Sep 12, 2024
2a0d25c
Merge branch 'bgd-labs:main' into main
miguelmtzinf Oct 21, 2024
82dfded
Merge branch 'bgd-labs:main' into main
miguelmtzinf Nov 4, 2024
c64c0c1
chore: init aip
DhairyaSethi Dec 9, 2024
2ff2f26
feat: ccip 1.5.1 upgrade
DhairyaSethi Dec 11, 2024
b7017e3
tmp: fix ci for aave org, to rm for bdg
DhairyaSethi Dec 11, 2024
ca059fd
tmp: add 1.4 pool with withdrawLiq flattended, to be removed once imp…
DhairyaSethi Dec 11, 2024
4b8049a
tmp: fix ci for aave org
DhairyaSethi Dec 11, 2024
f8180d9
revert: test ci secrets updates
DhairyaSethi Dec 11, 2024
e57070d
chore: fix comments
DhairyaSethi Dec 11, 2024
c0e439b
chore: rm duplicate check
DhairyaSethi Dec 11, 2024
01431e1
chore: reorder imports, pending automation
DhairyaSethi Dec 12, 2024
0ea5517
chore: import order
DhairyaSethi Dec 13, 2024
1a30dda
chore: imports order, re-frame comment
DhairyaSethi Dec 13, 2024
bbc3daa
feat: update to latest spec: naming changes, setCurrentBridgedAmount,…
DhairyaSethi Dec 19, 2024
af3b44d
chore: consistency, cleanup comment based on latest approach
DhairyaSethi Dec 19, 2024
688a922
upd: `directMint` & `directBurn`
DhairyaSethi Dec 23, 2024
478a7b5
feat: add `gho-core` lib temporarily, fix interface
DhairyaSethi Dec 23, 2024
142d68b
feat: new gho ccip steward
DhairyaSethi Dec 23, 2024
acbf6e5
feat: reference existing pool upgrade impl deployment
DhairyaSethi Dec 23, 2024
c95c114
feat: more verbose and efficient
DhairyaSethi Dec 23, 2024
f02b9d1
chore: upd ccip lib
DhairyaSethi Dec 23, 2024
3f5dc31
test: cleanup & fuzzify
DhairyaSethi Dec 24, 2024
bb88ac1
test: cleanup & fuzzify
DhairyaSethi Dec 24, 2024
fe0368a
chore: use latest deployment of existing remote pool upgrade
DhairyaSethi Dec 24, 2024
8c8ce06
doc: snapshot -> direct-to-aip
DhairyaSethi Dec 24, 2024
37d1eb6
chore: import gho from EthereumAssets instead of MiscEthereum
DhairyaSethi Dec 24, 2024
141e49d
chore: cleanup rm ProxyAdmin reference
DhairyaSethi Dec 24, 2024
62b189b
chore: rename facilitator
DhairyaSethi Dec 24, 2024
b8e50a6
chore: rm duplicate check
DhairyaSethi Dec 24, 2024
2ffccd0
Merge branch 'bgd-labs:main' into main
miguelmtzinf Dec 24, 2024
87eaf71
Merge branch 'main' into feat/ccip_1_5_1
DhairyaSethi Dec 24, 2024
7c0b73d
fix: updates based on upstream changes from https://github.com/bgd-la…
DhairyaSethi Dec 25, 2024
bcd843a
chore: fix&add comment, use chain selector from helper lib
DhairyaSethi Dec 25, 2024
459ec75
chore: fix chain selector lib typo
DhairyaSethi Dec 25, 2024
54e6327
feat: accept existing proxy pool ownership as well
DhairyaSethi Dec 30, 2024
ed83e08
feat: add rate limit
DhairyaSethi Dec 30, 2024
bdd0183
feat: add deployed token pools & stewards
DhairyaSethi Jan 2, 2025
07c7715
feat: rm `gho-core` & `ccip`
DhairyaSethi Jan 2, 2025
0947d4e
feat: upd arb token pool & steward deployment
DhairyaSethi Jan 2, 2025
f86c4d4
feat: notify gho bucket steward
DhairyaSethi Jan 2, 2025
6b9ad21
feat: update aave steward
DhairyaSethi Jan 3, 2025
30194d1
chore: use existing IOwnable
DhairyaSethi Jan 3, 2025
e90cf74
chore: new ccip stewards with timelock getter
DhairyaSethi Jan 6, 2025
12ec93d
Merge branch 'main' into feat/ccip_1_5_1
DhairyaSethi Jan 6, 2025
c832f5d
feat: use oz v5.1 proxies
DhairyaSethi Jan 8, 2025
a5047b6
doc: add discussion + spec
DhairyaSethi Jan 9, 2025
1f934fa
feat: chainlink pre-req have been performed
DhairyaSethi Jan 10, 2025
a743f26
Updated GHOCCIP151Upgrade.md
CanonicalJP Jan 13, 2025
62ca346
Updated GHOCCIP151Upgrade.md
CanonicalJP Jan 13, 2025
10edba6
doc: lint and add steward addresses to spec md
DhairyaSethi Jan 13, 2025
c4b59fb
doc: expand on bucket steward update
DhairyaSethi Jan 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Raw diff

```json
{}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Raw diff

```json
{}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {ITransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol';
import {IUpgradeableBurnMintTokenPool_1_4, IUpgradeableBurnMintTokenPool_1_5_1} from 'src/interfaces/ccip/tokenPool/IUpgradeableBurnMintTokenPool.sol';
import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol';
DhairyaSethi marked this conversation as resolved.
Show resolved Hide resolved
import {ITokenAdminRegistry} from 'src/interfaces/ccip/ITokenAdminRegistry.sol';
import {IRateLimiter} from 'src/interfaces/ccip/IRateLimiter.sol';
import {IProxyPool} from 'src/interfaces/ccip/IProxyPool.sol';
import {ILegacyProxyAdmin} from 'src/interfaces/ILegacyProxyAdmin.sol';
import {IGhoToken} from 'src/interfaces/IGhoToken.sol';
import {MiscArbitrum} from 'aave-address-book/MiscArbitrum.sol';
import {GhoArbitrum} from 'aave-address-book/GhoArbitrum.sol';
import {AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol';
import {AaveV3ArbitrumAssets} from 'aave-address-book/AaveV3Arbitrum.sol';

/**
* @title GHO CCIP 1.5.1 Upgrade
* @author Aave Labs
* - Discussion: TODO
*/
contract AaveV3Arbitrum_GHOCCIP151Upgrade_20241209 is IProposalGenericExecutor {
uint64 public constant ETH_CHAIN_SELECTOR = 5009297550715157269;
brotherlymite marked this conversation as resolved.
Show resolved Hide resolved

// https://arbiscan.io/address/0x39AE1032cF4B334a1Ed41cdD0833bdD7c7E7751E
ITokenAdminRegistry public constant TOKEN_ADMIN_REGISTRY =
ITokenAdminRegistry(0x39AE1032cF4B334a1Ed41cdD0833bdD7c7E7751E);

// https://arbiscan.io/address/0x26329558f08cbb40d6a4CCA0E0C67b29D64A8c50
IProxyPool public constant EXISTING_PROXY_POOL =
IProxyPool(0x26329558f08cbb40d6a4CCA0E0C67b29D64A8c50);
// https://arbiscan.io/address/0xF168B83598516A532a85995b52504a2Fa058C068
IUpgradeableBurnMintTokenPool_1_4 public constant EXISTING_TOKEN_POOL =
IUpgradeableBurnMintTokenPool_1_4(GhoArbitrum.GHO_CCIP_TOKEN_POOL); // will be updated in address-book after AIP
// https://arbiscan.io/address/0x6Bb7a212910682DCFdbd5BCBb3e28FB4E8da10Ee
IUpgradeableBurnMintTokenPool_1_5_1 public constant NEW_TOKEN_POOL =
IUpgradeableBurnMintTokenPool_1_5_1(0x6Bb7a212910682DCFdbd5BCBb3e28FB4E8da10Ee);

// https://arbiscan.io/address/0x06179f7C1be40863405f374E7f5F8806c728660A
address public constant NEW_GHO_CCIP_STEWARD = 0x06179f7C1be40863405f374E7f5F8806c728660A;

// https://etherscan.io/address/0x9Ec9F9804733df96D1641666818eFb5198eC50f0
address public constant EXISTING_REMOTE_POOL_ETH = 0x9Ec9F9804733df96D1641666818eFb5198eC50f0; // ProxyPool on ETH
// https://etherscan.io/address/0x20fd5f3FCac8883a3A0A2bBcD658A2d2c6EFa6B6
address public constant NEW_REMOTE_POOL_ETH = 0x20fd5f3FCac8883a3A0A2bBcD658A2d2c6EFa6B6;

// https://arbiscan.io/address/0xA5Ba213867E175A182a5dd6A9193C6158738105A
// https://github.com/aave/ccip/commit/ca73ec8c4f7dc0f6a99ae1ea0acde43776c7b9bb
address public constant EXISTING_TOKEN_POOL_UPGRADE_IMPL =
0xA5Ba213867E175A182a5dd6A9193C6158738105A;

// https://arbiscan.io/address/0x7dfF72693f6A4149b17e7C6314655f6A9F7c8B33
IGhoToken public constant GHO = IGhoToken(AaveV3ArbitrumAssets.GHO_UNDERLYING);

// Token Rate Limit Capacity: 300_000 GHO
uint128 public constant CCIP_RATE_LIMIT_CAPACITY = 300_000e18;
// Token Rate Limit Refill Rate: 60 GHO per second (=> 216_000 GHO per hour)
uint128 public constant CCIP_RATE_LIMIT_REFILL_RATE = 60e18;

function execute() external {
_acceptOwnership();
_migrateLiquidity();
_setupAndRegisterNewPool();
}

// pre-req - chainlink transfers gho token pool ownership on token admin registry
function _acceptOwnership() internal {
EXISTING_PROXY_POOL.acceptOwnership();
NEW_TOKEN_POOL.acceptOwnership();
TOKEN_ADMIN_REGISTRY.acceptAdminRole(AaveV3ArbitrumAssets.GHO_UNDERLYING);
}

function _migrateLiquidity() internal {
// bucketLevel === bridgedAmount
(uint256 bucketCapacity, uint256 bucketLevel) = GHO.getFacilitatorBucket(
address(EXISTING_TOKEN_POOL)
);

GHO.addFacilitator(address(NEW_TOKEN_POOL), 'CCIP TokenPool v1.5.1', uint128(bucketCapacity));
NEW_TOKEN_POOL.directMint(address(EXISTING_TOKEN_POOL), bucketLevel); // increase facilitator level

_upgradeExistingTokenPool(); // introduce `directBurn` method
EXISTING_TOKEN_POOL.directBurn(bucketLevel); // decrease facilitator level

GHO.removeFacilitator(address(EXISTING_TOKEN_POOL));
}

function _setupAndRegisterNewPool() internal {
IRateLimiter.Config memory rateLimiterConfig = IRateLimiter.Config({
isEnabled: true,
capacity: CCIP_RATE_LIMIT_CAPACITY,
rate: CCIP_RATE_LIMIT_REFILL_RATE
});

IUpgradeableBurnMintTokenPool_1_5_1.ChainUpdate[]
memory chains = new IUpgradeableBurnMintTokenPool_1_5_1.ChainUpdate[](1);

bytes[] memory remotePoolAddresses = new bytes[](2);
remotePoolAddresses[0] = abi.encode(EXISTING_REMOTE_POOL_ETH);
remotePoolAddresses[1] = abi.encode(NEW_REMOTE_POOL_ETH);

chains[0] = IUpgradeableBurnMintTokenPool_1_5_1.ChainUpdate({
remoteChainSelector: ETH_CHAIN_SELECTOR,
remotePoolAddresses: remotePoolAddresses,
remoteTokenAddress: abi.encode(AaveV3EthereumAssets.GHO_UNDERLYING),
outboundRateLimiterConfig: rateLimiterConfig,
inboundRateLimiterConfig: rateLimiterConfig
});

// setup new pool
NEW_TOKEN_POOL.applyChainUpdates({
remoteChainSelectorsToRemove: new uint64[](0),
chainsToAdd: chains
});
NEW_TOKEN_POOL.setRateLimitAdmin(NEW_GHO_CCIP_STEWARD);

// register new pool
TOKEN_ADMIN_REGISTRY.setPool(address(GHO), address(NEW_TOKEN_POOL));
}

function _upgradeExistingTokenPool() internal {
ILegacyProxyAdmin(MiscArbitrum.PROXY_ADMIN).upgrade(
ITransparentUpgradeableProxy(payable(address(EXISTING_TOKEN_POOL))),
EXISTING_TOKEN_POOL_UPGRADE_IMPL
);
}
}
Loading