Skip to content

Commit

Permalink
Added Polygon network support (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
fforbeck committed Apr 3, 2024
1 parent a852784 commit 5e34b44
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ DEBUG=false
# The API that you are using to connect to Ethereum Blockchain
#
# ALCHEMY Mainnet: https://eth-mainnet.alchemyapi.io/v2/[YOUR_ALCHEMY_API_KEY]
# ALCHEMY Goerli: https://eth-goerli.alchemyapi.io/v2/[YOUR_ALCHEMY_API_KEY]
# ALCHEMY Polygon: https://polygon-mainnet.alchemyapi.io/v2/[YOUR_ALCHEMY_API_KEY]
#
# INFURA Mainnet: https://mainnet.infura.io/v3/[YOUR_INFURA_API_KEY]
# INFURA Goerli: https://goerli.infura.io/v3/[YOUR_INFURA_API_KEY]
# INFURA Polygon: https://polygon-mainnet.infura.io/v3/[YOUR_INFURA_API_KEY]
ETHEREUM_BLOCKCHAIN_API=https://...

##
# The Ethereum Network which CLI should interact with: ganache, goerli, mainnet
ETHEREUM_NETWORK=goerli
# The Ethereum Network which CLI should interact with: ganache, polygon, mainnet
ETHEREUM_NETWORK=polygon
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ DEBUG=false
# The API that you are using to connect to Ethereum Blockchain
#
# ALCHEMY Mainnet: https://eth-mainnet.alchemyapi.io/v2/[YOUR_ALCHEMY_API_KEY]
# ALCHEMY Goerli: https://eth-goerli.alchemyapi.io/v2/[YOUR_ALCHEMY_API_KEY]
# ALCHEMY Polygon: https://polygon-mainnet.alchemyapi.io/v2/[YOUR_ALCHEMY_API_KEY]
#
# INFURA Mainnet: https://mainnet.infura.io/v3/[YOUR_INFURA_API_KEY]
# INFURA Goerli: https://goerli.infura.io/v3/[YOUR_INFURA_API_KEY]
# INFURA Polygon: https://polygon-mainnet.io/v3/[YOUR_INFURA_API_KEY]
ETHEREUM_BLOCKCHAIN_API=...
##
# The Ethereum Network which CLI should interact with: ganache, goerli, mainnet
# The Ethereum Network which CLI should interact with: ganache, polygon, mainnet
ETHEREUM_NETWORK=..
##
Expand Down
4 changes: 2 additions & 2 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ module.exports = {
path: "m/44'/60'/0'/0",
},
},
goerli: {
polygon: {
url: configs.ethBlockchainApi,
network_id: 5,
network_id: 137,
skipDryRun: true,
networkCheckTimeout: 10000,
deploymentPollingInterval: 10000,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const getProvider = (network) => {
throw new Error("Unable to get the provider due to invalid network");

switch (network) {
case "goerli":
case "polygon":
case "mainnet": {
if (configs.alchemyApiKey)
return new ethers.providers.AlchemyProvider(
Expand Down

0 comments on commit 5e34b44

Please sign in to comment.