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

[VEN-3099][VEN-3108]: Berachain Deployment #132

Merged
merged 10 commits into from
Mar 4, 2025
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
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ARCHIVE_NODE_ethereum=https://eth-mainnet.nodereal.io/v1/<YOUR_KEY_HERE>
#ARCHIVE_NODE_basemainnet=https://open-platform.nodereal.io/<YOUR_KEY_HERE>/base
#ARCHIVE_NODE_unichainsepolia=https://unichain-sepolia.g.alchemy.com/v2/<YOUR_KEY_HERE>
#ARCHIVE_NODE_unichainmainnet=https://unichain-mainnet.g.alchemy.com/v2/<YOUR_KEY_HERE>
#ARCHIVE_NODE_berachainbartio=https://berachain-bartio.g.alchemy.com/v2/<YOUR_KEY_HERE>

ETHERSCAN_API_KEY=
REPORT_GAS=
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:

- name: Export deployments
run: |
for NETWORK in bsctestnet bscmainnet ethereum sepolia opbnbtestnet opbnbmainnet arbitrumsepolia arbitrumone opsepolia opmainnet basesepolia basemainnet unichainsepolia unichainmainnet; do
for NETWORK in bsctestnet bscmainnet ethereum sepolia opbnbtestnet opbnbmainnet arbitrumsepolia arbitrumone opsepolia opmainnet basesepolia basemainnet unichainsepolia unichainmainnet berachainbartio; do
EXPORT=true yarn hardhat export --network ${NETWORK} --export ./deployments/${NETWORK}.json
jq -M '{name, chainId, addresses: .contracts | map_values(.address)}' ./deployments/${NETWORK}.json > ./deployments/${NETWORK}_addresses.json
done
Expand Down
8 changes: 4 additions & 4 deletions deploy/002-access-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import { SUPPORTED_NETWORKS } from "../helpers/deploy/constants";
import { getAcmAdminAccount } from "../helpers/deploy/deploymentUtils";

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployments, getNamedAccounts } = hre;
Expand All @@ -15,14 +14,15 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
args: [],
log: true,
autoMine: true,
skipIfAlreadyDeployed: true,
});

const acm = await ethers.getContractAt("AccessControlManager", acmDeployment.address);
if (hre.network.live) {
const networkName = hre.network.name as SUPPORTED_NETWORKS;
const adminAccount = await getAcmAdminAccount(networkName);
console.log(`Granting DEFAULT_ADMIN_ROLE to ${adminAccount} for ${networkName} network`);
await acm.grantRole(acm.DEFAULT_ADMIN_ROLE(), adminAccount);
const normalTimelock = await ethers.getContract("NormalTimelock");
console.log(`Granting DEFAULT_ADMIN_ROLE to ${normalTimelock.address} for ${networkName} network`);
await acm.grantRole(acm.DEFAULT_ADMIN_ROLE(), normalTimelock.address);

console.log(`Renouncing DEFAULT_ADMIN_ROLE from deployer (${deployer}) for ${hre.network.name} network`);
await acm.renounceRole(acm.DEFAULT_ADMIN_ROLE(), deployer);
Expand Down
6 changes: 6 additions & 0 deletions deploy/005-remote-timelock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export enum REMOTE_NETWORKS {
BASEMAINNET = "basemainnet",
UNICHAINSEPOLIA = "unichainsepolia",
UNICHAINMAINNET = "unichainmainnet",
BERACHAINBARTIO = "berachainbartio",
HARDHAT = "hardhat",
}
type DelayTypes = {
Expand Down Expand Up @@ -104,6 +105,11 @@ export const delayConfig: DelayConfig = {
fast: 21600,
critical: 3600,
},
berachainbartio: {
normal: 600,
fast: 300,
critical: 100,
},
};

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
Expand Down
5 changes: 4 additions & 1 deletion deploy/006-omnichain-executorOwner-remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
contract: string;
signature: string;
argTypes: string[];
parameters: any[];

Check warning on line 22 in deploy/006-omnichain-executorOwner-remote.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
value: BigNumberish;
}

Expand Down Expand Up @@ -102,13 +102,15 @@
"hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol:ProxyAdmin",
);

const normalTimelock = await ethers.getContract("NormalTimelock");

const omnichainGovernanceExecutorAddress = (await ethers.getContract("OmnichainGovernanceExecutor")).address;
const OmnichainExecutorOwner = await deploy("OmnichainExecutorOwner", {
from: deployer,
args: [omnichainGovernanceExecutorAddress],
contract: "OmnichainExecutorOwner",
proxy: {
owner: hre.network.live ? Guardian : deployer, // Guardian will be replaced by normalTimelock once ownership of DefaultProxyAdmin is transferred to normalTimelock.
owner: hre.network.live ? normalTimelock.address : deployer,
proxyContract: "OptimizedTransparentUpgradeableProxy",
execute: {
methodName: "initialize",
Expand All @@ -122,6 +124,7 @@
},
log: true,
autoMine: true,
skipIfAlreadyDeployed: true,
});
const omnichainExecutorOwner = await ethers.getContractAt(
"OmnichainExecutorOwner",
Expand Down
Loading
Loading