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

Launch GHO on Avalanche #519

Draft
wants to merge 71 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
71 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
35bddfa
feat: Initial proposal generation
CheyenneAtapour Nov 5, 2024
4ad619a
chore: Add v1.5 token pool dep
CheyenneAtapour Nov 5, 2024
eaddfca
feat: Ethereum proposal
CheyenneAtapour Nov 5, 2024
19ebd60
feat: Arbitrum proposal
CheyenneAtapour Nov 5, 2024
4d3b3a3
feat: Enable Arbitrum lane, add todos
CheyenneAtapour Nov 7, 2024
b17cfa4
feat: Accept token administrator role
CheyenneAtapour Nov 7, 2024
6211627
feat: Link token to pool
CheyenneAtapour Nov 7, 2024
e8e791b
feat: List gho on avax
CheyenneAtapour Nov 7, 2024
be994cc
feat: Generate aip files
CheyenneAtapour Nov 7, 2024
54c4789
chore: Add v1.5 token pool dep
CheyenneAtapour Nov 7, 2024
946660a
merge in ccip-gho-avax
CheyenneAtapour Nov 7, 2024
7e4c7fd
chore: Move existing proposals into new template
CheyenneAtapour Nov 7, 2024
c0dfe64
feat: Arbitrum proposal
CheyenneAtapour Nov 7, 2024
5e07b5a
fix: Remove intermediary utils contract
CheyenneAtapour Nov 8, 2024
70bcdee
fix: Assume pool deployed
CheyenneAtapour Nov 8, 2024
f2ae525
fix: Add token admin registry addresses
CheyenneAtapour Nov 25, 2024
2075537
test: Fix default proposal test
CheyenneAtapour Nov 26, 2024
848a92c
test: Validate token and pool deployments
CheyenneAtapour Nov 26, 2024
d69c59a
test: Basic pool test
CheyenneAtapour Nov 26, 2024
160a17f
test: Add avax <> arb checks
CheyenneAtapour Nov 27, 2024
a8f1aeb
test: E2E on avax <> eth
CheyenneAtapour Nov 29, 2024
eaaedb5
test: Add arb <> avax e2e test
CheyenneAtapour Nov 29, 2024
bf721db
fix: Move gho deployment to proposal
CheyenneAtapour Nov 29, 2024
7c315f9
feat: Fix arb proposal and default test
CheyenneAtapour Dec 1, 2024
6337e6e
test: Validate arb pool avax config
CheyenneAtapour Dec 1, 2024
d37b736
test: Mint arb <> eth
CheyenneAtapour Dec 2, 2024
76e3c91
test: Burn arb <> eth
CheyenneAtapour Dec 2, 2024
65ec7dc
test: Arb <> avax mint and burn
CheyenneAtapour Dec 2, 2024
1c0806c
test: E2E eth <> arb
CheyenneAtapour Dec 2, 2024
36c3755
fix: Use 1.5.1 pools
CheyenneAtapour Dec 18, 2024
714147b
updated submodule
CheyenneAtapour Dec 18, 2024
45f97d9
fix: Compilation with 1.5.1 deps
CheyenneAtapour Dec 18, 2024
bcdd6c2
fix: Avax proposal tests
CheyenneAtapour Dec 18, 2024
e1d40c6
fix: Arb apply chain updates on token pool and proxy
CheyenneAtapour Dec 18, 2024
5d68817
chore: Reorg code
CheyenneAtapour Dec 18, 2024
4398967
fix: Rename token pool interfaces
CheyenneAtapour Dec 18, 2024
9eab216
test: Ethereum default proposal test
CheyenneAtapour Dec 18, 2024
06b4473
test: Eth basic lock release
CheyenneAtapour Dec 19, 2024
aee6a88
wip: Eth proposal e2e test
CheyenneAtapour Dec 19, 2024
a1dbbae
fix: Eth <> arb e2e test
CheyenneAtapour Dec 19, 2024
ec78836
wip: Eth <> avax e2e test
CheyenneAtapour Dec 19, 2024
66ebf7c
fix: Avax <> eth e2e test
CheyenneAtapour Dec 19, 2024
e6717c8
chore: Cleanup arbitrum proposal
CheyenneAtapour Dec 19, 2024
b025a25
chore: Cleanup avax proposal comments, correct price feed
CheyenneAtapour Dec 19, 2024
9ff0b8e
chore: Cleanup eth proposal
CheyenneAtapour Dec 19, 2024
7f3d66d
fix: Update ccip submodule
CheyenneAtapour Dec 19, 2024
1dfcac0
fix: Move gho deployment back into proposal
CheyenneAtapour Dec 19, 2024
b57b3d4
fix: Remove gho deployment from tests
CheyenneAtapour Dec 19, 2024
f3b9712
fix: Token pool names
CheyenneAtapour Dec 19, 2024
9968529
feat: Deploy gho deterministically
CheyenneAtapour Dec 20, 2024
cf5f2b0
Merge branch 'bgd-labs:main' into feat/gho-avax
miguelmtzinf Dec 24, 2024
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not add new dependencies, let's work with interfaces as much as we can

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely. I just added a PR comment so this doesn't get lost or "outdated" tag. I first will determine what is needed for testing, then will use mocks/interfaces instead of deps

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.git
branch = feat/1_5_1_token_pool
[submodule "lib/gho-core"]
path = lib/gho-core
url = https://github.com/aave/gho-core.git
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Emodes changed

### EMode: Stablecoins(id: 1)



### EMode: ETH correlated(id: 2)



## Raw diff

```json
{}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Emodes changed

### EMode: Stablecoins(id: 1)



### EMode: AVAX correlated(id: 2)



## Raw diff

```json
{}
```
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
src = 'src'
test = 'tests'
script = 'scripts'
solc = '0.8.20'
solc = '0.8.24'
out = 'out'
bytecode_hash = 'none'
libs = ['lib']
Expand Down
1 change: 1 addition & 0 deletions lib/ccip
Submodule ccip added at 8fea66
1 change: 1 addition & 0 deletions lib/gho-core
Submodule gho-core added at 0a6fbd
2 changes: 2 additions & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ 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
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,100 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {RateLimiter} from 'ccip/libraries/RateLimiter.sol';
import {TokenAdminRegistry} from 'ccip/tokenAdminRegistry/TokenAdminRegistry.sol';
import {UpgradeableBurnMintTokenPool} from 'ccip/pools/GHO/UpgradeableBurnMintTokenPool.sol';
import {UpgradeableTokenPool} from 'ccip/pools/GHO/UpgradeableTokenPool.sol';
import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol';
import {AaveV3ArbitrumAssets} from 'aave-address-book/AaveV3Arbitrum.sol';
import {GovernanceV3Arbitrum} from 'aave-address-book/GovernanceV3Arbitrum.sol';
import {MiscArbitrum} from 'aave-address-book/MiscArbitrum.sol';
import {IGhoToken} from 'gho-core/gho/interfaces/IGhoToken.sol';
import {IUpgradeablePool} from 'src/interfaces/ccip/IUpgradeablePool.sol';
CheyenneAtapour marked this conversation as resolved.
Show resolved Hide resolved

/**
* @title GHOAvaxLaunch
* @author Aave Labs
* - Snapshot: https://snapshot.org/#/aave.eth/proposal/0x2aed7eb8b03cb3f961cbf790bf2e2e1e449f841a4ad8bdbcdd223bb6ac69e719
* - Discussion: https://governance.aave.com/t/arfc-launch-gho-on-avalanche-set-aci-as-emissions-manager-for-rewards/19339
* @dev This payload consists of the following set of actions:
* 1. Accept ownership of CCIP TokenPool
* 2. Configure CCIP TokenPool for Ethereum
* 3. Configure CCIP TokenPool for Avalanche
* 4. Add CCIP TokenPool as GHO Facilitator (allowing burn and mint)
* 5. Accept administrator role from Chainlink token admin registry
* 6. Link token to pool on Chainlink token admin registry
*/
contract AaveV3Arbitrum_GHOAvaxLaunch_20241106 is IProposalGenericExecutor {
address public constant CCIP_RMN_PROXY = 0xC311a21e6fEf769344EB1515588B9d535662a145;
address public constant CCIP_ROUTER = 0x141fa059441E0ca23ce184B6A78bafD2A517DdE8;
address public constant CCIP_TOKEN_ADMIN_REGISTRY = 0x39AE1032cF4B334a1Ed41cdD0833bdD7c7E7751E;
// TODO: Update pool address if we deploy new one
address public constant CCIP_TOKEN_POOL = MiscArbitrum.GHO_CCIP_TOKEN_POOL;
address public constant AVAX_TOKEN_POOL = 0x5991A2dF15A8F6A256D3Ec51E99254Cd3fb576A9;
address public constant AVAX_GHO = 0x2e234DAe75C793f67A35089C9d99245E1C58470b;
uint256 public constant CCIP_BUCKET_CAPACITY = 1_000_000e18; // 1M
uint64 public constant CCIP_ETH_CHAIN_SELECTOR = 5009297550715157269;
uint64 public constant CCIP_AVAX_CHAIN_SELECTOR = 6433500567565415381;

function execute() external {
// TODO: Following code applies to case we deploy new pools
/*
// 1. Accept TokenPool ownership
UpgradeableBurnMintTokenPool(CCIP_TOKEN_POOL).acceptOwnership();

// 2. Configure CCIP TokenPool for Ethereum
// TODO: Set remote pool and token addresses after deployment?
_configureCcipTokenPool(CCIP_TOKEN_POOL, CCIP_ETH_CHAIN_SELECTOR, address(0), address(0));
CheyenneAtapour marked this conversation as resolved.
Show resolved Hide resolved
*/

// TODO: Update addresses if we deploy new pools
// 3. Configure CCIP TokenPool for Avalanche
_configureCcipTokenPool(CCIP_TOKEN_POOL, CCIP_AVAX_CHAIN_SELECTOR);

// TODO: Following code applies to case we deploy new pools
/*
// 4. Add CCIP TokenPool as GHO Facilitator
IGhoToken(AaveV3ArbitrumAssets.GHO_UNDERLYING).grantRole(
IGhoToken(AaveV3ArbitrumAssets.GHO_UNDERLYING).FACILITATOR_MANAGER_ROLE(),
GovernanceV3Arbitrum.EXECUTOR_LVL_1
);
IGhoToken(AaveV3ArbitrumAssets.GHO_UNDERLYING).grantRole(
IGhoToken(AaveV3ArbitrumAssets.GHO_UNDERLYING).BUCKET_MANAGER_ROLE(),
GovernanceV3Arbitrum.EXECUTOR_LVL_1
);
IGhoToken(AaveV3ArbitrumAssets.GHO_UNDERLYING).addFacilitator(
CCIP_TOKEN_POOL,
'CCIP TokenPool',
uint128(CCIP_BUCKET_CAPACITY)
);

// 5. Accept administrator role from Chainlink token manager
TokenAdminRegistry(CCIP_TOKEN_ADMIN_REGISTRY).acceptAdminRole(
AaveV3ArbitrumAssets.GHO_UNDERLYING
);

// 6. Link token to pool on Chainlink token admin registry
TokenAdminRegistry(CCIP_TOKEN_ADMIN_REGISTRY).setPool(
AaveV3ArbitrumAssets.GHO_UNDERLYING,
CCIP_TOKEN_POOL
);
*/
}

function _configureCcipTokenPool(address tokenPool, uint64 chainSelector) internal {
IUpgradeablePool.ChainUpdate[] memory chainUpdates = new IUpgradeablePool.ChainUpdate[](1);
RateLimiter.Config memory rateConfig = RateLimiter.Config({
isEnabled: false,
capacity: 0,
rate: 0
});
chainUpdates[0] = IUpgradeablePool.ChainUpdate({
remoteChainSelector: chainSelector,
allowed: true,
outboundRateLimiterConfig: rateConfig,
inboundRateLimiterConfig: rateConfig
});
IUpgradeablePool(tokenPool).applyChainUpdates(chainUpdates);
}
}
Loading