Skip to content

Commit

Permalink
feat: support avaxc coin
Browse files Browse the repository at this point in the history
Ticket: COIN-1712
  • Loading branch information
mullapudipruthvik committed Sep 10, 2024
1 parent 18e1a8f commit 247d1d8
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 5 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/deploy_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
ZKSYNC_EXPLORER_API_KEY: ${{ secrets.ZKSYNC_EXPLORER_API_KEY }}
BASESCAN_API_KEY: ${{ secrets.BASESCAN_API_KEY }}
BARTIO_BERA_EXPLORER_API_KEY: ${{ secrets.BARTIO_BERA_EXPLORER_API_KEY }}
SNOWTRACE_API_KEY: ${{ secrets.SNOWTRACE_API_KEY }}
get-network:
runs-on: ubuntu-latest
needs: [lint-and-test]
Expand All @@ -51,13 +52,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
Expand Down Expand Up @@ -87,6 +88,7 @@ jobs:
ZKSYNC_EXPLORER_API_KEY: ${{ secrets.ZKSYNC_EXPLORER_API_KEY }}
BASESCAN_API_KEY: ${{ secrets.BASESCAN_API_KEY }}
BARTIO_BERA_EXPLORER_API_KEY: ${{ secrets.BARTIO_BERA_EXPLORER_API_KEY }}
SNOWTRACE_API_KEY: ${{ secrets.SNOWTRACE_API_KEY }}
- name: Update release notes
uses: actions/github-script@v6
with:
Expand Down Expand Up @@ -118,7 +120,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
Expand Down Expand Up @@ -147,6 +149,7 @@ jobs:
QUICKNODE_ARBITRUM_ONE_API_KEY: ${{ secrets.QUICKNODE_ARBITRUM_ONE_API_KEY }}
QUICKNODE_OPTIMISM_API_KEY: ${{ secrets.QUICKNODE_OPTIMISM_API_KEY }}
BASESCAN_API_KEY: ${{ secrets.BASESCAN_API_KEY }}
SNOWTRACE_API_KEY: ${{ secrets.SNOWTRACE_API_KEY }}
- name: Update release notes
uses: actions/github-script@v6
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ jobs:
ZKSYNC_EXPLORER_API_KEY: ${{ secrets.ZKSYNC_EXPLORER_API_KEY }}
BASESCAN_API_KEY: ${{ secrets.BASESCAN_API_KEY }}
BARTIO_BERA_EXPLORER_API_KEY: ${{ secrets.BARTIO_BERA_EXPLORER_API_KEY }}
SNOWTRACE_API_KEY: ${{ secrets.SNOWTRACE_API_KEY }}
- run: npm run lint
34 changes: 32 additions & 2 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const {
OPTIMISTIC_ETHERSCAN_API_KEY,
ZKSYNC_EXPLORER_API_KEY,
BASESCAN_API_KEY,
BARTIO_BERA_EXPLORER_API_KEY
BARTIO_BERA_EXPLORER_API_KEY,
SNOWTRACE_API_KEY
} = process.env;

const config: HardhatUserConfig = {
Expand Down Expand Up @@ -132,6 +133,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: {
Expand Down Expand Up @@ -162,7 +171,10 @@ 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
axaxc: `${SNOWTRACE_API_KEY}`,
avaxcTestnet: `${SNOWTRACE_API_KEY}`
},
customChains: [
{
Expand Down Expand Up @@ -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/'
}
}
]
},
Expand Down
9 changes: 9 additions & 0 deletions scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ async function main() {
forwarderFactoryContractName = 'ForwarderFactoryV4';
contractPath = `contracts/${walletImplementationContractName}.sol:${walletImplementationContractName}`;
break;
//avaxc
case 43114:
//tavaxc
case 43113:
walletImplementationContractName = 'WalletSimple';
forwarderContractName = 'Forwarder';
forwarderFactoryContractName = 'ForwarderFactory';
contractPath = `contracts/${walletImplementationContractName}.sol:${walletImplementationContractName}`;
break;
}

if (deployWalletContracts) {
Expand Down

0 comments on commit 247d1d8

Please sign in to comment.