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 #19

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
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
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
f44270b
Remove USDS from sUSDe emode in Aave Prime instance - Review (#553)
marczeller Dec 31, 2024
d7674fd
fix(cache): automated cache update [skip ci]
Dec 31, 2024
d312140
chore(deps): bump lib/aave-helpers from `1821d62` to `7cdcda6` (#556)
dependabot[bot] Jan 2, 2025
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
0ddae1e
Aavechan/gnosis opti (#555)
Rozengarden Jan 3, 2025
d766be0
fix(cache): automated cache update [skip ci]
Jan 3, 2025
308146d
Gho minter (#554)
efecarranza Jan 6, 2025
393fc57
fix(cache): automated cache update [skip ci]
Jan 6, 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
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
7 changes: 7 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[submodule "lib/aave-helpers"]
path = lib/aave-helpers
url = https://github.com/bgd-labs/aave-helpers
[submodule "lib/ccip"]
path = lib/ccip
url = https://github.com/aave/ccip
branch = feat/1_5_1_token_pool
[submodule "lib/gho-core"]
path = lib/gho-core
url = https://github.com/aave/gho-core
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
{}
```
1 change: 1 addition & 0 deletions lib/ccip
Submodule ccip added at ca12f6
1 change: 1 addition & 0 deletions lib/gho-core
Submodule gho-core added at 0a6fbd
11 changes: 10 additions & 1 deletion remappings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@ aave-address-book/=lib/aave-helpers/lib/aave-address-book/src/
aave-helpers/=lib/aave-helpers/
aave-v3-origin/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/
forge-std/=lib/aave-helpers/lib/forge-std/src/
solidity-utils/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/src
solidity-utils/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/src/
DhairyaSethi marked this conversation as resolved.
Show resolved Hide resolved
@openzeppelin/contracts-upgradeable/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/contracts/
@openzeppelin/contracts/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/
aave-v3-origin-tests/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/tests/
ds-test/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/forge-std/lib/ds-test/src/
erc4626-tests/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/
openzeppelin-contracts-upgradeable/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/
openzeppelin-contracts/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/
aave-ccip/=lib/ccip/contracts/src/v0.8/ccip
gho-core/=lib/gho-core/src/contracts
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
// 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';
DhairyaSethi marked this conversation as resolved.
Show resolved Hide resolved
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;

// 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 =
miguelmtzinf marked this conversation as resolved.
Show resolved Hide resolved
IUpgradeableBurnMintTokenPool_1_4(GhoArbitrum.GHO_CCIP_TOKEN_POOL); // will be updated in address-book after AIP
IUpgradeableBurnMintTokenPool_1_5_1 public immutable NEW_TOKEN_POOL;

address public immutable NEW_GHO_CCIP_STEWARD;

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

// https://arbiscan.io/address/0xA5Ba213867E175A182a5dd6A9193C6158738105A
address public constant EXISTING_TOKEN_POOL_UPGRADE_IMPL =
DhairyaSethi marked this conversation as resolved.
Show resolved Hide resolved
0xA5Ba213867E175A182a5dd6A9193C6158738105A; // https://github.com/aave/ccip/commit/ca73ec8c4f7dc0f6a99ae1ea0acde43776c7b9bb

// 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;

constructor(address newTokenPoolArb, address newTokenPoolEth, address newGhoCcipSteward) {
NEW_TOKEN_POOL = IUpgradeableBurnMintTokenPool_1_5_1(newTokenPoolArb);
NEW_REMOTE_POOL_ETH = newTokenPoolEth;
NEW_GHO_CCIP_STEWARD = newGhoCcipSteward;
}

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
miguelmtzinf marked this conversation as resolved.
Show resolved Hide resolved
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);
miguelmtzinf marked this conversation as resolved.
Show resolved Hide resolved

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
Loading