diff --git a/hardhat.config.js b/hardhat.config.js index 8947b315..63619ed2 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -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: { diff --git a/networks.js b/networks.js index b1c11a33..1d967885 100644 --- a/networks.js +++ b/networks.js @@ -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/", diff --git a/tasks/Functions-consumer/deployConsumer.js b/tasks/Functions-consumer/deployConsumer.js index 709792de..71673642 100644 --- a/tasks/Functions-consumer/deployConsumer.js +++ b/tasks/Functions-consumer/deployConsumer.js @@ -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}`) diff --git a/tasks/Functions-consumer/readResultAndError.js b/tasks/Functions-consumer/readResultAndError.js index d2e16d34..4aa17c4b 100644 --- a/tasks/Functions-consumer/readResultAndError.js +++ b/tasks/Functions-consumer/readResultAndError.js @@ -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) } diff --git a/tasks/utils/network.js b/tasks/utils/network.js index 40fe2127..45ee29b7 100644 --- a/tasks/utils/network.js +++ b/tasks/utils/network.js @@ -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/", } /**