diff --git a/.github/workflows/deploy_and_release.yml b/.github/workflows/deploy_and_release.yml index 9694bc5..3b335d6 100644 --- a/.github/workflows/deploy_and_release.yml +++ b/.github/workflows/deploy_and_release.yml @@ -51,13 +51,13 @@ jobs: result-encoding: string script: | const tag = process.env.GITHUB_REF_NAME; - const regex = /v.*\-(eth|hteth|matic|tmatic|bsc|tbsc|arbeth|tarbeth|opeth|topeth|zketh|tzketh|baseeth|tbaseeth|tbera)$/; + const regex = /v.*\-(eth|hteth|matic|tmatic|bsc|tbsc|arbeth|tarbeth|opeth|topeth|zketh|tzketh|baseeth|tbaseeth|tbera|tavaxc|avaxc)$/; const network = tag.match(regex); return network ? network[1] : "hteth"; deploy-to-test: runs-on: ubuntu-latest needs: [lint-and-test, get-network] - if: ${{ (needs.get-network.outputs.network == 'hteth' ) || (needs.get-network.outputs.network == 'tmatic' ) || (needs.get-network.outputs.network == 'tbsc' ) || (needs.get-network.outputs.network == 'tarbeth' ) || (needs.get-network.outputs.network == 'topeth' ) || (needs.get-network.outputs.network == 'tzketh' ) || (needs.get-network.outputs.network == 'tbaseeth' ) || (needs.get-network.outputs.network == 'tbera' ) }} + if: ${{ (needs.get-network.outputs.network == 'hteth' ) || (needs.get-network.outputs.network == 'tmatic' ) || (needs.get-network.outputs.network == 'tbsc' ) || (needs.get-network.outputs.network == 'tarbeth' ) || (needs.get-network.outputs.network == 'topeth' ) || (needs.get-network.outputs.network == 'tzketh' ) || (needs.get-network.outputs.network == 'tbaseeth' ) || (needs.get-network.outputs.network == 'tbera' ) || (needs.get-network.outputs.network == 'tavaxc' ) }} environment: testnet steps: - uses: actions/checkout@v2 @@ -118,7 +118,7 @@ jobs: deploy-to-prod: runs-on: ubuntu-latest needs: [lint-and-test, get-network] - if: ${{ (needs.get-network.outputs.network == 'eth' ) || (needs.get-network.outputs.network == 'matic' ) || (needs.get-network.outputs.network == 'bsc' ) || (needs.get-network.outputs.network == 'arbeth' ) || (needs.get-network.outputs.network == 'opeth' ) || (needs.get-network.outputs.network == 'zketh' ) || (needs.get-network.outputs.network == 'baseeth' ) || (needs.get-network.outputs.network == 'bera' )}} + if: ${{ (needs.get-network.outputs.network == 'eth' ) || (needs.get-network.outputs.network == 'matic' ) || (needs.get-network.outputs.network == 'bsc' ) || (needs.get-network.outputs.network == 'arbeth' ) || (needs.get-network.outputs.network == 'opeth' ) || (needs.get-network.outputs.network == 'zketh' ) || (needs.get-network.outputs.network == 'baseeth' ) || (needs.get-network.outputs.network == 'bera' ) || (needs.get-network.outputs.network == 'avaxc' )}} environment: mainnet steps: - uses: actions/checkout@v2 diff --git a/hardhat.config.ts b/hardhat.config.ts index 603fbdd..4f25da1 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -29,7 +29,7 @@ const { OPTIMISTIC_ETHERSCAN_API_KEY, ZKSYNC_EXPLORER_API_KEY, BASESCAN_API_KEY, - BARTIO_BERA_EXPLORER_API_KEY + BARTIO_BERA_EXPLORER_API_KEY, } = process.env; const config: HardhatUserConfig = { @@ -132,6 +132,14 @@ const config: HardhatUserConfig = { tbera: { url: `https://bartio.rpc.berachain.com/`, accounts: [`${PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT}`] + }, + tavaxc: { + url: 'https://api.avax-test.network/ext/C/rpc', + accounts: [`${TESTNET_PRIVATE_KEY_FOR_CONTRACT_DEPLOYMENT}`] + }, + avaxc: { + url: 'https://api.avax.network/ext/bc/C/rpc', + accounts: [`${MAINNET_PRIVATE_KEY_FOR_CONTRACT_DEPLOYMENT}`] } }, gasReporter: { @@ -162,7 +170,11 @@ const config: HardhatUserConfig = { baseSepolia: `${BASESCAN_API_KEY}`, base: `${BASESCAN_API_KEY}`, // bera - bartioBera: `${BARTIO_BERA_EXPLORER_API_KEY}` + bartioBera: `${BARTIO_BERA_EXPLORER_API_KEY}`, + //avaxc + // there is free api key for avaxc, so make use of 2 req/sec + axaxc: 'sampleapikey', + avaxcTestnet: 'sampleapikey' }, customChains: [ { @@ -237,6 +249,24 @@ const config: HardhatUserConfig = { apiURL: 'https://api.basescan.org/api', browserURL: 'https://basescan.org/' } + }, + { + network: 'avaxc', + chainId: 43114, + urls: { + apiURL: + 'https://api.routescan.io/v2/network/mainnet/evm/43114/etherscan/api', + browserURL: 'https://snowtrace.io/' + } + }, + { + network: 'avaxcTestnet', + chainId: 43113, + urls: { + apiURL: + 'https://api.routescan.io/v2/network/testnet/evm/43113/etherscan/api', + browserURL: 'https://testnet.snowtrace.io/' + } } ] }, diff --git a/scripts/deploy.ts b/scripts/deploy.ts index 786d0c5..6bb350f 100644 --- a/scripts/deploy.ts +++ b/scripts/deploy.ts @@ -1,4 +1,4 @@ -import { use } from 'chai'; +import { BigNumber } from 'ethers'; import { ethers } from 'hardhat'; const hre = require('hardhat'); const fs = require('fs'); @@ -13,11 +13,14 @@ async function main() { const feeData = await ethers.provider.getFeeData(); - const eip1559GasParams = { + const eip1559GasParams: { + maxFeePerGas: BigNumber | null; + maxPriorityFeePerGas: BigNumber | null; + gasLimit?: number; + } = { maxFeePerGas: feeData.maxFeePerGas, maxPriorityFeePerGas: feeData.maxPriorityFeePerGas }; - let deployWalletContracts = false, deployForwarderContracts = false; const [deployer] = await ethers.getSigners(); @@ -110,6 +113,16 @@ async function main() { forwarderFactoryContractName = 'ForwarderFactoryV4'; contractPath = `contracts/${walletImplementationContractName}.sol:${walletImplementationContractName}`; break; + //avaxc + case 43114: + //tavaxc + case 43113: + eip1559GasParams.gasLimit = 3000000; + walletImplementationContractName = 'WalletSimple'; + forwarderContractName = 'Forwarder'; + forwarderFactoryContractName = 'ForwarderFactory'; + contractPath = `contracts/${walletImplementationContractName}.sol:${walletImplementationContractName}`; + break; } if (deployWalletContracts) {