diff --git a/hardhat.config.js b/hardhat.config.js index 75ca6efc..3f361aff 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -50,6 +50,7 @@ module.exports = { polygon: networks.polygon.verifyApiKey, sepolia: networks.ethereumSepolia.verifyApiKey, polygonMumbai: networks.polygonMumbai.verifyApiKey, + polygonAmoy: networks.polygonAmoy.verifyApiKey, avalancheFujiTestnet: networks.avalancheFuji.verifyApiKey, arbitrum: networks.arbitrum.verifyApiKey, arbitrumSepolia: networks.arbitrumSepolia.verifyApiKey, @@ -81,6 +82,14 @@ module.exports = { browserURL: "https://sepolia-optimistic.etherscan.io/", }, }, + { + network: "polygonAmoy", + chainId: 80002, + urls: { + apiURL: "https://api-amoy.polygonscan.com/api", + browserURL: "https://amoy.polygonscan.com", + }, + }, ], }, gasReporter: { diff --git a/networks.js b/networks.js index c7a73876..660f2dd9 100644 --- a/networks.js +++ b/networks.js @@ -203,6 +203,25 @@ const networks = { "https://02.functions-gateway.testnet.chain.link/", ], }, + polygonAmoy: { + url: process.env.AMOY_RPC_URL || "UNSET", // h + gasPrice: undefined, + nonce: undefined, + accounts, + verifyApiKey: process.env.POLYGONSCAN_API_KEY || "UNSET", + chainId: 80002, + confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS, + nativeCurrencySymbol: "MATIC", + linkToken: "0x0Fd9e8d3aF1aaee056EB9e802c3A762a667b1904", + linkPriceFeed: "0x408D97c89c141e60872C0835e18Dd1E670CD8781", // LINK/MATIC + + functionsRouter: "0xC22a79eBA640940ABB6dF0f7982cc119578E11De", + donId: "fun-polygon-amoy-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/package-lock.json b/package-lock.json index 74be01f3..73babd51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,9 +9,9 @@ "version": "0.2.0", "license": "MIT", "dependencies": { - "@chainlink/contracts": "^1.0.0", + "@chainlink/contracts": "^1.1.0-beta.0", "@chainlink/env-enc": "^1.0.5", - "@chainlink/functions-toolkit": "^0.2.7", + "@chainlink/functions-toolkit": "^0.2.8", "@ethersproject/abi": "^5.7.0", "@ethersproject/providers": "^5.7.1", "@nomicfoundation/hardhat-chai-matchers": "^1.0.3", @@ -86,9 +86,9 @@ } }, "node_modules/@chainlink/contracts": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@chainlink/contracts/-/contracts-1.0.0.tgz", - "integrity": "sha512-d7VEOewoZRR0U7SQq7837g77b0tLwNjIJo5FZ5ZFi9yJp03x73tqXpvdFZvb8sTod7OqV5wC72CDts+uHKKrYg==", + "version": "1.1.0-beta.0", + "resolved": "https://registry.npmjs.org/@chainlink/contracts/-/contracts-1.1.0-beta.0.tgz", + "integrity": "sha512-+GEsneNtWdHE85+DF9tdrfX3RimPMQnFDd08iwqEEvu95v7NiGBFqIzb5bfZ96A9mkzFP993h702DCaG3niQaA==", "dependencies": { "@changesets/changelog-github": "^0.4.8", "@changesets/cli": "~2.26.2", @@ -96,7 +96,7 @@ "@openzeppelin/contracts": "4.9.3", "@openzeppelin/contracts-upgradeable": "4.9.3", "@scroll-tech/contracts": "0.1.0", - "semver": "^7.5.4" + "semver": "^7.6.0" } }, "node_modules/@chainlink/contracts/node_modules/lru-cache": { @@ -141,9 +141,9 @@ } }, "node_modules/@chainlink/functions-toolkit": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/@chainlink/functions-toolkit/-/functions-toolkit-0.2.7.tgz", - "integrity": "sha512-V4x7X0932LaOYX89rOL9VXCu35HtxnK0O7HfrIuXemLA5XiRfTSaGyTKVEk0jWpz8a6EvimTXAAad3qdErl5hQ==", + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/@chainlink/functions-toolkit/-/functions-toolkit-0.2.8.tgz", + "integrity": "sha512-n7WicB5N9m1jZAu5p8Bh66oMVRc04L0usrr7dbuHl8ONybzraEDWc6fopXJKKyF529NEGr4B4c9nYcD5ZZt0Dw==", "dependencies": { "axios": "^1.4.0", "bcrypto": "^5.4.0", diff --git a/package.json b/package.json index 95b04ff6..bd909e8f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "functions-hardhat-starter-kit", "license": "MIT", - "version": "0.2.0", + "version": "0.2.1", "description": "Tooling for interacting with Chainlink Functions", "scripts": { "prepare": "husky install", @@ -18,9 +18,9 @@ "format:fix": "prettier --write ." }, "dependencies": { - "@chainlink/contracts": "^1.0.0", + "@chainlink/contracts": "^1.1.0-beta.0", "@chainlink/env-enc": "^1.0.5", - "@chainlink/functions-toolkit": "^0.2.7", + "@chainlink/functions-toolkit": "^0.2.8", "@ethersproject/abi": "^5.7.0", "@ethersproject/providers": "^5.7.1", "@nomicfoundation/hardhat-chai-matchers": "^1.0.3", diff --git a/tasks/utils/network.js b/tasks/utils/network.js index 43faacac..9a423486 100644 --- a/tasks/utils/network.js +++ b/tasks/utils/network.js @@ -3,6 +3,7 @@ const BASE_URLS = { 137: "https://polygonscan.com/", 43114: "https://snowtrace.io/", 80001: "https://mumbai.polygonscan.com/", + 80002: "https://api-amoy.polygonscan.com/api", 11155111: "https://sepolia.etherscan.io/", 43113: "https://testnet.snowtrace.io/", 421614: "https://sepolia.arbiscan.io/",