Skip to content

Commit

Permalink
Merge pull request #136 from VenusProtocol/feat/berachain-deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
web3rover authored Mar 4, 2025
2 parents 0937286 + 18b9bca commit 96ee957
Show file tree
Hide file tree
Showing 21 changed files with 5,717 additions and 79 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ DEPLOYER_PRIVATE_KEY=
#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 @@ -137,7 +137,7 @@ jobs:

- name: Export deployments
run: |
for NETWORK in bsctestnet bscmainnet ethereum sepolia opbnbmainnet opbnbtestnet arbitrumsepolia arbitrumone opsepolia opmainnet basesepolia basemainnet unichainsepolia unichainmainnet; do
for NETWORK in bsctestnet bscmainnet ethereum sepolia opbnbmainnet opbnbtestnet 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/000-psr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { ethers } from "hardhat";
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import { ADDRESS_ONE, multisigs } from "../helpers/utils";
import { ADDRESS_ONE } from "../helpers/utils";

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const {
network: { live, name },
network: { live },
getNamedAccounts,
deployments,
} = hre;
Expand All @@ -24,8 +24,8 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
}

const WBNBAddress = (await ethers.getContractOrNull("WBNB"))?.address || ADDRESS_ONE;
const timelockAddress = (await ethers.getContract("NormalTimelock"))?.address || multisigs[name];
const acmAddress = (await ethers.getContract("AccessControlManager"))?.address;
const timelockAddress = (await ethers.getContract("NormalTimelock")).address;
const acmAddress = (await ethers.getContract("AccessControlManager")).address;
const loopsLimit = 20;

const defaultProxyAdmin = await hre.artifacts.readArtifact(
Expand Down
6 changes: 2 additions & 4 deletions deploy/001-risk-fund-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { ethers } from "hardhat";
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import { multisigs } from "../helpers/utils";

const func: DeployFunction = async ({
network: { name, live },
network: { live },
getNamedAccounts,
deployments,
}: HardhatRuntimeEnvironment) => {
Expand Down Expand Up @@ -33,7 +31,7 @@ const func: DeployFunction = async ({
});

if (live) {
const targetOwner = (await ethers.getContractOrNull("NormalTimelock"))?.address || multisigs[name];
const targetOwner = (await ethers.getContract("NormalTimelock")).address;

const contract = await ethers.getContract("RiskFundV2");
if ((await contract.owner()) !== targetOwner && (await contract.pendingOwner()) !== targetOwner) {
Expand Down
6 changes: 3 additions & 3 deletions deploy/002-risk-fund-converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ethers } from "hardhat";
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import { ADDRESS_ONE, multisigs } from "../helpers/utils";
import { ADDRESS_ONE } from "../helpers/utils";

const MIN_AMOUNT_TO_CONVERT = parseUnits("10", 18);

Expand All @@ -12,7 +12,7 @@ const getTokenOrMockName = (name: string, live: boolean) => {
};

const func: DeployFunction = async ({
network: { live, name },
network: { live },
getNamedAccounts,
deployments,
}: HardhatRuntimeEnvironment) => {
Expand All @@ -31,7 +31,7 @@ const func: DeployFunction = async ({
const riskFundAddress = (await ethers.getContract("RiskFundV2"))?.address;
const poolRegistryAddress = (await ethers.getContract("PoolRegistry"))?.address;
let comptrollers;
const timelockAddress = (await ethers.getContract("NormalTimelock"))?.address || multisigs[name];
const timelockAddress = (await ethers.getContract("NormalTimelock")).address;
if (live) {
const poolDeFiAddress = (await ethers.getContract("Comptroller_DeFi"))?.address;
const poolGameFiAddress = (await ethers.getContract("Comptroller_GameFi"))?.address;
Expand Down
6 changes: 2 additions & 4 deletions deploy/003-xvs-vault-treasury.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { ethers } from "hardhat";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import { multisigs } from "../helpers/utils";

const func = async ({ network: { live, name }, getNamedAccounts, deployments }: HardhatRuntimeEnvironment) => {
const func = async ({ network: { live }, getNamedAccounts, deployments }: HardhatRuntimeEnvironment) => {
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();

const xvsAddress = (await ethers.getContract("XVS"))?.address;
const proxyOwnerAddress = (await ethers.getContractOrNull("NormalTimelock"))?.address || multisigs[name];
const proxyOwnerAddress = (await ethers.getContract("NormalTimelock")).address;
const acmAddress = (await ethers.getContract("AccessControlManager"))?.address;
const xvsVaultAddress = (await ethers.getContract("XVSVaultProxy"))?.address;

Expand Down
4 changes: 1 addition & 3 deletions deploy/004-single-token-converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { DeployResult } from "hardhat-deploy/dist/types";
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import { multisigs } from "../helpers/utils";

type NETWORK = "hardhat" | "bsctestnet" | "bscmainnet" | "sepolia" | "ethereum";

interface BaseAssets {
Expand Down Expand Up @@ -81,7 +79,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

const acmAddress = (await ethers.getContract("AccessControlManager"))?.address;
const oracleAddress = (await ethers.getContract("ResilientOracle"))?.address;
const proxyOwnerAddress = (await ethers.getContract("NormalTimelock"))?.address || multisigs[networkName];
const proxyOwnerAddress = (await ethers.getContract("NormalTimelock")).address;

const singleTokenConverterImp: DeployResult = await deploy("SingleTokenConverterImp", {
contract: "SingleTokenConverter",
Expand Down
6 changes: 2 additions & 4 deletions deploy/005-converter-network.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { ethers } from "hardhat";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import { multisigs } from "../helpers/utils";

const MAX_LOOPS_LIMIT = 20;

const func = async ({ network: { live, name }, getNamedAccounts, deployments }: HardhatRuntimeEnvironment) => {
const func = async ({ network: { live }, getNamedAccounts, deployments }: HardhatRuntimeEnvironment) => {
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();

const timelockAddress = (await ethers.getContractOrNull("NormalTimelock"))?.address || multisigs[name];
const timelockAddress = (await ethers.getContract("NormalTimelock")).address;
const acmAddress = (await ethers.getContract("AccessControlManager"))?.address;

await deploy("ConverterNetwork", {
Expand Down
Loading

0 comments on commit 96ee957

Please sign in to comment.