Skip to content

Commit

Permalink
Merge pull request #35 from VenusProtocol/feat/VEN-2681
Browse files Browse the repository at this point in the history
[VEN-2681][VEN-2682]: XVS token and Bridge deployments on zksync sepolia
  • Loading branch information
GitGuru7 authored Aug 6, 2024
2 parents 7465838 + 86b7d13 commit 2cf15d0
Show file tree
Hide file tree
Showing 24 changed files with 11,315 additions and 57 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ DEPLOYER_PRIVATE_KEY=
#ARCHIVE_NODE_opbnbtestnet=https://opbnb-testnet.nodereal.io/v1/<YOUR_KEY_HERE>
#ARCHIVE_NODE_opbnbmainnet=https://opbnb-mainnet.nodereal.io/v1/<YOUR_KEY_HERE>
#ARCHIVE_NODE_arbitrumsepolia="https://sepolia-rollup.arbitrum.io/rpc"
#ARCHIVE_NODE_arbitrumone="https://open-platform.nodereal.io/<YOUR_KEY_HERE>/arbitrum-nitro/"
#ARCHIVE_NODE_arbitrumone="https://open-platform.nodereal.io/<YOUR_KEY_HERE>/arbitrum-nitro/"
#ARCHIVE_NODE_zksyncsepolia=https://zksync-sepolia.g.alchemy.com/v2/<YOUR_KEY_HERE>
3 changes: 2 additions & 1 deletion .eslint-tsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"scenario",
"deploy",
"docgen-templates",
"commitlint.config.js"
"commitlint.config.js",
"hardhat.config.zksync.ts"
]
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
node_modules
artifacts
artifacts-zk
cache
cache-zk
coverage
dist
typechain
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,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; 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 @@ -7,7 +7,9 @@ typechain-types

# Hardhat files
cache
cache-zk
artifacts
artifacts-zk

# yarn
.yarn/*
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
node_modules
artifacts
artifacts-zk
cache
cache-zk
coverage*
gasReporterOutput.json
dist
Expand Down
10 changes: 9 additions & 1 deletion deploy/001-xvs-bridge-local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const resilientOracle = await ethers.getContract("ResilientOracle");
const XVS = await ethers.getContract("XVS");

const defaultProxyAdmin = await hre.artifacts.readArtifact(
"hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol:ProxyAdmin",
);

const XVSProxyOFTSrc = await deploy("XVSProxyOFTSrc", {
from: deployer,
contract: "XVSProxyOFTSrc",
Expand All @@ -88,11 +92,15 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
contract: "XVSBridgeAdmin",
proxy: {
owner: normalTimelock.address,
proxyContract: "OpenZeppelinTransparentProxy",
proxyContract: "OptimizedTransparentUpgradeableProxy",
execute: {
methodName: "initialize",
args: [accessControlManager.address],
},
viaAdminContract: {
name: "DefaultProxyAdmin",
artifact: defaultProxyAdmin,
},
upgradeIndex: 0,
},
log: true,
Expand Down
14 changes: 12 additions & 2 deletions deploy/002-xvs-bridge-remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();
const preconfiguredAddresses = await getPreConfiguredAddresses(hre.network.name);
const defaultProxyAdmin = await hre.artifacts.readArtifact(
"hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol:ProxyAdmin",
);

const proxyOwnerAddress = await toAddress(preconfiguredAddresses.NormalTimelock, hre);
const accessControlManager = await ethers.getContract("AccessControlManager");
Expand All @@ -97,14 +100,16 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
args: [accessControlManager.address],
autoMine: true,
log: true,
skipIfAlreadyDeployed: true,
});

const XVSProxyOFTDest = await deploy("XVSProxyOFTDest", {
from: deployer,
contract: "XVSProxyOFTDest",
args: [XVS.address, 8, preconfiguredAddresses.LzEndpoint, resilientOracle.address],
args: [XVS.address, 8, preconfiguredAddresses.LzEndpoint, resilientOracle],
autoMine: true,
log: true,
skipIfAlreadyDeployed: true,
});

const XVSBridgeAdmin = await deploy("XVSBridgeAdmin", {
Expand All @@ -113,15 +118,20 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
contract: "XVSBridgeAdmin",
proxy: {
owner: proxyOwnerAddress,
proxyContract: "OpenZeppelinTransparentProxy",
proxyContract: "OptimizedTransparentUpgradeableProxy",
execute: {
methodName: "initialize",
args: [accessControlManager.address],
},
viaAdminContract: {
name: "DefaultProxyAdmin",
artifact: defaultProxyAdmin,
},
upgradeIndex: 0,
},
log: true,
autoMine: true,
skipIfAlreadyDeployed: true,
});

const bridge = await ethers.getContract<XVSProxyOFTDest>("XVSProxyOFTDest");
Expand Down
Loading

0 comments on commit 2cf15d0

Please sign in to comment.