Skip to content

Commit

Permalink
Merge pull request #43 from VenusProtocol/feat/VEN-2197-addresses-files
Browse files Browse the repository at this point in the history
[VEN-2197]: generate files with addresses of the deployed contracts
  • Loading branch information
chechu authored Dec 1, 2023
2 parents a88f72c + c2a2296 commit 7ff85a6
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 20 deletions.
21 changes: 16 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# true or false
FORK=false
FORKED_NETWORK=bscmainnet

MNEMONIC="here is where your twelve words mnemonic should be put my friend"
BSCSCAN_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
BSC_ARCHIVE_NODE="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
DEPLOYER_PRIVATE_KEY="E9873D79C6D87DC0FB6A5778633389F4453213303DA61F20BD67FC233AA33262"
BSC_TESTNET_NODE="https://data-seed-prebsc-1-s1.binance.org:8545"
BSC_MAINNET_NODE="https://bsc-dataseed.binance.org/"
DEPLOYER_PRIVATE_KEY=

## Archive nodes
#ARCHIVE_NODE_bsctestnet=https://bsc-testnet.nodereal.io/v1/<YOUR_KEY_HERE>
#ARCHIVE_NODE_bscmainnet=https://bsc-mainnet.nodereal.io/v1/<YOUR_KEY_HERE>
#ARCHIVE_NODE_bscmainnet=http://127.0.0.1:1248
#ARCHIVE_NODE_sepolia=https://ethereum-sepolia.blockpi.network/v1/rpc/public
#ARCHIVE_NODE_ethereum=https://eth-mainnet.nodereal.io/v1/<YOUR_KEY_HERE>
#ARCHIVE_NODE_ethereum=http://127.0.0.1:1248

ETHERSCAN_API_KEY=
REPORT_GAS=
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ jobs:

- name: Export deployments
run: |
yarn hardhat export --network bsctestnet --export ./deployments/bsctestnet.json
yarn hardhat export --network bscmainnet --export ./deployments/bscmainnet.json
yarn hardhat export --network sepolia --export ./deployments/sepolia.json
for NETWORK in bsctestnet bscmainnet ethereum sepolia; do
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
yarn prettier
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "feat: updating deployment files"
Expand Down
10 changes: 10 additions & 0 deletions deployments/bscmainnet_addresses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "bscmainnet",
"chainId": "56",
"addresses": {
"DefaultProxyAdmin": "0x6beb6D2695B67FEb73ad4f172E8E2975497187e4",
"ProtocolShareReserve": "0xCa01D5A9A248a830E9D93231e791B1afFed7c446",
"ProtocolShareReserve_Implementation": "0x5108E5F903Ecc5e3a2dA20171527aCe96CB3c7f8",
"ProtocolShareReserve_Proxy": "0xCa01D5A9A248a830E9D93231e791B1afFed7c446"
}
}
10 changes: 10 additions & 0 deletions deployments/bsctestnet_addresses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "bsctestnet",
"chainId": "97",
"addresses": {
"DefaultProxyAdmin": "0x7877ffd62649b6a1557b55d4c20fcbab17344c91",
"ProtocolShareReserve": "0x25c7c7D6Bf710949fD7f03364E9BA19a1b3c10E3",
"ProtocolShareReserve_Implementation": "0x6A7FF4641F52b267102a5a0779cE7a060374d6cC",
"ProtocolShareReserve_Proxy": "0x25c7c7D6Bf710949fD7f03364E9BA19a1b3c10E3"
}
}
5 changes: 5 additions & 0 deletions deployments/ethereum.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "ethereum",
"chainId": "1",
"contracts": {}
}
5 changes: 5 additions & 0 deletions deployments/ethereum_addresses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "ethereum",
"chainId": "1",
"addresses": {}
}
5 changes: 5 additions & 0 deletions deployments/sepolia_addresses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "sepolia",
"chainId": "11155111",
"addresses": {}
}
47 changes: 36 additions & 11 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
});

function isFork() {
return process.env.FORK_MAINNET === "true"
return process.env.FORK === "true"
? {
allowUnlimitedContractSize: false,
loggingEnabled: false,
forking: {
url: `${process.env.BSC_ARCHIVE_NODE}`,
url:
process.env[`ARCHIVE_NODE_${process.env.FORKED_NETWORK}`] ||
"https://data-seed-prebsc-1-s1.binance.org:8545",
blockNumber: 21068448,
},
accounts: {
Expand Down Expand Up @@ -80,32 +82,39 @@ const config: HardhatUserConfig = {
networks: {
hardhat: isFork(),
bsctestnet: {
url: process.env.BSC_TESTNET_NODE || "https://data-seed-prebsc-2-s3.binance.org:8545/",
url: process.env.ARCHIVE_NODE_bsctestnet || "https://data-seed-prebsc-1-s1.binance.org:8545",
chainId: 97,
accounts: {
mnemonic: process.env.MNEMONIC || "",
},
gasPrice: 10000000000, // 10 gwei
gasMultiplier: 10,
timeout: 12000000,
},
bscmainnet: {
url: process.env.BSC_MAINNET_NODE || "https://bsc-dataseed.binance.org/",
gasMultiplier: 10,
accounts: {
mnemonic: process.env.MNEMONIC || "",
},
url: process.env.ARCHIVE_NODE_bscmainnet || "https://bsc-dataseed.binance.org/",
accounts: process.env.DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],

Check failure on line 96 in hardhat.config.ts

View workflow job for this annotation

GitHub Actions / release

Cannot find name 'DEPLOYER_PRIVATE_KEY'.
},
sepolia: {
url: "https://rpc.notadegen.com/eth/sepolia",
url: process.env.ARCHIVE_NODE_sepolia || "https://ethereum-sepolia.blockpi.network/v1/rpc/public",
chainId: 11155111,
gasPrice: 20000000000,
accounts: process.env.PRIVATE_KEY ? [`0x${process.env.PRIVATE_KEY}`] : [],
live: true,
gasPrice: 20000000000, // 20 gwei
accounts: process.env.DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],

Check failure on line 103 in hardhat.config.ts

View workflow job for this annotation

GitHub Actions / release

Cannot find name 'DEPLOYER_PRIVATE_KEY'.
},
ethereum: {
url: process.env.ARCHIVE_NODE_ethereum || "https://ethereum.blockpi.network/v1/rpc/public",
chainId: 1,
live: true,
timeout: 1200000, // 20 minutes
},
},
etherscan: {
apiKey: {
bscmainnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
bsctestnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
sepolia: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
ethereum: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
},
customChains: [
{
Expand All @@ -124,6 +133,22 @@ const config: HardhatUserConfig = {
browserURL: "https://testnet.bscscan.com",
},
},
{
network: "sepolia",
chainId: 11155111,
urls: {
apiURL: "https://api-sepolia.etherscan.io/api",
browserURL: "https://sepolia.etherscan.io",
},
},
{
network: "ethereum",
chainId: 1,
urls: {
apiURL: "https://api.etherscan.io/api",
browserURL: "https://etherscan.io",
},
},
],
},
paths: {
Expand Down

0 comments on commit 7ff85a6

Please sign in to comment.