generated from bgd-labs/bgd-forge-template
-
Notifications
You must be signed in to change notification settings - Fork 28
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
CheyenneAtapour
wants to merge
71
commits into
bgd-labs:main
Choose a base branch
from
aave:feat/gho-avax
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
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 4aa6143
fix: Make new impl constant (#3)
miguelmtzinf 27dd485
fix: Amend AIP text (#4)
miguelmtzinf 2f242a6
test: Tweak default tests with borrow cap update (#5)
miguelmtzinf 4812d01
fix: lint issue (#6)
parth-15 43a7687
test: Add diffs from test running (#7)
miguelmtzinf 4c79bb9
fix: Add payload address (#8)
miguelmtzinf 76cd4b6
fix: Fix payload address in script (#9)
miguelmtzinf 120f564
fix: Remove unneeded diff file (#10)
miguelmtzinf 4d6a3d9
Merge branch 'bgd-labs:main' into main
miguelmtzinf 4cb8573
Merge branch 'bgd-labs:main' into main
miguelmtzinf 0e39df3
Merge branch 'bgd-labs:main' into main
miguelmtzinf 11a6d50
Merge branch 'bgd-labs:main' into main
miguelmtzinf ea78e25
Merge branch 'bgd-labs:main' into main
miguelmtzinf b6499dc
Merge branch 'bgd-labs:main' into main
miguelmtzinf e38aca8
Merge branch 'bgd-labs:main' into main
miguelmtzinf 4c4426f
Merge branch 'bgd-labs:main' into main
miguelmtzinf 3b23dc7
Merge branch 'bgd-labs:main' into main
miguelmtzinf 2a0d25c
Merge branch 'bgd-labs:main' into main
miguelmtzinf 82dfded
Merge branch 'bgd-labs:main' into main
miguelmtzinf 35bddfa
feat: Initial proposal generation
CheyenneAtapour 4ad619a
chore: Add v1.5 token pool dep
CheyenneAtapour eaddfca
feat: Ethereum proposal
CheyenneAtapour 19ebd60
feat: Arbitrum proposal
CheyenneAtapour 4d3b3a3
feat: Enable Arbitrum lane, add todos
CheyenneAtapour b17cfa4
feat: Accept token administrator role
CheyenneAtapour 6211627
feat: Link token to pool
CheyenneAtapour e8e791b
feat: List gho on avax
CheyenneAtapour be994cc
feat: Generate aip files
CheyenneAtapour 54c4789
chore: Add v1.5 token pool dep
CheyenneAtapour 946660a
merge in ccip-gho-avax
CheyenneAtapour 7e4c7fd
chore: Move existing proposals into new template
CheyenneAtapour c0dfe64
feat: Arbitrum proposal
CheyenneAtapour 5e07b5a
fix: Remove intermediary utils contract
CheyenneAtapour 70bcdee
fix: Assume pool deployed
CheyenneAtapour f2ae525
fix: Add token admin registry addresses
CheyenneAtapour 2075537
test: Fix default proposal test
CheyenneAtapour 848a92c
test: Validate token and pool deployments
CheyenneAtapour d69c59a
test: Basic pool test
CheyenneAtapour 160a17f
test: Add avax <> arb checks
CheyenneAtapour a8f1aeb
test: E2E on avax <> eth
CheyenneAtapour eaaedb5
test: Add arb <> avax e2e test
CheyenneAtapour bf721db
fix: Move gho deployment to proposal
CheyenneAtapour 7c315f9
feat: Fix arb proposal and default test
CheyenneAtapour 6337e6e
test: Validate arb pool avax config
CheyenneAtapour d37b736
test: Mint arb <> eth
CheyenneAtapour 76e3c91
test: Burn arb <> eth
CheyenneAtapour 65ec7dc
test: Arb <> avax mint and burn
CheyenneAtapour 1c0806c
test: E2E eth <> arb
CheyenneAtapour 36c3755
fix: Use 1.5.1 pools
CheyenneAtapour 714147b
updated submodule
CheyenneAtapour 45f97d9
fix: Compilation with 1.5.1 deps
CheyenneAtapour bcdd6c2
fix: Avax proposal tests
CheyenneAtapour e1d40c6
fix: Arb apply chain updates on token pool and proxy
CheyenneAtapour 5d68817
chore: Reorg code
CheyenneAtapour 4398967
fix: Rename token pool interfaces
CheyenneAtapour 9eab216
test: Ethereum default proposal test
CheyenneAtapour 06b4473
test: Eth basic lock release
CheyenneAtapour aee6a88
wip: Eth proposal e2e test
CheyenneAtapour a1dbbae
fix: Eth <> arb e2e test
CheyenneAtapour ec78836
wip: Eth <> avax e2e test
CheyenneAtapour 66ebf7c
fix: Avax <> eth e2e test
CheyenneAtapour e6717c8
chore: Cleanup arbitrum proposal
CheyenneAtapour b025a25
chore: Cleanup avax proposal comments, correct price feed
CheyenneAtapour 9ff0b8e
chore: Cleanup eth proposal
CheyenneAtapour 7f3d66d
fix: Update ccip submodule
CheyenneAtapour 1dfcac0
fix: Move gho deployment back into proposal
CheyenneAtapour b57b3d4
fix: Remove gho deployment from tests
CheyenneAtapour f3b9712
fix: Token pool names
CheyenneAtapour 9968529
feat: Deploy gho deterministically
CheyenneAtapour cf5f2b0
Merge branch 'bgd-labs:main' into feat/gho-avax
miguelmtzinf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
15 changes: 15 additions & 0 deletions
15
...um_GHOAvaxLaunch_20241106_before_AaveV3Arbitrum_GHOAvaxLaunch_20241106_after.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
{} | ||
``` |
15 changes: 15 additions & 0 deletions
15
...e_GHOAvaxLaunch_20241106_before_AaveV3Avalanche_GHOAvaxLaunch_20241106_after.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
{} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
src/20241106_Multi_GHOAvaxLaunch/AaveV3Arbitrum_GHOAvaxLaunch_20241106.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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