Skip to content

Commit

Permalink
Merge pull request #25 from 0xPolygon/custom-erc20
Browse files Browse the repository at this point in the history
Custom erc20
  • Loading branch information
nitinmittal23 authored Sep 2, 2024
2 parents c2f56d5 + f1e0b5a commit d5107d9
Show file tree
Hide file tree
Showing 8 changed files with 172 additions and 153 deletions.
5 changes: 3 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ PRIVATE_KEY=0xabc
NETWORK=testnet
TRANSACTIONS_URL=https://api-gateway.polygon.technology/api/v3/transactions/testnet
TRANSACTIONS_API_KEY=949c223b-fdcc-4a98-971c-bfe313235122
PROOF_URL=https://api-gateway.polygon.technology/api/v3/merkle-proof/testnet
PROOF_URL=https://api-gateway.polygon.technology/api/v3/proof/testnet/merkle-proof
PROOF_API_KEY=949c223b-fdcc-4a98-971c-bfe313235122
RPC_URL=https://rpc.cardona.zkevm-rpc.com
BRIDGE_CONTRACT=0x528e26b25a34a4A5d0dbDa1d57D318153d2ED582
CLAIM_COMPRESSOR_CONTRACT=0xeADFA914e7aBf33179E7820Bd13043962a7B5F9d
GAS_STATION_URL=https://gasstation-testnet.polygon.technology/zkevm/cardona
SOURCE_NETWORKS=[2]
SOURCE_NETWORKS=[0,2]
SOURCE_NETWORKS_RPC=["https://rpc.sepolia.org","https://rpc.startale.com/zkyoto"]
DESTINATION_NETWORK=1
SLACK_URL= # Not-Mandatory

Expand Down
29 changes: 28 additions & 1 deletion .github/taskdef/prod-taskdef.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,31 @@ environment: staging
iac: terraform-workspace-aws-prod-apps-eu-west-1-apps-auto-claim-polygon-technology
team_name: product-apps
memory: 1024
cpu: 512
cpu: 512
env_vars:
- name: NETWORK
value: mainnet
- name: TRANSACTIONS_URL
value: https://api-gateway.polygon.technology/api/v3/transactions/testnet
- name: PROOF_URL
value: https://api-gateway-staging.polygon.technology/api/v3/proof/mainnet/merkle-proof
- name: CLAIM_COMPRESSOR_CONTRACT
value: "0xeADFA914e7aBf33179E7820Bd13043962a7B5F9d"
- name: BRIDGE_CONTRACT
value: "0x2a3DD3EB832aF982ec71669E178424b10Dca2EDe"
- name: GAS_STATION_URL
value: https://gasstation.polygon.technology/zkevm/cherry
- name: SOURCE_NETWORKS
value: "[0,2]"
- name: DESTINATION_NETWORK
value: "1"
- name: SENTRY_ENVIRONMENT
value: staging
secret_vars:
- PRIVATE_KEY
- RPC_URL
- SLACK_URL
- SENTRY_DSN
- TRANSACTIONS_API_KEY
- PROOF_API_KEY
- SOURCE_NETWORKS_RPC
1 change: 1 addition & 0 deletions .github/taskdef/staging-taskdef.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ secret_vars:
- SENTRY_DSN
- TRANSACTIONS_API_KEY
- PROOF_API_KEY
- SOURCE_NETWORKS_RPC
172 changes: 50 additions & 122 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ config();
export default {
PRIVATE_KEY: process.env.PRIVATE_KEY,
SOURCE_NETWORKS: process.env.SOURCE_NETWORKS || '[]',
SOURCE_NETWORKS_RPC: process.env.SOURCE_NETWORKS_RPC || '[]',
DESTINATION_NETWORK: process.env.DESTINATION_NETWORK,
TRANSACTIONS_URL: process.env.TRANSACTIONS_URL,
TRANSACTIONS_API_KEY: process.env.TRANSACTIONS_API_KEY,
Expand Down
8 changes: 7 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ async function start() {
if (config.SLACK_URL) {
slackNotify = new SlackNotify(config.SLACK_URL)
}

let ethersClients: { [key: string]: ethers.JsonRpcProvider } = {}
for (let index = 0; index < JSON.parse(config.SOURCE_NETWORKS).length; index += 1) {
ethersClients[JSON.parse(config.SOURCE_NETWORKS)[index]] = new ethers.JsonRpcProvider(JSON.parse(config.SOURCE_NETWORKS_RPC)[index])
}

autoClaimService = new AutoClaimService(
config.NETWORK as string,
new ethers.Contract(
config.CLAIM_COMPRESSOR_CONTRACT as string,
claimCompressorAbi,
Expand All @@ -57,6 +62,7 @@ async function start() {
config.TRANSACTIONS_URL as string,
config.SOURCE_NETWORKS,
config.DESTINATION_NETWORK as string,
ethersClients,
config.TRANSACTIONS_API_KEY,
config.PROOF_API_KEY
),
Expand Down
Loading

0 comments on commit d5107d9

Please sign in to comment.