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

fix: update scripts #248

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
pragma solidity ^0.8.0;

import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol';
import {EthereumScript, PolygonScript, AvalancheScript, BNBScript} from 'aave-helpers/ScriptUtils.sol';
import {EthereumScript, PolygonScript, AvalancheScript, BNBScript, BaseScript, GnosisScript, OptimismScript, ArbitrumScript, MetisScript, ScrollScript} from 'aave-helpers/ScriptUtils.sol';
import {AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol';
import {AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol';
import {AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol';
import {AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol';
import {AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.sol';
import {AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.sol';
import {AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.sol';
import {AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.sol';
import {AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.sol';
import {AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.sol';

/**
* @dev Deploy Ethereum
Expand Down Expand Up @@ -96,14 +102,146 @@ contract DeployBNB is BNBScript {
}
}

/**
* @dev Deploy Base
* deploy-command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:DeployBase chain=base
* verify-command: npx catapulta-verify -b broadcast/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol/8453/run-latest.json
*/
contract DeployBase is BaseScript {
function run() external broadcast {
// deploy payloads
address payload0 = GovV3Helpers.deployDeterministic(
type(AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode
);

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

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

/**
* @dev Deploy Gnosis
* deploy-command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:DeployGnosis chain=gnosis
* verify-command: npx catapulta-verify -b broadcast/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol/100/run-latest.json
*/
contract DeployGnosis is GnosisScript {
function run() external broadcast {
// deploy payloads
address payload0 = GovV3Helpers.deployDeterministic(
type(AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode
);

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

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

/**
* @dev Deploy Optimism
* deploy-command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:DeployOptimism chain=optimism
* verify-command: npx catapulta-verify -b broadcast/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol/10/run-latest.json
*/
contract DeployOptimism is OptimismScript {
function run() external broadcast {
// deploy payloads
address payload0 = GovV3Helpers.deployDeterministic(
type(AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode
);

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

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

/**
* @dev Deploy Arbitrum
* deploy-command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:DeployArbitrum chain=arbitrum
* verify-command: npx catapulta-verify -b broadcast/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol/42161/run-latest.json
*/
contract DeployArbitrum is ArbitrumScript {
function run() external broadcast {
// deploy payloads
address payload0 = GovV3Helpers.deployDeterministic(
type(AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode
);

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

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

/**
* @dev Deploy Metis
* deploy-command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:DeployMetis chain=metis
* verify-command: npx catapulta-verify -b broadcast/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol/1088/run-latest.json
*/
contract DeployMetis is MetisScript {
function run() external broadcast {
// deploy payloads
address payload0 = GovV3Helpers.deployDeterministic(
type(AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode
);

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

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

/**
* @dev Deploy Scroll
* deploy-command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:DeployScroll chain=scroll
* verify-command: npx catapulta-verify -b broadcast/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol/534352/run-latest.json
*/
contract DeployScroll is ScrollScript {
function run() external broadcast {
// deploy payloads
address payload0 = GovV3Helpers.deployDeterministic(
type(AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313).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/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:CreateProposal chain=mainnet
*/
contract CreateProposal is EthereumScript {
function run() external {
// create payloads
PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](4);
PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](10);

// compose actions for validation
IPayloadsControllerCore.ExecutionAction[]
Expand Down Expand Up @@ -134,6 +272,48 @@ contract CreateProposal is EthereumScript {
);
payloads[3] = GovV3Helpers.buildBNBPayload(vm, actionsBNB);

IPayloadsControllerCore.ExecutionAction[]
memory actionsBase = new IPayloadsControllerCore.ExecutionAction[](1);
actionsBase[0] = GovV3Helpers.buildAction(
type(AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode
);
payloads[4] = GovV3Helpers.buildBasePayload(vm, actionsBase);

IPayloadsControllerCore.ExecutionAction[]
memory actionsGnosis = new IPayloadsControllerCore.ExecutionAction[](1);
actionsGnosis[0] = GovV3Helpers.buildAction(
type(AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode
);
payloads[5] = GovV3Helpers.buildGnosisPayload(vm, actionsGnosis);

IPayloadsControllerCore.ExecutionAction[]
memory actionsOptimism = new IPayloadsControllerCore.ExecutionAction[](1);
actionsOptimism[0] = GovV3Helpers.buildAction(
type(AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode
);
payloads[6] = GovV3Helpers.buildOptimismPayload(vm, actionsOptimism);

IPayloadsControllerCore.ExecutionAction[]
memory actionsArbitrum = new IPayloadsControllerCore.ExecutionAction[](1);
actionsArbitrum[0] = GovV3Helpers.buildAction(
type(AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode
);
payloads[7] = GovV3Helpers.buildArbitrumPayload(vm, actionsArbitrum);

IPayloadsControllerCore.ExecutionAction[]
memory actionsMetis = new IPayloadsControllerCore.ExecutionAction[](1);
actionsMetis[0] = GovV3Helpers.buildAction(
type(AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode
);
payloads[8] = GovV3Helpers.buildMetisPayload(vm, actionsMetis);

IPayloadsControllerCore.ExecutionAction[]
memory actionsScroll = new IPayloadsControllerCore.ExecutionAction[](1);
actionsScroll[0] = GovV3Helpers.buildAction(
type(AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode
);
payloads[9] = GovV3Helpers.buildScrollPayload(vm, actionsScroll);

// create proposal
vm.startBroadcast();
GovV3Helpers.createProposal(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@ import {ConfigFile} from '../../generator/types';
export const config: ConfigFile = {
rootOptions: {
author: 'BGD Labs @bgdlabs',
pools: ['AaveV3Ethereum', 'AaveV3Polygon', 'AaveV3Avalanche', 'AaveV3BNB'],
pools: [
'AaveV3Ethereum',
'AaveV3Polygon',
'AaveV3Avalanche',
'AaveV3BNB',
'AaveV3Base',
'AaveV3Gnosis',
'AaveV3Optimism',
'AaveV3Arbitrum',
'AaveV3Metis',
'AaveV3Scroll',
],
title: 'Update a.DI implementation and CCIP adapters',
shortName: 'UpdateADIImplementationAndCCIPAdapters',
date: '20240313',
Expand All @@ -14,5 +25,11 @@ export const config: ConfigFile = {
AaveV3Polygon: {configs: {OTHERS: {}}, cache: {blockNumber: 54601669}},
AaveV3Avalanche: {configs: {OTHERS: {}}, cache: {blockNumber: 42840161}},
AaveV3BNB: {configs: {OTHERS: {}}, cache: {blockNumber: 36928161}},
AaveV3Base: {configs: {OTHERS: {}}, cache: {blockNumber: 36928161}},
AaveV3Gnosis: {configs: {OTHERS: {}}, cache: {blockNumber: 36928161}},
AaveV3Optimism: {configs: {OTHERS: {}}, cache: {blockNumber: 36928161}},
AaveV3Arbitrum: {configs: {OTHERS: {}}, cache: {blockNumber: 36928161}},
AaveV3Metis: {configs: {OTHERS: {}}, cache: {blockNumber: 36928161}},
AaveV3Scroll: {configs: {OTHERS: {}}, cache: {blockNumber: 36928161}},
},
};
Loading