Skip to content

Commit

Permalink
Merge pull request #88 from VenusProtocol/develop
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
chechu authored Sep 10, 2024
2 parents 5e3b44c + 7458b7a commit 44326f6
Show file tree
Hide file tree
Showing 38 changed files with 3,955 additions and 86 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ ARCHIVE_NODE_ethereum=https://eth-mainnet.nodereal.io/v1/<YOUR_KEY_HERE>
#ARCHIVE_NODE_opbnbmainnet=https://opbnb-mainnet.nodereal.io/v1/<YOUR_KEY_HERE>
#ARCHIVE_NODE_arbitrumone="https://open-platform.nodereal.io/<YOUR_KEY_HERE>/arbitrum-nitro/"
#ARCHIVE_NODE_arbitrumsepolia="https://sepolia-rollup.arbitrum.io/rpc"
#ARCHIVE_NODE_zksyncsepolia=https://zksync-sepolia.g.alchemy.com/v2/<YOUR_KEY_HERE>
#ARCHIVE_NODE_zksyncmainnet=https://open-platform.nodereal.io/<YOUR_KEY_HERE>/zksync

ETHERSCAN_API_KEY=
REPORT_GAS=
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
**/.coverage_cache
**/.coverage_contracts
**/artifacts
**/artifacts-zk
**/build
**/cache
**/cache-zk
**/coverage
**/dist
**/node_modules
Expand Down
3 changes: 2 additions & 1 deletion .eslinttsconfigrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"jest.config.js",
"saddle.config.js",
"docgen-templates",
"commitlint.config.js"
"commitlint.config.js",
"./hardhat.config.zksync.ts"
]
}
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@ jobs:
- name: Lint solidity and ts files
run: yarn lint

check-deployment:
name: Check hardhat deployments work on hardhat
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 18
cache: "yarn"

- name: Install dependencies
run: yarn

- name: Check hardhat deploy
run: yarn hardhat deploy

test:
runs-on: "ubuntu-latest"
steps:
Expand Down Expand Up @@ -105,6 +125,10 @@ jobs:
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
for NETWORK in zksyncsepolia zksyncmainnet; do
EXPORT=true yarn hardhat export --network ${NETWORK} --export ./deployments/${NETWORK}.json --config hardhat.config.zksync.ts
jq -M '{name, chainId, addresses: .contracts | map_values(.address)}' ./deployments/${NETWORK}.json > ./deployments/${NETWORK}_addresses.json
done
yarn prettier
- uses: stefanzweifel/git-auto-commit-action@v5
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
!.yarn/sdks
!.yarn/versions
**/artifacts
**/artifacts-zk
**/build
**/cache
**/cache-zk
**/coverage
**/.coverage_artifacts
**/.coverage_cache
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
**/.coverage_cache
**/.coverage_contracts
**/artifacts
**/artifacts-zk
**/build
**/cache
**/cache-zk
**/coverage
**/dist
**/node_modules
Expand Down
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
## [2.3.0-dev.5](https://github.com/VenusProtocol/governance-contracts/compare/v2.3.0-dev.4...v2.3.0-dev.5) (2024-08-28)


### Features

* add ACM deployments on Zksync ([86c5b65](https://github.com/VenusProtocol/governance-contracts/commit/86c5b650ced89ebe7e914f12c40378ccb19d550a))
* updating deployment files ([0169d08](https://github.com/VenusProtocol/governance-contracts/commit/0169d08e0a3bef449e00b1d3edc1c39fd6835013))


### Bug Fixes

* url ([3725109](https://github.com/VenusProtocol/governance-contracts/commit/3725109397c90bad956ff9b80dc3ad45cb28a222))

## [2.3.0-dev.4](https://github.com/VenusProtocol/governance-contracts/compare/v2.3.0-dev.3...v2.3.0-dev.4) (2024-08-08)


### Bug Fixes

* update execute signature used in assigning access controls ([16875e6](https://github.com/VenusProtocol/governance-contracts/commit/16875e61647a0ed6765632c4181e1dce2bedf99c))

## [2.3.0-dev.3](https://github.com/VenusProtocol/governance-contracts/compare/v2.3.0-dev.2...v2.3.0-dev.3) (2024-08-08)

## [2.3.0-dev.2](https://github.com/VenusProtocol/governance-contracts/compare/v2.3.0-dev.1...v2.3.0-dev.2) (2024-08-02)


### Bug Fixes

* add id to configuration script to avoid duplicate execution ([5001d32](https://github.com/VenusProtocol/governance-contracts/commit/5001d3202b7845d4910255dbcf204aed99a2e920))

## [2.3.0-dev.1](https://github.com/VenusProtocol/governance-contracts/compare/v2.2.0...v2.3.0-dev.1) (2024-08-01)


### Features

* add config for zksync ([9cb4c7c](https://github.com/VenusProtocol/governance-contracts/commit/9cb4c7cfdadd26bc6360a442c085b41391af3b21))
* add configurations and deploy ACM on zksync sepolia ([7926c59](https://github.com/VenusProtocol/governance-contracts/commit/7926c59905fb6045caecf49bbe452feec484a3f4))
* updating deployment files ([0549339](https://github.com/VenusProtocol/governance-contracts/commit/05493390059b7352a0b734c892436c767965206d))

## [2.2.0](https://github.com/VenusProtocol/governance-contracts/compare/v2.1.0...v2.2.0) (2024-07-18)


Expand Down
2 changes: 1 addition & 1 deletion contracts/test/TestTimelockV8.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ contract TestTimelockV8 is TimelockV8 {
constructor(address admin_, uint256 delay_) public TimelockV8(admin_, delay_) {}

function GRACE_PERIOD() public view override returns (uint256) {
return 1;
return 1 hours;
}

function MINIMUM_DELAY() public view override returns (uint256) {
Expand Down
22 changes: 22 additions & 0 deletions deploy/000-lz-mocks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import { onlyHardhat } from "../helpers/deploy/deploymentUtils";

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployments, getNamedAccounts } = hre;
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();
await deploy("LZEndpointMock", {
from: deployer,
args: [10102],
log: true,
autoMine: true,
});
};

func.tags = ["mocks"];

func.skip = onlyHardhat();

export default func;
7 changes: 5 additions & 2 deletions deploy/003-omnichain-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import { ethers } from "hardhat";
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import { LZ_ENDPOINTS, SUPPORTED_NETWORKS } from "../helpers/deploy/constants";
import { SUPPORTED_NETWORKS } from "../helpers/deploy/constants";
import {
OmnichainProposalSenderCriticalMethods,
OmnichainProposalSenderFasttrackMethods,
OmnichainProposalSenderGuardianMethods,
OmnichainProposalSenderNormalMethods,
config,
} from "../helpers/deploy/deploymentConfig";
import { getLzEndpoint } from "../helpers/deploy/deploymentUtils";
import { getArgTypesFromSignature } from "../helpers/utils";

const BNB_MAINNET_GUARDIAN = "0x1C2CAc6ec528c20800B2fe734820D87b581eAA6B";
Expand Down Expand Up @@ -76,7 +77,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

const OmnichainProposalSender = await deploy("OmnichainProposalSender", {
from: deployer,
args: [LZ_ENDPOINTS[hre.network.name as keyof typeof LZ_ENDPOINTS], acmAddress],
args: [await getLzEndpoint(hre.network.name as SUPPORTED_NETWORKS), acmAddress],
log: true,
autoMine: true,
});
Expand Down Expand Up @@ -131,4 +132,6 @@ func.tags = ["OmnichainProposalSender"];

func.skip = async (hre: HardhatRuntimeEnvironment) =>
!(hre.network.name === "bsctestnet" || hre.network.name === "bscmainnet") && hre.network.name !== "hardhat";

func.dependencies = ["mocks"];
export default func;
7 changes: 4 additions & 3 deletions deploy/004-omnichain-executor-remote.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import { LZ_ENDPOINTS, SUPPORTED_NETWORKS } from "../helpers/deploy/constants";
import { getSourceChainId, guardian } from "../helpers/deploy/deploymentUtils";
import { SUPPORTED_NETWORKS } from "../helpers/deploy/constants";
import { getLzEndpoint, getSourceChainId, guardian } from "../helpers/deploy/deploymentUtils";

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployments, getNamedAccounts } = hre;
Expand All @@ -13,7 +13,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

await deploy("OmnichainGovernanceExecutor", {
from: deployer,
args: [LZ_ENDPOINTS[networkName], await guardian(networkName), await getSourceChainId(networkName)],
args: [await getLzEndpoint(networkName), await guardian(networkName), await getSourceChainId(networkName)],
log: true,
autoMine: true,
});
Expand All @@ -22,4 +22,5 @@ func.tags = ["OmnichainGovernanceExecutor", "Remote"];

func.skip = async (hre: HardhatRuntimeEnvironment) =>
hre.network.name === "bsctestnet" || hre.network.name === "bscmainnet";
func.dependencies = ["mocks"];
export default func;
6 changes: 3 additions & 3 deletions deploy/005-remote-timelock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,23 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

const omnichainGovernanceExecutorAddress = (await ethers.getContract("OmnichainGovernanceExecutor")).address;

await deploy("NormalTimelock", {
await deploy(live ? "NormalTimelock" : "NormalTimelockRemote", {
contract: live ? "TimelockV8" : "TestTimelockV8",
from: deployer,
args: [omnichainGovernanceExecutorAddress, delayConfig[networkName].normal],
log: true,
autoMine: true,
});

await deploy("FastTrackTimelock", {
await deploy(live ? "FastTrackTimelock" : "FastTrackTimelockRemote", {
contract: live ? "TimelockV8" : "TestTimelockV8",
from: deployer,
args: [omnichainGovernanceExecutorAddress, delayConfig[networkName].fast],
log: true,
autoMine: true,
});

await deploy("CriticalTimelock", {
await deploy(live ? "CriticalTimelock" : "CriticalTimelockRemote", {
contract: live ? "TimelockV8" : "TestTimelockV8",
from: deployer,
args: [omnichainGovernanceExecutorAddress, delayConfig[networkName].critical],
Expand Down
1 change: 1 addition & 0 deletions deploy/006-omnichain-executorOwner-remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
);
};
func.tags = ["OmnichainExecutorOwner", "Remote"];
func.id = "configure_remote_executor";

func.skip = async (hre: HardhatRuntimeEnvironment) =>
hre.network.name === "bsctestnet" || hre.network.name === "bscmainnet";
Expand Down
3 changes: 3 additions & 0 deletions deployments/arbitrumone/.migrations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"configure_remote_executor": true
}
3 changes: 3 additions & 0 deletions deployments/arbitrumsepolia/.migrations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"configure_remote_executor": true
}
3 changes: 3 additions & 0 deletions deployments/ethereum/.migrations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"configure_remote_executor": true
}
3 changes: 3 additions & 0 deletions deployments/opbnbmainnet/.migrations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"configure_remote_executor": true
}
3 changes: 3 additions & 0 deletions deployments/opbnbtestnet/.migrations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"configure_remote_executor": true
}
3 changes: 3 additions & 0 deletions deployments/sepolia/.migrations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"configure_remote_executor": true
}
Loading

0 comments on commit 44326f6

Please sign in to comment.