Skip to content

Commit

Permalink
Merge pull request #500 from VenusProtocol/feat/zksync-vtreasury
Browse files Browse the repository at this point in the history
[VEN-2671]: VTreasuryV8 deployment on zksyncsepolia
  • Loading branch information
GitGuru7 authored Jul 31, 2024
2 parents 5ac3308 + a4061b3 commit d166f4a
Show file tree
Hide file tree
Showing 14 changed files with 2,352 additions and 37 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ DEPLOYER_PRIVATE_KEY=
#ARCHIVE_NODE_arbitrumsepolia=https://sepolia-rollup.arbitrum.io/rpc
#ARCHIVE_NODE_xlayertestnet=https://rpc.ankr.com/xlayer_testnet/<YOUR_KEY_HERE>
#ARCHIVE_NODE_xlayermainnet=https://rpc.ankr.com/xlayer<YOUR_KEY_HERE>
# ARCHIVE_NODE_zksyncsepolia=https://zksync-sepolia.g.alchemy.com/v2/<YOUR_KEY_HERE>


ETHERSCAN_API_KEY=
Expand Down
2 changes: 1 addition & 1 deletion .eslinttsconfigrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "./tsconfig.json",
"include": ["./typechain", "./deploy", "./tests", "./script", "./scenario", "saddle.config.js", "docgen-templates", "commitlint.config.js"]
"include": ["./typechain", "./deploy", "./tests", "./script", "./scenario", "saddle.config.js", "docgen-templates", "commitlint.config.js", "./hardhat.config.zksync.ts"]
}
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,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 @@ -43,7 +43,9 @@ junit.xml
# hardhat
typechain
artifacts
artifacts-zk
cache
cache-zk

# OZ
.openzeppelin/
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
3 changes: 3 additions & 0 deletions deploy/005-deploy-VTreasuryV8.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,21 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
arbitrumsepolia: "0x1426A5Ae009c4443188DA8793751024E358A61C2", // ARBITRUM_SEPOLIA MULTISIG
arbitrumone: "0x14e0E151b33f9802b3e75b621c1457afc44DcAA0", // ARBITRUM_ONE MULTISIG
xlayertestnet: "0x5961449d63149035aCfC0714D5155f24C9819004", // XLAYER TESTNET MULTISIG
zksyncsepolia: "0xa2f83de95E9F28eD443132C331B6a9C9B7a9F866", // ZKSYNC SEPOLIA MULTISIG
bscmainnet: await getTimelock(),
bsctestnet: await getTimelock(),
hardhat: deployer,
};

const deployerSigner = await hre.ethers.getSigner(deployer);

const treasuryInstance = await deploy("VTreasuryV8", {
contract: "VTreasuryV8",
from: deployer,
args: [],
log: true,
autoMine: true,
skipIfAlreadyDeployed: true,
});

const adminAccount: string = acmAdminAccount[hre.network.name];
Expand Down
200 changes: 200 additions & 0 deletions deployments/zksyncsepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
{
"name": "zksyncsepolia",
"chainId": "300",
"contracts": {
"VTreasuryV8": {
"address": "0x943eBE4460a12F551D60A68f510Ea10CD8d564BA",
"abi": [
{
"inputs": [],
"name": "ZeroAddressNotAllowed",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferStarted",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "withdrawAmount",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "withdrawAddress",
"type": "address"
}
],
"name": "WithdrawTreasuryNative",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "withdrawAmount",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "withdrawAddress",
"type": "address"
}
],
"name": "WithdrawTreasuryToken",
"type": "event"
},
{
"stateMutability": "payable",
"type": "fallback"
},
{
"inputs": [],
"name": "acceptOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pendingOwner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "withdrawAmount",
"type": "uint256"
},
{
"internalType": "address payable",
"name": "withdrawAddress",
"type": "address"
}
],
"name": "withdrawTreasuryNative",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "withdrawAmount",
"type": "uint256"
},
{
"internalType": "address",
"name": "withdrawAddress",
"type": "address"
}
],
"name": "withdrawTreasuryToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
]
}
}
}
1 change: 1 addition & 0 deletions deployments/zksyncsepolia/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
300
Loading

0 comments on commit d166f4a

Please sign in to comment.