Skip to content

Commit

Permalink
Merge pull request #117 from VenusProtocol/develop
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
chechu authored Dec 18, 2024
2 parents 84e2bb9 + 7e94e5b commit c8520e0
Show file tree
Hide file tree
Showing 63 changed files with 35,010 additions and 1,981 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ DEPLOYER_PRIVATE_KEY=
#ARCHIVE_NODE_zksyncmainnet=https://open-platform.nodereal.io/<YOUR_KEY_HERE>/zksync
#ARCHIVE_NODE_opsepolia=https://sepolia.optimism.io
#ARCHIVE_NODE_opmainnet=https://opt-mainnet.nodereal.io/v1/<YOUR_KEY_HERE>
#ARCHIVE_NODE_basesepolia=https://base-sepolia.blastapi.io/<YOUR_KEY_HERE>
#ARCHIVE_NODE_basemainnet=https://open-platform.nodereal.io/<YOUR_KEY_HERE>/base

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; do
for NETWORK in bsctestnet bscmainnet ethereum sepolia opbnbmainnet opbnbtestnet arbitrumsepolia arbitrumone opsepolia opmainnet basesepolia basemainnet; 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
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
## [3.0.0-dev.4](https://github.com/VenusProtocol/protocol-reserve/compare/v3.0.0-dev.3...v3.0.0-dev.4) (2024-12-18)


### Features

* deployed on base mainnet ([c7f7b64](https://github.com/VenusProtocol/protocol-reserve/commit/c7f7b649ca9e31f253150bc1bdd9d35451e7da20))
* updating deployment files ([be43ca8](https://github.com/VenusProtocol/protocol-reserve/commit/be43ca82330299c8e413991ea96c2c66abbac3d8))

## [3.0.0-dev.3](https://github.com/VenusProtocol/protocol-reserve/compare/v3.0.0-dev.2...v3.0.0-dev.3) (2024-12-03)


### Features

* updating deployment files ([53b1670](https://github.com/VenusProtocol/protocol-reserve/commit/53b1670a3d4c4fa4c1116c7e80aa4b7bf0eb5a12))


### Bug Fixes

* added config ([1ce0e03](https://github.com/VenusProtocol/protocol-reserve/commit/1ce0e0348b46faa7cce571d6e62ad128a6aaf2d0))
* deployed contracts ([f16af29](https://github.com/VenusProtocol/protocol-reserve/commit/f16af2929254311f00c06adb80c7d39cda48fe0b))

## [3.0.0-dev.2](https://github.com/VenusProtocol/protocol-reserve/compare/v3.0.0-dev.1...v3.0.0-dev.2) (2024-11-27)


### Features

* converter network deployment files on arbitrum one ([c6c2f50](https://github.com/VenusProtocol/protocol-reserve/commit/c6c2f501d6711bd176c97c713d41fe20d2eefa92))
* converters deployment files on arbitrum one ([e0397f0](https://github.com/VenusProtocol/protocol-reserve/commit/e0397f005b0f68afbe91b58518a34f06177f6fa9))
* updating deployment files ([f0d55ad](https://github.com/VenusProtocol/protocol-reserve/commit/f0d55ad2ec076ebe45f2fe79c7ddeeb7784b5381))
* xvs vault treasury on arbitrum one ([88c440a](https://github.com/VenusProtocol/protocol-reserve/commit/88c440ab84be079a7465f0a4cf16950e56f3073c))

## [3.0.0-dev.1](https://github.com/VenusProtocol/protocol-reserve/compare/v2.5.0-dev.1...v3.0.0-dev.1) (2024-11-22)


### ⚠ BREAKING CHANGES

* support project and full protocol hardhat deploy

### Code Refactoring

* support project and full protocol hardhat deploy ([1986c6a](https://github.com/VenusProtocol/protocol-reserve/commit/1986c6aabfb5b6e7483df9f8fce73957b49fc27d))

## [2.5.0-dev.1](https://github.com/VenusProtocol/protocol-reserve/compare/v2.4.0...v2.5.0-dev.1) (2024-11-18)


### Features

* deployment files for the converter network on arbitrum sepolia ([ebaab0c](https://github.com/VenusProtocol/protocol-reserve/commit/ebaab0cba32baa04da18304861dc5c967341878d))
* deployment files for the converters on the arbitrum sepolia ([3e3c04b](https://github.com/VenusProtocol/protocol-reserve/commit/3e3c04ba91946b66c75bb8915294d844997bd98a))
* deployment files for the xvsvault treasury on arbitrum sepolia ([8ea6e4b](https://github.com/VenusProtocol/protocol-reserve/commit/8ea6e4bf5022f18ba0cd86a6320b52a76c6432a6))
* updating deployment files ([2107500](https://github.com/VenusProtocol/protocol-reserve/commit/21075008d181a7d1d3934fd9f4d123a99067658c))
* updating deployment files ([9054a09](https://github.com/VenusProtocol/protocol-reserve/commit/9054a09a9111b9b32b1f78849743fc762b70cac0))

## [2.4.0](https://github.com/VenusProtocol/protocol-reserve/compare/v2.3.0...v2.4.0) (2024-10-10)


Expand Down
33 changes: 17 additions & 16 deletions deploy/001-psr.ts → deploy/000-psr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const func: DeployFunction = async ({
const { deployer } = await getNamedAccounts();

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

const defaultProxyAdmin = await hre.artifacts.readArtifact(
Expand All @@ -28,19 +28,20 @@ const func: DeployFunction = async ({
log: true,
deterministicDeployment: false,
args: [comptrollerAddress, WBNBAddress, vBNBAddress],
skipIfAlreadyDeployed: true,
proxy: {
owner: live ? timelockAddress : deployer,
proxyContract: "OptimizedTransparentUpgradeableProxy",
execute: {
methodName: "initialize",
args: [acmAddress, loopsLimit],
},
viaAdminContract: {
name: "DefaultProxyAdmin",
artifact: defaultProxyAdmin,
},
},
proxy: live
? {
owner: timelockAddress,
proxyContract: "OpenZeppelinTransparentProxy",
execute: {
methodName: "initialize",
args: [acmAddress, loopsLimit],
},
viaAdminContract: {
name: "DefaultProxyAdmin",
artifact: defaultProxyAdmin,
},
}
: undefined,
});

const psr = await hre.ethers.getContract("ProtocolShareReserve");
Expand Down
17 changes: 11 additions & 6 deletions deploy/006-risk-fund-v2.ts → deploy/001-risk-fund-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,21 @@ const func: DeployFunction = async ({
const { deployer } = await getNamedAccounts();

const proxyAdmin = await ethers.getContract("DefaultProxyAdmin");
const owner = await proxyAdmin.owner();
let owner = deployer;
if (live) {
owner = await proxyAdmin.owner();
}

await deploy("RiskFundV2", {
from: deployer,
contract: "RiskFundV2",
proxy: {
owner: owner,
proxyContract: "OpenZeppelinTransparentProxy",
upgradeIndex: 0,
},
proxy: live
? {
owner: owner,
proxyContract: "OpenZeppelinTransparentProxy",
upgradeIndex: 0,
}
: undefined,
autoMine: true,
log: true,
});
Expand Down
78 changes: 41 additions & 37 deletions deploy/002-risk-fund-converter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { parseUnits } from "ethers/lib/utils";
import { ethers, network } from "hardhat";
import { ethers } from "hardhat";
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

Expand All @@ -15,54 +15,58 @@ const func: DeployFunction = async ({
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();

const acmAddress = (await ethers.getContractOrNull("AccessControlManager"))?.address || ADDRESS_ONE;
const oracleAddress = (await ethers.getContractOrNull("ResilientOracle"))?.address || ADDRESS_ONE;
const usdtAddress = (await ethers.getContractOrNull("USDT"))?.address || ADDRESS_ONE;
const corePoolAddress = (await ethers.getContractOrNull("Unitroller"))?.address || ADDRESS_ONE;
const btcbAddress = (await ethers.getContractOrNull("BTCB"))?.address || ADDRESS_ONE;
const ethAddress = (await ethers.getContractOrNull("ETH"))?.address || ADDRESS_ONE;
const acmAddress = (await ethers.getContract("AccessControlManager"))?.address;
const oracleAddress = (await ethers.getContract("ResilientOracle"))?.address;
const usdtAddress = (await ethers.getContract("USDT"))?.address;
const corePoolAddress = (await ethers.getContract("Unitroller"))?.address;
const btcbAddress = (await ethers.getContract("BTCB"))?.address;

const ethAddress = (await ethers.getContract("ETH"))?.address;
const vBNBAddress = (await ethers.getContractOrNull("vBNB"))?.address || ADDRESS_ONE;
const wBNBAddress = (await ethers.getContractOrNull("WBNB"))?.address || ADDRESS_ONE;
const riskFundAddress = (await ethers.getContractOrNull("RiskFund"))?.address || ADDRESS_ONE;
const poolRegistryAddress = (await ethers.getContractOrNull("PoolRegistry"))?.address || ADDRESS_ONE;
const poolDeFiAddress = (await ethers.getContractOrNull("Comptroller_DeFi"))?.address || ADDRESS_ONE;
const poolGameFiAddress = (await ethers.getContractOrNull("Comptroller_GameFi"))?.address || ADDRESS_ONE;
const poolTronAddress = (await ethers.getContractOrNull("Comptroller_Tron"))?.address || ADDRESS_ONE;
const timelockAddress = (await ethers.getContractOrNull("NormalTimelock"))?.address || multisigs[name];

let poolStableCoinAddress;
if (network.name === "bscmainnet") {
poolStableCoinAddress = (await ethers.getContractOrNull("Comptroller_Stablecoins"))?.address || ADDRESS_ONE;
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];
if (live) {
const poolDeFiAddress = (await ethers.getContract("Comptroller_DeFi"))?.address;
const poolGameFiAddress = (await ethers.getContract("Comptroller_GameFi"))?.address;
const poolTronAddress = (await ethers.getContract("Comptroller_Tron"))?.address;
const poolStableCoinAddress = (await ethers.getContract("Comptroller_Stablecoins"))?.address;
comptrollers = [corePoolAddress, poolStableCoinAddress, poolDeFiAddress, poolGameFiAddress, poolTronAddress];
} else {
poolStableCoinAddress = (await ethers.getContractOrNull("Comptroller_StableCoins"))?.address || ADDRESS_ONE;
const pool1Address = (await ethers.getContractOrNull("Comptroller_Pool1"))?.address || ADDRESS_ONE;
const pool2Address = (await ethers.getContractOrNull("Comptroller_Pool2"))?.address || ADDRESS_ONE;
comptrollers = [pool1Address, pool2Address];
}

const comptrollers = [corePoolAddress, poolStableCoinAddress, poolDeFiAddress, poolGameFiAddress, poolTronAddress];
const assets = [[usdtAddress, btcbAddress, ethAddress], [usdtAddress], [usdtAddress], [usdtAddress], [usdtAddress]];
const values = [[true, true, true], [true], [true], [true], [true]];

await deploy("RiskFundConverter", {
from: deployer,
contract: "RiskFundConverter",
args: [corePoolAddress, vBNBAddress, wBNBAddress],
proxy: {
owner: live ? timelockAddress : deployer,
proxyContract: "OpenZeppelinTransparentProxy",
execute: {
methodName: "initialize",
args: [
acmAddress,
oracleAddress,
riskFundAddress,
poolRegistryAddress,
MIN_AMOUNT_TO_CONVERT,
comptrollers,
assets,
values,
],
},
upgradeIndex: 0,
},
proxy: live
? {
owner: timelockAddress,
proxyContract: "OpenZeppelinTransparentProxy",
execute: {
methodName: "initialize",
args: [
acmAddress,
oracleAddress,
riskFundAddress,
poolRegistryAddress,
MIN_AMOUNT_TO_CONVERT,
comptrollers,
assets,
values,
],
},
upgradeIndex: 0,
}
: undefined,
autoMine: true,
log: true,
});
Expand Down
29 changes: 15 additions & 14 deletions deploy/003-xvs-vault-treasury.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
import { ethers } from "hardhat";
import { HardhatRuntimeEnvironment } from "hardhat/types";

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

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

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

await deploy("XVSVaultTreasury", {
from: deployer,
log: true,
deterministicDeployment: false,
args: [xvsAddress],
proxy: {
owner: live ? proxyOwnerAddress : deployer,
proxyContract: "OpenZeppelinTransparentProxy",
execute: {
methodName: "initialize",
args: [acmAddress, xvsVaultAddress],
},
},
proxy: live
? {
owner: proxyOwnerAddress,
proxyContract: "OpenZeppelinTransparentProxy",
execute: {
methodName: "initialize",
args: [acmAddress, xvsVaultAddress],
},
}
: undefined,
});

const xvsVaultTreasury = await ethers.getContract("XVSVaultTreasury");
Expand Down
Loading

0 comments on commit c8520e0

Please sign in to comment.