Skip to content

Commit 0a20ec1

Browse files
authored
Celo (#221)
* Celo Alfajores & Mainnet * Update README.md * Update scanner key names
1 parent dbb46f0 commit 0a20ec1

File tree

5 files changed

+72
-17
lines changed

5 files changed

+72
-17
lines changed

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- [Tutorials \& examples](#tutorials--examples)
1111
- [Quickstart](#quickstart)
1212
- [Requirements](#requirements)
13-
- [Steps on live testnet](#steps-on-live-testnet)
13+
- [Steps on Live (Public) Testnets](#steps-on-live-public-testnets)
1414
- [Steps on local testnet](#steps-on-local-testnet)
1515
- [Environment Variable Management](#environment-variable-management)
1616
- [Using Remote Secrets (e.g. Github Gists)](#using-remote-secrets-eg-github-gists)
@@ -49,22 +49,26 @@ In order to set up your own project which uses Chainlink Functions, please refer
4949
## Supported Networks
5050

5151
> ⚠️⚠️⚠️
52-
> As at 13 April 2024, Mumbai (anchored to Goerli) stopped producing blocks. Mumbai's deprecation had been announced in favour of a new Amoy testnet, anchored to Sepolia.
53-
> Amoy support is coming soon, and in the meanwhile we recommend you use the Ethereum Sepolia testnet or the Avalanche Fuji testnet for Functions related projects. Please refer to docs.chain.link to find the latest information on networks that support Chainlink services.
52+
> As at 13 April 2024, Mumbai (anchored to Goerli) stopped producing blocks. Mumbai's deprecation had been announced in favour of a new Amoy testnet, anchored to Sepolia.
5453
5554
### Mainnets
5655

57-
- Ethereum : `ETHEREUM_RPC_URL`, `--network ethereum`
58-
- Polygon : `POLYGON_RPC_URL`, `--network polygon`
59-
- Avalanche : `AVALANCHE_RPC_URL`, `--network avalanche`
60-
- Arbitrum : `ARBITRUM_RPC_URL`, `--network arbitrum`
56+
- Ethereum : `ETHEREUM_RPC_URL`, `--network ethereum`, `ETHERSCAN_API_KEY`
57+
- Polygon : `POLYGON_RPC_URL`, `--network polygon`, `POLYGONSCAN_API_KEY`
58+
- Avalanche : `AVALANCHE_RPC_URL`, `--network avalanche`, `SNOWTRACE_API_KEY`
59+
- Arbitrum : `ARBITRUM_RPC_URL`, `--network arbitrum`, `ARBISCAN_API_KEY`
60+
- Base : `BASE_RPC_URL`, `--network base`, `BASESCAN_API_KEY`
61+
- Celo : `CELO_RPC_URL`, `--network celo`, `CELOSCAN_API_KEY`
6162

6263
### Testnets
6364

64-
- Ethereum Sepolia: `ETHEREUM_SEPOLIA_RPC_URL`, `--network ethereumSepolia`
65-
- Polygon Mumbai: `POLYGON_MUMBAI_RPC_URL`, `--network polygonMumbai`
66-
- Avalanche Fuji: `AVALANCHE_FUJI_RPC_URL`, `--network avalancheFuji`
67-
- Arbitrum Sepolia: `ARBITRUM_SEPOLIA_RPC_URL`, `--network arbitrumSepolia`
65+
- Ethereum Sepolia: `ETHEREUM_SEPOLIA_RPC_URL`, `--network ethereumSepolia`, `ETHERSCAN_API_KEY`
66+
- Polygon Amoy: `POLYGON_AMOY_RPC_URL`, `--network polygonAmoy`, `POLYGONSCAN_API_KEY`
67+
- Avalanche Fuji: `AVALANCHE_FUJI_RPC_URL`, `--network avalancheFuji`, `SNOWTRACE_API_KEY`
68+
- Arbitrum Sepolia: `ARBITRUM_SEPOLIA_RPC_URL`, `--network arbitrumSepolia`, `ARBISCAN_API_KEY`
69+
- Base Sepolia: `BASE_SEPOLIA_RPC_URL`, `--network baseSepolia`, `BASESCAN_API_KEY`
70+
- Optimism Sepolia: `OPTIMISM_SEPOLIA_RPC_URL`, `--network optimismSepolia`, `OP_ETHERSCAN_API_KEY`
71+
- Celo Alfajores: `CELO_ALFAJORES_RPC_URL`, `--network celoAlfajores`, `CELOSCAN_API_KEY`
6872

6973
## For Beginners
7074

@@ -94,7 +98,7 @@ Install **both** of the following:
9498
1. Clone this repository to your local machine<br><br>. Also ensure that the testnet your wanting to deploy on is [supported](https://docs.chain.link/chainlink-functions/supported-networks) by Chainlink Functions.
9599
2. Open this directory in your command line/terminal app, then run `npm install` to install all dependencies.<br><br>
96100
3. Obtain the values for following environment variables (examples only - please see `./env.enc.example` for env vars you may need):
97-
- `PRIVATE_KEY` for your development wallet - `POLYGON_MUMBAI_RPC_URL`, `ETHEREUM_SEPOLIA_RPC_URL`, or `AVALANCHE_FUJI_RPC_URL`
101+
- `PRIVATE_KEY` for your development wallet - `POLYGON_AMOY_RPC_URL`, `ETHEREUM_SEPOLIA_RPC_URL`, or `AVALANCHE_FUJI_RPC_URL`
98102
- `POLYGONSCAN_API_KEY`, `ETHERSCAN_API_KEY`, or `FUJI_SNOWTRACE_API_KEY` blockchain explore API keys depending on which network you're using
99103
- `COINMARKETCAP_API_KEY` (from [here](https://pro.coinmarketcap.com/))
100104
<br><br>

hardhat.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ module.exports = {
5757
optimismSepolia: networks.optimismSepolia.verifyApiKey,
5858
base: networks.base.verifyApiKey,
5959
optimism: networks.optimism.verifyApiKey,
60+
celoAlfajores: networks.celoAlfajores.verifyApiKey,
61+
celo: networks.celo.verifyApiKey,
6062
},
6163
customChains: [
6264
{
@@ -107,6 +109,22 @@ module.exports = {
107109
browserURL: "https://optimistic.etherscan.io/",
108110
},
109111
},
112+
{
113+
celoAlfajores: "celoAlfajores",
114+
chainId: 44787,
115+
urls: {
116+
apiURL: "https://alfajores.celoscan.io/api",
117+
browserURL: "https://alfajores.celoscan.io",
118+
},
119+
},
120+
{
121+
celoAlfajores: "celo",
122+
chainId: 42220,
123+
urls: {
124+
apiURL: "https://celoscan.io/api",
125+
browserURL: "https://celoscan.io",
126+
},
127+
},
110128
],
111129
},
112130
gasReporter: {

networks.js

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const networks = {
101101
gasPrice: undefined,
102102
nonce: undefined,
103103
accounts,
104-
verifyApiKey: process.env.FUJI_SNOWTRACE_API_KEY || "UNSET",
104+
verifyApiKey: process.env.SNOWTRACE_API_KEY || "UNSET",
105105
chainId: 43113,
106106
confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
107107
nativeCurrencySymbol: "AVAX",
@@ -224,7 +224,7 @@ const networks = {
224224
gasPrice: undefined,
225225
nonce: undefined,
226226
accounts,
227-
verifyApiKey: process.env.OPTISCAN_API_KEY || "UNSET",
227+
verifyApiKey: process.env.OP_ETHERSCAN_API_KEY || "UNSET",
228228
chainId: 10,
229229
confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
230230
nativeCurrencySymbol: "ETH",
@@ -234,6 +234,39 @@ const networks = {
234234
donId: "fun-optimism-mainnet-1",
235235
gatewayUrls: ["https://01.functions-gateway.chain.link/", "https://02.functions-gateway.chain.link/"],
236236
},
237+
celoAlfajores: {
238+
url: process.env.CELO_ALFAJORES_RPC_URL || "UNSET",
239+
gasPrice: undefined,
240+
nonce: undefined,
241+
accounts,
242+
verifyApiKey: process.env.CELOSCAN_API_KEY || "UNSET",
243+
chainId: 44787,
244+
confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
245+
nativeCurrencySymbol: "ETH",
246+
linkToken: "0x32e08557b14fad8908025619797221281d439071",
247+
linkPriceFeed: "0xeA11fA4307B8BD6D6074Cf1c0caAc9790cf96857", // LINK/CELO
248+
functionsRouter: "0x53BA5D8E5aab0cf9589aCE139666Be2b9Fd268e2",
249+
donId: "fun-celo-alfajores-1",
250+
gatewayUrls: [
251+
"https://01.functions-gateway.testnet.chain.link/",
252+
"https://02.functions-gateway.testnet.chain.link/",
253+
],
254+
},
255+
celo: {
256+
url: process.env.CELO_RPC_URL || "UNSET",
257+
gasPrice: undefined,
258+
nonce: undefined,
259+
accounts,
260+
verifyApiKey: process.env.CELOSCAN_API_KEY || "UNSET",
261+
chainId: 42220,
262+
confirmations: DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS,
263+
nativeCurrencySymbol: "ETH",
264+
linkToken: "0xd07294e6E917e07dfDcee882dd1e2565085C2ae0",
265+
linkPriceFeed: "0xBa45f0a1a2fa3FB62a4D6dC135741E2aeb1b14e7", // LINK/CELO
266+
functionsRouter: "0xd74646C75163f9dA0F3666C3BE8A9C42F4b3b261",
267+
donId: "fun-celo-mainnet-1",
268+
gatewayUrls: ["https://01.functions-gateway.chain.link/", "https://02.functions-gateway.chain.link/"],
269+
},
237270
// localFunctionsTestnet is updated dynamically by scripts/startLocalFunctionsTestnet.js so it should not be modified here
238271
localFunctionsTestnet: {
239272
url: "http://localhost:8545/",

tasks/Functions-consumer/deployAutoConsumer.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ task("functions-deploy-auto-consumer", "Deploys the AutomatedFunctionsConsumer c
6666
}
6767
}
6868
} else if (verifyContract && network.name !== "localFunctionsTestnet") {
69-
console.log(
70-
"\nPOLYGONSCAN_API_KEY, ETHERSCAN_API_KEY or FUJI_SNOWTRACE_API_KEY is missing. Skipping contract verification..."
71-
)
69+
console.log("\nBlockchain explorer API key is missing. Skipping contract verification...")
7270
}
7371

7472
console.log(`\nAutomatedFunctionsConsumer contract deployed to ${consumerAddress} on ${network.name}`)

tasks/utils/network.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const BASE_URLS = {
1111
11155420: "https://sepolia-optimistic.etherscan.io/",
1212
8453: "https://basescan.org/",
1313
10: "https://optimistic.etherscan.io/",
14+
44787: "https://alfajores.celoscan.io/",
15+
42220: "https://celoscan.io/",
1416
}
1517

1618
/**

0 commit comments

Comments
 (0)