diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 387c1f5f5..47548dc01 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -89,3 +89,38 @@ jobs: - name: Verify deployments work run: yarn hardhat deploy + + export-deployments: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Check out code + uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} + token: ${{ secrets.VENUS_TOOLS_TOKEN }} + + - name: Setup Node.js environment + uses: actions/setup-node@v2 + with: + node-version: 18 + cache: "yarn" + + - name: Install dependencies + # Hack to get around failing "ethereumjs-abi The remote archive doesn't match the expected checksum" error + run: YARN_CHECKSUM_BEHAVIOR=update yarn + + - 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 + yarn hardhat export --network ethereum --export ./deployments/ethereum.json + yarn prettier + + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "feat: updating deployment files" + file_pattern: "deployments/*.json" diff --git a/README.md b/README.md index 2ae44fe6b..6481943b6 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,14 @@ npx hardhat deploy - In the deployment scripts you have added `tags` for example: - `func.tags = ["MockTokens"];` - Once this is done, adding `--tags ",..."` to the deployment command will execute only the scripts containing the tags. +### Deployed Contracts + +Deployed contract abis and addresses are exported in the `deployments` directory. To create a summary export of all contracts deployed to a network run + +``` +$ yarn hardhat export --network --export ./deployments/.json +``` + ## Source Code Verification In order to verify the source code of already deployed contracts, run: diff --git a/deployments/ethereum.json b/deployments/ethereum.json new file mode 100644 index 000000000..dd24474d9 --- /dev/null +++ b/deployments/ethereum.json @@ -0,0 +1,5 @@ +{ + "name": "ethereum", + "chainId": "1", + "contracts": {} +} diff --git a/deployments/sepolia.json b/deployments/sepolia.json new file mode 100644 index 000000000..21a16fd45 --- /dev/null +++ b/deployments/sepolia.json @@ -0,0 +1,5 @@ +{ + "name": "sepolia", + "chainId": "11155111", + "contracts": {} +} diff --git a/hardhat.config.ts b/hardhat.config.ts index 4b1ea96d1..4b5742b0d 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -174,6 +174,18 @@ const config: HardhatUserConfig = { mnemonic: process.env.MNEMONIC || "", }, }, + sepolia: { + url: process.env.RPC_URL || "https://rpc.notadegen.com/eth/sepolia", + chainId: 11155111, + live: true, + gasPrice: 20000000000, // 20 gwei + }, + ethereum: { + url: process.env.ETHEREUM_ARCHIVE_NODE_URL || "https://eth-mainnet.public.blastapi.io", + chainId: 1, + live: true, + timeout: 1200000, // 20 minutes + }, }, gasReporter: { enabled: process.env.REPORT_GAS !== undefined,