Skip to content

Commit

Permalink
Add Arbitrum Mainnet and Arbitrum Sepolia support
Browse files Browse the repository at this point in the history
  • Loading branch information
chudilka1 authored Jan 10, 2024
2 parents 6e994a5 + fa6884a commit f5950ce
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 9 deletions.
2 changes: 2 additions & 0 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ module.exports = {
sepolia: networks.ethereumSepolia.verifyApiKey,
polygonMumbai: networks.polygonMumbai.verifyApiKey,
avalancheFujiTestnet: networks.avalancheFuji.verifyApiKey,
arbitrum: networks.arbitrum.verifyApiKey,
arbitrumSepolia: networks.arbitrumSepolia.verifyApiKey,
},
},
gasReporter: {
Expand Down
35 changes: 35 additions & 0 deletions networks.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,41 @@ const networks = {
"https://02.functions-gateway.testnet.chain.link/",
],
},
arbitrum: {
url: process.env.ARBITRUM_RPC_URL || "UNSET",
gasPrice: undefined,
nonce: undefined,
accounts,
verifyApiKey: process.env.ARBISCAN_API_KEY || "UNSET",
chainId: 42161,
confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
nativeCurrencySymbol: "ETH",
linkToken: "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4",
linkPriceFeed: "0xb7c8Fb1dB45007F98A68Da0588e1AA524C317f27", // LINK/ETH
functionsRouter: "0x97083E831F8F0638855e2A515c90EdCF158DF238",
donId: "fun-arbitrum-mainnet-1",
gatewayUrls: ["https://01.functions-gateway.chain.link/", "https://02.functions-gateway.chain.link/"],
},
arbitrumSepolia: {
url: process.env.ARBITRUM_SEPOLIA_RPC_URL || "UNSET",
gasPrice: undefined,
nonce: undefined,
accounts,
verifyApiKey: process.env.ARBISCAN_API_KEY || "UNSET",
url: process.env.ARBITRUM_SEPOLIA_RPC_URL || "UNSET",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 421614,
confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
nativeCurrencySymbol: "ETH",
linkToken: "0xb1D4538B4571d411F07960EF2838Ce337FE1E80E",
linkPriceFeed: "0xccAE8A015754a64f379550146360bDbAEc757D77", // LINK/ETH
functionsRouter: "0x1e531A9635741Ee668114E5EeF039aC086265d5e",
donId: "fun-arbitrum-sepolia-1",
gatewayUrls: [
"https://01.functions-gateway.testnet.chain.link/",
"https://02.functions-gateway.testnet.chain.link/",
],
},
// localFunctionsTestnet is updated dynamically by scripts/startLocalFunctionsTestnet.js so it should not be modified here
localFunctionsTestnet: {
url: "http://localhost:8545/",
Expand Down
4 changes: 1 addition & 3 deletions tasks/Functions-consumer/deployConsumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ task("functions-deploy-consumer", "Deploys the FunctionsConsumer contract")
}
}
} else if (verifyContract && network.name !== "localFunctionsTestnet") {
console.log(
"\nPOLYGONSCAN_API_KEY, ETHERSCAN_API_KEY or FUJI_SNOWTRACE_API_KEY is missing. Skipping contract verification..."
)
console.log("\nScanner API key is missing. Skipping contract verification...")
}

console.log(`\nFunctionsConsumer contract deployed to ${consumerContract.address} on ${network.name}`)
Expand Down
8 changes: 2 additions & 6 deletions tasks/Functions-consumer/readResultAndError.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@ task(
const requestConfig = require(path.isAbsolute(taskArgs.configpath)
? taskArgs.configpath
: path.join(process.cwd(), taskArgs.configpath))
console.log(
`\nOn-chain response represented as a hex string: ${latestResponse}\n${decodeResult(
latestResponse,
requestConfig.expectedReturnType
).toString()}`
)
const decodedResult = decodeResult(latestResponse, requestConfig.expectedReturnType).toString()
console.log(`\nOn-chain response represented as a hex string: ${latestResponse}\n${decodedResult}`)
} else if (latestResponse == "0x") {
console.log("Empty response: ", latestResponse)
}
Expand Down
2 changes: 2 additions & 0 deletions tasks/utils/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const BASE_URLS = {
80001: "https://mumbai.polygonscan.com/",
11155111: "https://sepolia.etherscan.io/",
43113: "https://testnet.snowtrace.io/",
421614: "https://sepolia.arbiscan.io/",
42161: "https://arbiscan.io/",
}

/**
Expand Down

0 comments on commit f5950ce

Please sign in to comment.