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

feat: linea activation #573

Merged
merged 15 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
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

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ evm_version = 'shanghai'
[profile.bnb]
evm_version = 'shanghai'

[profile.linea]
evm_version = 'london'

[rpc_endpoints]
mainnet = "${RPC_MAINNET}"
optimism = "${RPC_OPTIMISM}"
Expand All @@ -77,6 +80,7 @@ gnosis = "${RPC_GNOSIS}"
bnb = "${RPC_BNB}"
scroll = "${RPC_SCROLL}"
zksync = "${RPC_ZKSYNC}"
linea = "${RPC_LINEA}"

[etherscan]
mainnet = { key = "${ETHERSCAN_API_KEY_MAINNET}", chain = 1 }
Expand All @@ -92,5 +96,6 @@ gnosis = { key = "${ETHERSCAN_API_KEY_GNOSIS}", chainId = 100 }
bnb = { key = "${ETHERSCAN_API_KEY_BNB}", chainId = 56, url = 'https://api.bscscan.com/api' }
scroll = { key = "${ETHERSCAN_API_KEY_SCROLL}", chainId = 534352 }
zksync = { key = "${ETHERSCAN_API_KEY_ZKSYNC}", chain = 324 }
linea = { key="${ETHERSCAN_API_KEY_LINEA}", chain = 59144 }

# See more config options https://github.com/gakonst/foundry/tree/master/config
5 changes: 4 additions & 1 deletion generator/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import {
gnosis,
scroll,
zkSync,
linea,
} from 'viem/chains';
import {Client, Hex, getAddress} from 'viem';
import {Hex, getAddress} from 'viem';
import {CHAIN_ID_CLIENT_MAP} from '@bgd-labs/js-utils';

export const AVAILABLE_CHAINS = [
Expand All @@ -30,6 +31,7 @@ export const AVAILABLE_CHAINS = [
'Gnosis',
'Scroll',
'ZkSync',
'Linea',
] as const;

export function getAssets(pool: PoolIdentifier): string[] {
Expand Down Expand Up @@ -134,6 +136,7 @@ export const CHAIN_TO_CHAIN_ID = {
Gnosis: gnosis.id,
Scroll: scroll.id,
ZkSync: zkSync.id,
Linea: linea.id,
};

export function flagAsRequired(message: string, required?: boolean) {
Expand Down
1 change: 1 addition & 0 deletions generator/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const V3_POOLS = [
'AaveV3Scroll',
'AaveV3BNB',
'AaveV3ZkSync',
'AaveV3Linea',
] as const satisfies readonly (keyof typeof addressBook)[];

export const POOLS = [
Expand Down
29 changes: 23 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"vitest": "^2.1.5"
},
"dependencies": {
"@bgd-labs/aave-address-book": "4.6.0",
"@bgd-labs/aave-address-book": "4.8.0",
"@bgd-labs/aave-cli": "^1.1.12",
"@bgd-labs/js-utils": "^1.4.6",
"@bgd-labs/js-utils": "^1.4.7-26df3486a64891c314113e00d6444724493df97e.0",
"@inquirer/prompts": "^7.1.0",
"@inquirer/testing": "^2.1.37",
"catapulta-verify": "^1.2.1",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/src/GovV3Helpers.sol';
import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol';
import {EthereumScript, LineaScript} from 'solidity-utils/contracts/utils/ScriptUtils.sol';
import {AaveV3Linea_AaveV3LineaActivation_20250121} from './AaveV3Linea_AaveV3LineaActivation_20250121.sol';

/**
* @dev Deploy Linea
* deploy-command: make deploy-ledger contract=src/20250121_AaveV3Linea_AaveV3LineaActivation/AaveV3LineaActivation_20250121.s.sol:DeployLinea chain=linea
* verify-command: FOUNDRY_PROFILE=linea npx catapulta-verify -b broadcast/AaveV3LineaActivation_20250121.s.sol/59144/run-latest.json
*/
contract DeployLinea is LineaScript {
function run() external broadcast {
// deploy payloads
address payload0 = GovV3Helpers.deployDeterministic(
type(AaveV3Linea_AaveV3LineaActivation_20250121).creationCode
);

// compose action
IPayloadsControllerCore.ExecutionAction[]
memory actions = new IPayloadsControllerCore.ExecutionAction[](1);
actions[0] = GovV3Helpers.buildAction(payload0);

// register action at payloadsController
GovV3Helpers.createPayload(actions);
}
}

/**
* @dev Create Proposal
* command: make deploy-ledger contract=src/20250121_AaveV3Linea_AaveV3LineaActivation/AaveV3LineaActivation_20250121.s.sol:CreateProposal chain=mainnet
*/
contract CreateProposal is EthereumScript {
function run() external {
// create payloads
PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](1);

// compose actions for validation
IPayloadsControllerCore.ExecutionAction[]
memory actionsLinea = new IPayloadsControllerCore.ExecutionAction[](1);
actionsLinea[0] = GovV3Helpers.buildAction(
type(AaveV3Linea_AaveV3LineaActivation_20250121).creationCode
);
payloads[0] = GovV3Helpers.buildLineaPayload(vm, actionsLinea);

// create proposal
vm.startBroadcast();
GovV3Helpers.createProposal(
vm,
payloads,
GovernanceV3Ethereum.VOTING_PORTAL_ETH_POL,
GovV3Helpers.ipfsHashFile(
vm,
'src/20250121_AaveV3Linea_AaveV3LineaActivation/AaveV3LineaActivation.md'
)
);
}
}
Loading
Loading