Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Polygon network support #17

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading