From 35ef1e4e90cd0c0f831763ab276f99dd7c410226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Thu, 5 Jan 2023 07:49:17 +0100 Subject: [PATCH 1/7] Adjust workflow deploying contracts to support Goerli testnet Previously we've been deploying coverage-pools on Ropsten. As this testnet became deprecated, we're switching to the Goerli testnet. The hardhat config for that network has already been added in a separate commit/PR. Now we need to adjust CI jobs to be in line with that config. In this commit we modify the way we get the contract owner account's private key - we use an environment variable that can store multiple accounts and we fill its value with the value of a `GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY` GH secret. We also update value of the `CHAIN_API_URL` variable, as we've changed the name of the secret that holds the information about the chain API URL. --- .github/workflows/contracts.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml index 44929776..52f8f1e3 100644 --- a/.github/workflows/contracts.yml +++ b/.github/workflows/contracts.yml @@ -120,8 +120,8 @@ jobs: - name: Deploy contracts env: - CHAIN_API_URL: ${{ secrets.KEEP_TEST_ETH_HOSTNAME_HTTP }} - CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: ${{ secrets.KEEP_TEST_ETH_CONTRACT_OWNER_PRIVATE_KEY }} + CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }} + ACCOUNTS_PRIVATE_KEYS: ${{ secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }} run: yarn deploy --network ${{ github.event.inputs.environment }} - name: Bump up package version @@ -197,7 +197,7 @@ jobs: - name: Verify contracts on Etherscan env: ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} - CHAIN_API_URL: ${{ secrets.KEEP_TEST_ETH_HOSTNAME_HTTP }} + CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }} run: yarn run hardhat --network ${{ github.event.inputs.environment }} etherscan-verify --license MIT contracts-lint: From a71df6a418f2e48cf54dedd54e47bbdcf0033575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Thu, 5 Jan 2023 08:32:39 +0100 Subject: [PATCH 2/7] Remove Ropsten config in `hardhat.config.ts`, add missing Goerli config The Ropsten testnet became deprecated. We switched to using Goerli testnet for testing. This commit adds some missing piecies of the Goerli-related configuration and removes the obsolete Ropsten-related config. --- hardhat.config.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 96fdfda1..caacd926 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -52,14 +52,6 @@ const config: HardhatUserConfig = { : undefined, tags: ["etherscan", "tenderly"], }, - ropsten: { - url: process.env.CHAIN_API_URL || "", - chainId: 3, - accounts: process.env.CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY - ? [process.env.CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY] - : undefined, - tags: ["tenderly"], - }, mainnet: { url: process.env.CHAIN_API_URL || "", chainId: 1, @@ -97,10 +89,10 @@ const config: HardhatUserConfig = { "node_modules/@keep-network/keep-core/artifacts", "node_modules/@keep-network/tbtc/artifacts", ], - ropsten: [ + goerli: [ "node_modules/@keep-network/keep-core/artifacts", "node_modules/@keep-network/tbtc/artifacts", - "./external/ropsten", + "./external/goerli", ], mainnet: ["./external/mainnet-v2"], }, @@ -112,7 +104,6 @@ const config: HardhatUserConfig = { rewardManager: { default: 1, goerli: 0, // use deployer account - ropsten: 0, // use deployer account mainnet: 0, // use deployer account }, thresholdCouncil: { From 21e92b8e3ed760b4f8f3072bb3997d890004f81c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Thu, 5 Jan 2023 10:17:50 +0100 Subject: [PATCH 3/7] Remove `if` statement from the `Configure tenderly` step We no longer support `ropsten` testnet. The only testnet we do support is `goerli` . It is expected that this tesnet is used when workflow gets triggered manually. --- .github/workflows/contracts.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml index 52f8f1e3..58cc456d 100644 --- a/.github/workflows/contracts.yml +++ b/.github/workflows/contracts.yml @@ -113,7 +113,6 @@ jobs: @keep-network/tbtc@${{ steps.upstream-builds-query.outputs.tbtc-contracts-version }} - name: Configure tenderly - if: github.event.inputs.environment == 'ropsten' env: TENDERLY_TOKEN: ${{ secrets.TENDERLY_TOKEN }} run: ./config_tenderly.sh From 9ae1086a18fb85861a88bfd1f0567359d6fd2699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Wed, 11 Jan 2023 10:22:04 +0100 Subject: [PATCH 4/7] Incorporate workflow in the v2 of the CI flow The `Solidity` workflow for `coverage-pools` was part of the no longer used v1 of the CI flow. As in the v2 of the system we changed the structure of the dependencies between modules and added soem new modules, we need to adjust the position of the `coverage-pools` module in the v2 of the CI flow. In a sepaarate repository (`@keep-network/ci`) we're configuring the `github.com/keep-network/coverage-pools` module to execute after `github.com/threshold-network/solidity-contracts` module. In this PR we switch the workflow to use the `v2` of the CI flow and change the way how we resolve latest contracts. When workflow will be executed with the `goerli` `environment` input (which is the assumed behavior), we'll use the latest `goerli`-tagged `keep-core` and `tbtc` packages. We'll determine the version of the `@threshold-network/solidity-contracts` package based on the value passed in the `upstream_builds` input. As part of this PR we've also adjusted the Hardhat config to use the artifacts of the `@threshold-network/solidity-contracts` module. Tmp --- .github/workflows/contracts.yml | 12 ++++++------ hardhat.config.ts | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml index 58cc456d..36b20f60 100644 --- a/.github/workflows/contracts.yml +++ b/.github/workflows/contracts.yml @@ -98,19 +98,19 @@ jobs: run: yarn install --frozen-lockfile - name: Get upstream packages' versions - uses: keep-network/ci/actions/upstream-builds-query@v1 + uses: keep-network/ci/actions/upstream-builds-query@v2 id: upstream-builds-query with: upstream-builds: ${{ github.event.inputs.upstream_builds }} query: | - keep-core-contracts-version = github.com/keep-network/keep-core/solidity-v1#version - tbtc-contracts-version = github.com/keep-network/tbtc/solidity#version + threshold-contracts-version = github.com/threshold-network/solidity-contracts#version - name: Resolve latest contracts run: | yarn upgrade \ - @keep-network/keep-core@${{ steps.upstream-builds-query.outputs.keep-core-contracts-version }} \ - @keep-network/tbtc@${{ steps.upstream-builds-query.outputs.tbtc-contracts-version }} + @keep-network/keep-core@{{ github.event.inputs.environment }} \ + @keep-network/tbtc@{{ github.event.inputs.environment }} \ + @threshold-network/solidity-contracts@${{ steps.upstream-builds-query.outputs.threshold-contracts-version }} - name: Configure tenderly env: @@ -137,7 +137,7 @@ jobs: run: npm publish --access=public --network=${{ github.event.inputs.environment }} --tag ${{ github.event.inputs.environment }} - name: Notify CI about completion of the workflow - uses: keep-network/ci/actions/notify-workflow-completed@v1 + uses: keep-network/ci/actions/notify-workflow-completed@v2 env: GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} with: diff --git a/hardhat.config.ts b/hardhat.config.ts index caacd926..2ae692b1 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -92,6 +92,7 @@ const config: HardhatUserConfig = { goerli: [ "node_modules/@keep-network/keep-core/artifacts", "node_modules/@keep-network/tbtc/artifacts", + "node_modules/@threshold-network/solidity-contracts/artifacts", "./external/goerli", ], mainnet: ["./external/mainnet-v2"], From 3a56e3494092187b66ea8b2bd1126ac0a7904d67 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Thu, 21 Jul 2022 15:03:03 +0200 Subject: [PATCH 5/7] Add goerli UniswapV2Router artifact --- external/goerli/UniswapV2Router.json | 976 +++++++++++++++++++++++++++ 1 file changed, 976 insertions(+) create mode 100644 external/goerli/UniswapV2Router.json diff --git a/external/goerli/UniswapV2Router.json b/external/goerli/UniswapV2Router.json new file mode 100644 index 00000000..e3b06ea9 --- /dev/null +++ b/external/goerli/UniswapV2Router.json @@ -0,0 +1,976 @@ +{ + "address": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_factory", + "type": "address" + }, + { + "internalType": "address", + "name": "_WETH", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "WETH", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenA", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenB", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountADesired", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountBDesired", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountAMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountBMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "addLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "amountA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountB", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountTokenDesired", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountTokenMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETHMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "addLiquidityETH", + "outputs": [ + { + "internalType": "uint256", + "name": "amountToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETH", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "factory", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveOut", + "type": "uint256" + } + ], + "name": "getAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveOut", + "type": "uint256" + } + ], + "name": "getAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + } + ], + "name": "getAmountsIn", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + } + ], + "name": "getAmountsOut", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveB", + "type": "uint256" + } + ], + "name": "quote", + "outputs": [ + { + "internalType": "uint256", + "name": "amountB", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenA", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenB", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountAMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountBMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "removeLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "amountA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountB", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountTokenMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETHMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "removeLiquidityETH", + "outputs": [ + { + "internalType": "uint256", + "name": "amountToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETH", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountTokenMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETHMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "removeLiquidityETHSupportingFeeOnTransferTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "amountETH", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountTokenMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETHMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "approveMax", + "type": "bool" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "removeLiquidityETHWithPermit", + "outputs": [ + { + "internalType": "uint256", + "name": "amountToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETH", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountTokenMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETHMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "approveMax", + "type": "bool" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "amountETH", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenA", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenB", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountAMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountBMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "approveMax", + "type": "bool" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "removeLiquidityWithPermit", + "outputs": [ + { + "internalType": "uint256", + "name": "amountA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountB", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapETHForExactTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactETHForTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactETHForTokensSupportingFeeOnTransferTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForETH", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForETHSupportingFeeOnTransferTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokensSupportingFeeOnTransferTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactETH", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} From 3693c1bad4004025ea5ee529bc0728cb03ddd7e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Wed, 11 Jan 2023 10:40:22 +0100 Subject: [PATCH 6/7] Verify contracts in Etherscan using `@nomiclabs/hardhat-etherscan` After deploying the `coverage-pools` contracts we want to verify them in the Etherscan, so that their source code could be easily browsed there. Historically, in our other modules, we've been using either the `@nomiclabs/hardhat-etherscan` or `hardhat-deploy` plugin to run the verification. Here in the `coverage-pools` module, the config we used was inconsistent and it contained elements of both plugins' configs. In this commit we sort the config out - from now on we'll use only the `@nomiclabs/hardhat-etherscan` plugin to verify `coverage-pools` contracts on Etherscan. We already have the plugin defined as the project dependency and we have the deployments scripts configured to perform the verification. We're adding passing of the `ETHERSCAN_API_KEY` secret as an environment variable in the deployment step in the CI and removing an obsolete configuration related to the `hardhat-deploy` plugin. --- .github/workflows/contracts.yml | 52 +-------------------------------- 1 file changed, 1 insertion(+), 51 deletions(-) diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml index 36b20f60..66cb0667 100644 --- a/.github/workflows/contracts.yml +++ b/.github/workflows/contracts.yml @@ -121,6 +121,7 @@ jobs: env: CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }} ACCOUNTS_PRIVATE_KEYS: ${{ secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }} + ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} run: yarn deploy --network ${{ github.event.inputs.environment }} - name: Bump up package version @@ -148,57 +149,6 @@ jobs: upstream_ref: ${{ github.event.inputs.upstream_ref }} version: ${{ steps.npm-version-bump.outputs.version }} - - name: Upload files needed for etherscan verification - uses: actions/upload-artifact@v2 - with: - name: Artifacts for etherscan verifcation - path: | - ./deployments - ./package.json - ./yarn.lock - - contracts-etherscan-verification: - needs: [contracts-deployment-testnet] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Download files needed for etherscan verification - uses: actions/download-artifact@v2 - with: - name: Artifacts for etherscan verifcation - - - uses: actions/setup-node@v2 - with: - node-version: "14.x" - cache: "yarn" - - # This step forces Git to download dependencies using `https://` protocol, - # even if `yarn.json` refers to some package via `git://`. Using `git://` - # is no longer supported by GH. One of the `coverage-pools` dependencies - # by default uses `git://` and we needed to manually remove it every time - # it re-appeares in the lock file. Now even if it does re-appear, the - # `yarn install --frozen-lockfile` will not fail. - - name: Configure git to don't use unauthenticated protocol - run: git config --global url."https://".insteadOf git:// - - - name: Install needed dependencies - run: yarn install --frozen-lockfile - - # If we don't remove the dependencies' contracts from `node-modules`, the - # `etherscan-verify` plugins tries to verify them, which is not desired. - - name: Prepare for verification on Etherscan - run: | - rm -rf ./node_modules/@keep-network/keep-core - rm -rf ./node_modules/@keep-network/tbtc - rm -rf ./node_modules/@threshold-network/solidity-contracts - - - name: Verify contracts on Etherscan - env: - ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} - CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }} - run: yarn run hardhat --network ${{ github.event.inputs.environment }} etherscan-verify --license MIT - contracts-lint: runs-on: ubuntu-latest if: | From 34d207d6f23c1718c1275c8620f2c2f2400ceca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Wed, 11 Jan 2023 10:53:09 +0100 Subject: [PATCH 7/7] Adjust Tenderly config We're switching from deployments of contacts on Ropsten to deployment on Goerli (because the Ropsten testnet became deprecated). --- tenderly.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tenderly.yaml b/tenderly.yaml index a61111f2..f45d932f 100644 --- a/tenderly.yaml +++ b/tenderly.yaml @@ -5,4 +5,4 @@ projects: - "1" # mainnet thesis/keep-test: networks: - - "3" # ropsten + - "5" # goerli