Skip to content

Commit

Permalink
GHO CCIP 1.5 Maintenance Upgrade (bgd-labs#512)
Browse files Browse the repository at this point in the history
* Add proposal for Gho Incident Report 20231113 (#1)

* chore: add payload and deploy script for update of GHO variable debt token

* forge install: gho-core

* chore: add gho-core to dependency

* test: Add tests for update of gho variable token

* test: Add tests for update of gho variable token

* fix: add modifier in method of interface

* fix: remove gho dependency from repo and fix test

* fix: Remove unnecesary dependency

* fix: Add latest details

---------

Co-authored-by: miguelmtzinf <[email protected]>

* fix: Make new impl constant (#3)

* fix: Amend AIP text (#4)

* fix: Make new impl constant

* fix: Fix AIP text

* test: Tweak default tests with borrow cap update (#5)

* fix: lint issue (#6)

* test: Add diffs from test running (#7)

* fix: Add payload address (#8)

* fix: Fix payload address in script (#9)

* fix: Remove unneeded diff file (#10)

* feat: install aave-ccip at latest commit on aave/ccip#18

* chore: upd remappings, lib/aave-helpers, .assets

* new: add proposal for eth & arb

* fix: arb test supply locked invariant

* fix: rename, add discussion link

* upd: aave-ccip module

* feat: add proxy pool deployments

* feat: add e2e tests

* chore: fix license, explicit senders for expectEmit

* ci: override rpc url in secrets

* test: proxy pool can off ramp

* chore: reorder deps

* nit: utilize existing ierc20 import, style guide, use arb assets for gho addy

* feat: add rate limit, use gho fascilitator for tests

* feat: set in bound rate limit as well

* chore: cleanup

* test: check proxy initialized version

* chore: inBetween => inFlight"

* chore: test name consistency

* test: dynamically fetch dest gas amt

* test: execMsg post migration using legacy off ramp

* test: ccip steward can disable rate limit

* chore: cleanup

* doc: add comment for fetching all offramps, use RISK_COUNCIL for clarity

* test: ownership transfer after migration

* chore: rm _readRiskAdmin, fix config

* fix: ci test setup to stay compatible with bdg upstream

* feat: rm aave-ccip dep

* rft: use deployed token pools

* tmp: fix ci for aave org, to rm for bdg

* fix: ci to bdg setup

* fix: update rate limit

* test: fuzz amounts

* chore: snapshot docs

* chore: const cap rate

* chore: fix type

* fix: Fix rate limit config constants

* fix: tests, impl correct solc

* fix: tests

* Update src/20241021_Multi_GHOCCIP150Upgrade/AaveV3Ethereum_GHOCCIP150Upgrade_20241021.sol

Co-authored-by: Harsh Pandey <[email protected]>

* Update src/20241021_Multi_GHOCCIP150Upgrade/AaveV3Arbitrum_GHOCCIP150Upgrade_20241021.sol

Co-authored-by: Harsh Pandey <[email protected]>

* doc: reference token pool contracts

* doc: upgrade spec

* doc: formatting

* Update src/20241021_Multi_GHOCCIP150Upgrade/GHOCCIP150Upgrade.md

Co-authored-by: miguelmtz <[email protected]>

* Update src/20241021_Multi_GHOCCIP150Upgrade/GHOCCIP150Upgrade.md

Co-authored-by: miguelmtz <[email protected]>

* test: Refresh block number with ghostewards aip executed

* fix: Remove unneeded script

---------

Co-authored-by: Parth Patel <[email protected]>
Co-authored-by: DhairyaSethi <[email protected]>
Co-authored-by: Harsh Pandey <[email protected]>
  • Loading branch information
4 people authored Nov 7, 2024
1 parent 90866bf commit c016f11
Show file tree
Hide file tree
Showing 52 changed files with 2,703 additions and 42 deletions.
1 change: 1 addition & 0 deletions .assets/02a040db3fc4a88618783a9156e7fb51928e1ede.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/03dc42930b2b94af37ef869d012c4734aedb52e6.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/0afe490affc1bc77fe6675127b18e9aeeb4b1404.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/0fcfb1e84443509c42e21db9e4320c00e1db6098.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/1899e5ae4f4fd5b0d2565edd912a160acb2d0b78.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/18e6ba583d4d35e38cb678120492b2b4d52d19ea.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/1aa0fb636d34a35d35ce67919bc0d7d2e36d3839.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/1c1fbd79406b4b3a8c64ec79ef429f7c422d0387.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/2e9d5ba5e949c7896bc79e7fdd98872cb43375b0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/39a3707c0ded91bbfde8953567853db55452a227.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/39d5ff798c0771402486c6f1ca63f2a1868d80d9.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/4820a9e881eaa3f3def4916e47e0c330b34ab151.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/5dbd5b9335471c83b44949206c9b2186657b836f.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/5f455cedf818a43aba043e71714721fd1e844501.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/7bc797fb2b1f421fa40a6d9a0028d1f78db71dc0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/7ee454df22dbd82f0c1929bc14104d54c7081a49.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/8aa25c38caec024924773d1a5c7c63ab45c4eecf.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/8fc705464b3515a654de9893168a1b1321feccb4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/9c784d12784a084406c3794fbe177e93da4c3479.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/a4faa118ed690be4e95fae01b8535036cda67e3d.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/a9a0275265838d424840d721917e0a4e3a5d8044.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/ac33ca939f6fc30c2fd799aaa6f59b0521c19e9f.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/c229e34ea67f12eea11bf5403763207eeab38cff.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/c277de9f9a155f6a0e47e0443845a3c9de5f6b84.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/ceb223a18f5aad36d9f6087d1d468b4dd5ba56a1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/d8d51b9f960b17304a3bdcaf8922d3ae84b3c30f.svg

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .assets/dcedb30554ccb68f317b952113777790df5ca547.svg

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .assets/e6c7eef36a7e70a1f1b35633097516fe5e21508b.svg

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .assets/ec2b4dc8236ac87f8058f121d86de1d99e029c5c.svg

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .assets/fb6ebf3fa05cf980f374598b56757dbc5cae3662.svg

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .assets/fe79e1c7a3e943262824d4f683059c85d91a233d.svg

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Emodes changes

## Raw diff

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

## Raw diff

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

import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol';
import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol';
import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol';
import {MiscArbitrum} from 'aave-address-book/MiscArbitrum.sol';
import {IUpgradeableBurnMintTokenPool} from 'src/interfaces/ccip/IUpgradeableBurnMintTokenPool.sol';
import {IRateLimiter} from 'src/interfaces/ccip/IRateLimiter.sol';

/**
* @title GHO CCIP 1.50 Upgrade
* @author Aave Labs
* - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/51
*/
contract AaveV3Arbitrum_GHOCCIP150Upgrade_20241021 is IProposalGenericExecutor {
uint64 public constant ETH_CHAIN_SELECTOR = 5009297550715157269;

// https://arbiscan.io/address/0xfc421aD3C883Bf9E7C4f42dE845C4e4405799e73
address public constant TOKEN_POOL_IMPL = 0xfc421aD3C883Bf9E7C4f42dE845C4e4405799e73;
// https://arbiscan.io/address/0x26329558f08cbb40d6a4CCA0E0C67b29D64A8c50
address public constant GHO_CCIP_PROXY_POOL = 0x26329558f08cbb40d6a4CCA0E0C67b29D64A8c50;

/// @dev Token Rate Limit Capacity: 300_000 GHO
uint128 public constant CCIP_RATE_LIMIT_CAPACITY = 300_000e18;

/// @dev 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 {
IUpgradeableBurnMintTokenPool tokenPoolProxy = IUpgradeableBurnMintTokenPool(
MiscArbitrum.GHO_CCIP_TOKEN_POOL
);

ProxyAdmin(MiscArbitrum.PROXY_ADMIN).upgrade(
TransparentUpgradeableProxy(payable(address(tokenPoolProxy))),
TOKEN_POOL_IMPL
);

// Update proxyPool address
tokenPoolProxy.setProxyPool(GHO_CCIP_PROXY_POOL);

// Set rate limit
IRateLimiter.Config memory rateLimitConfig = IRateLimiter.Config({
isEnabled: true,
capacity: CCIP_RATE_LIMIT_CAPACITY,
rate: CCIP_RATE_LIMIT_REFILL_RATE
});
tokenPoolProxy.setChainRateLimiterConfig(ETH_CHAIN_SELECTOR, rateLimitConfig, rateLimitConfig);
}
}
Loading

0 comments on commit c016f11

Please sign in to comment.