Skip to content

Commit 83d45ae

Browse files
Merge pull request #86 from gr-akshaya/akshaya/chainlink-ccip-guide
chainlink CCIP Guide
2 parents 69f0a5a + 69eb35a commit 83d45ae

2 files changed

Lines changed: 283 additions & 0 deletions

File tree

Lines changed: 282 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,282 @@
1+
---
2+
sidebar_label: Chainlink CCIP Guide
3+
hide_table_of_contents: false
4+
sidebar_position: 2
5+
---
6+
7+
import Tabs from '@theme/Tabs';
8+
import TabItem from '@theme/TabItem';
9+
10+
11+
# Chainlink CCIP Cross-Chain Token Deployment on Core
12+
13+
---
14+
15+
This guide walks you through deploying cross-chain tokens using **Chainlink CCIP** on the **Core** (Testnet or Mainnet). It adapts the official Chainlink Hardhat tutorial for Core-specific configurations.
16+
17+
> Based on: [Chainlink CCIP EVM Tutorial (Burn & Mint from EOA)](https://docs.chain.link/ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-burn-mint-hardhat#tutorial)
18+
19+
20+
## What is Chainlink CCIP?
21+
22+
**Chainlink CCIP (Cross-Chain Interoperability Protocol)** enables secure token and data transfers across different blockchains using a unified interface.
23+
24+
### Key Features
25+
- Secure cross-chain messaging and token transfers
26+
- Programmable token logic
27+
- Decentralized infrastructure via Chainlink nodes
28+
- Built-in rate limiting and failover protections
29+
30+
[Read more about CCIP →](https://docs.chain.link/ccip)
31+
32+
33+
## Core Blockchain CCIP Network Details
34+
35+
Use the tabs below to toggle between **Testnet** and **Mainnet** configurations:
36+
37+
<Tabs defaultValue="testnet2" values={[
38+
{label: 'Testnet', value: 'testnet2'},
39+
{label: 'Mainnet', value: 'mainnet'},
40+
]}>
41+
42+
<TabItem value="testnet2">
43+
44+
| Parameter | Value |
45+
|-----------|-------|
46+
| **Chain Name** | Core Testnet |
47+
| **Chain ID** | 1114 |
48+
| **Chain Selector** | `4264732132125536123` |
49+
| **Router** | [0xded0EE188Fe8F1706D9049e29C82081A5ebEcb2F](https://scan.test2.btcs.network/0xded0EE188Fe8F1706D9049e29C82081A5ebEcb2F) |
50+
| **RMN Proxy** | [0xF39a1260F4E3345D810e1b8aA569200e1D27A998](https://scan.test2.btcs.network/0xF39a1260F4E3345D810e1b8aA569200e1D27A998) |
51+
| **Token Admin Registry** | [0x2c99403fDB26F654c410D81264033faE289fa7Ea](https://scan.test2.btcs.network/0x2c99403fDB26F654c410D81264033faE289fa7Ea) |
52+
| **Registry Module Owner** | [0xfaE626f209B036B03D18d4f16ad3D599f90AF22c](https://scan.test2.btcs.network/0xfaE626f209B036B03D18d4f16ad3D599f90AF22c) |
53+
| **RPC URL** | https://rpc.test2.btcs.network |
54+
55+
56+
Fee Tokens
57+
58+
| Token | Address |
59+
|-------|---------|
60+
| **LINK** | [0x6C475841d1D7871940E93579E5DBaE01634e17aA](https://scan.test2.btcs.network/0x6C475841d1D7871940E93579E5DBaE01634e17aA) |
61+
| **WCORE** | [0x7Ce54aE289e480cbDfd32e531F75947CFA3d1aC3d](https://scan.test2.btcs.network/0x7Ce54aE289e480cbDfd32e531F75947CFA3d1aC3d) |
62+
| **tCORE2** | Native Gas Token |
63+
64+
:::note
65+
Refer to the [CCIP Directory for Core](https://docs.chain.link/ccip/directory/testnet/chain/core-testnet) for latest data.
66+
:::
67+
68+
</TabItem>
69+
70+
<TabItem value="mainnet">
71+
72+
| Parameter | Value |
73+
|-----------|-------|
74+
| **Chain Name** | Core Mainnet |
75+
| **Chain ID** | 1116 |
76+
| **Chain Selector** | `1224752112135636129` |
77+
| **Router** | [0x3902228D6A3d2Dc44731fD9d45FeE6a61c722D0b](https://scan.coredao.org/address/0x3902228D6A3d2Dc44731fD9d45FeE6a61c722D0b) |
78+
| **RMN Proxy** |[0x1e9B034c67B6eA4cB819aA8BE4E84cff2d5417fb](https://scan.coredao.org/address/0x1e9B034c67B6eA4cB819aA8BE4E84cff2d5417fb) |
79+
| **Token Admin Registry** | [0x4D2B43c60f3e476Ee94637C4e3be844FC9a70012](https://scan.coredao.org/address/0x4D2B43c60f3e476Ee94637C4e3be844FC9a70012) |
80+
| **Registry Module Owner** | [0x6d10fF9a987d3C05e373cCbcb17f38287318c50e](https://scan.coredao.org/address/0x6d10fF9a987d3C05e373cCbcb17f38287318c50e) |
81+
| **RPC URL** | https://rpc.coredao.org |
82+
83+
84+
Fee Tokens
85+
86+
| Token | Address |
87+
|-------|---------|
88+
| **LINK** | [0x3902228D6A3d2Dc44731fD9d45FeE6a61c722D0b](https://scan.coredao.org/address/0x3902228D6A3d2Dc44731fD9d45FeE6a61c722D0b) |
89+
| **WCORE** | [0x40375C92d9FAf44d2f9db9Bd9ba41a3317a2404f](https://scan.coredao.org/address/0x40375C92d9FAf44d2f9db9Bd9ba41a3317a2404f) |
90+
| **CORE** | Native Gas Token |
91+
92+
:::note
93+
Refer to the [CCIP Directory for Core](https://docs.chain.link/ccip/directory/mainnet/chain/core-mainnet) for latest data.
94+
:::
95+
96+
</TabItem>
97+
</Tabs>
98+
99+
100+
101+
## Project Configuration for Core Blockchain
102+
103+
To integrate **Core Testnet/Mainnet** with the official Chainlink Hardhat setup, follow these steps:
104+
105+
### Prerequisites
106+
107+
- **Node.js**: Version 18 or higher
108+
- **Git**: For cloning the repository
109+
110+
### 1. Clone and Setup
111+
112+
```bash
113+
git clone https://github.com/smartcontractkit/smart-contract-examples.git
114+
cd smart-contract-examples/ccip/cct/hardhat
115+
```
116+
117+
### 2. Install Dependencies
118+
119+
```bash
120+
npm install
121+
npm run compile
122+
```
123+
124+
### 3. Environment Variables Setup
125+
126+
Set an encryption password for your environment variables:
127+
128+
```bash
129+
npx env-enc set-pw
130+
```
131+
132+
Set up a `.env.enc` file with the necessary variables for Core Testnet. Use the following command to add the variables:
133+
134+
```bash
135+
npx env-enc set
136+
```
137+
138+
**Required Environment Variables:**
139+
140+
```
141+
CORETESTNET_RPC_URL= "https://rpc.test2.btcs.network"
142+
PRIVATE_KEY= Your wallet private key
143+
CORESCAN_TESTNET_API_KEY= CoreScan API key for contract verification
144+
```
145+
146+
:::info
147+
**Security Note**: Never commit your `.env.enc` file or private keys to version control.
148+
:::
149+
150+
151+
### 4. `config.json`
152+
153+
Update your `ccip/cct/hardhat/config/config.json` to include Core network configurations:
154+
155+
```jsonc
156+
"coreTestnet2": {
157+
"chainId": 1114,
158+
"chainSelector": "4264732132125536123",
159+
"router": "0xded0EE188Fe8F1706D9049e29C82081A5ebEcb2F",
160+
"rmnProxy": "0xF39a1260F4E3345D810e1b8aA569200e1D27A998",
161+
"tokenAdminRegistry": "0x2c99403fDB26F654c410D81264033faE289fa7Ea",
162+
"registryModuleOwnerCustom": "0xfaE626f209B036B03D18d4f16ad3D599f90AF22c",
163+
"link": "0x6C475841d1D7871940E93579E5DBaE01634e17aA",
164+
"confirmations": 1,
165+
"nativeCurrencySymbol": "CORE",
166+
"chainType": "evm"
167+
}
168+
```
169+
170+
For **Core Mainnet**, add a similar configuration with the appropriate [mainnet](https://docs.chain.link/ccip/directory/mainnet/chain/core-mainnet) values.
171+
172+
### 5. `network.ts`
173+
174+
Update your `config/network.ts` file with the following Core network configurations:
175+
176+
#### 5.1 Network Configurations
177+
178+
Add these entries alongside the existing network configurations:
179+
180+
**Core Testnet Configuration:**
181+
```ts
182+
[EVMChains.coreTestnet2]: {
183+
...configData.coreTestnet2,
184+
url: process.env.CORE_TESTNET2_RPC_URL || "https://rpc.test2.btcs.network",
185+
chainType: "evm" as const,
186+
gasPrice: undefined,
187+
nonce: undefined,
188+
accounts,
189+
},
190+
```
191+
192+
**Core Mainnet Configuration:**
193+
```ts
194+
[EVMChains.coreMainnet]: {
195+
...configData.coreMainnet,
196+
url: process.env.CORE_MAINNET_RPC_URL || "https://rpc.coredao.org",
197+
chainType: "evm" as const,
198+
gasPrice: undefined,
199+
nonce: undefined,
200+
accounts,
201+
},
202+
```
203+
204+
#### 5.2 Etherscan API Keys
205+
206+
Add CoreScan API key support for contract verification:
207+
208+
```ts
209+
[EVMChains.coreTestnet2]: process.env.CORESCAN_TESTNET_API_KEY || "UNSET",
210+
[EVMChains.coreMainnet]: process.env.CORESCAN_MAINNET_API_KEY || "UNSET",
211+
```
212+
213+
#### 5.3 Custom Chain Configuration
214+
215+
Add Core network configurations to your custom chains array:
216+
217+
```ts
218+
{
219+
network: EVMChains.coreTestnet2,
220+
chainId: configData.coreTestnet2.chainId,
221+
urls: {
222+
apiURL: "https://api.test2.btcs.network/api",
223+
browserURL: "https://scan.test2.btcs.network/",
224+
},
225+
},
226+
{
227+
network: EVMChains.coreMainnet,
228+
chainId: configData.coreMainnet.chainId,
229+
urls: {
230+
apiURL: "https://openapi.coredao.org/api",
231+
browserURL: "https://scan.coredao.org",
232+
},
233+
},
234+
```
235+
236+
:::info
237+
**Note**: All these configurations should be added to your existing `config/network.ts` file alongside the other supported networks.
238+
:::
239+
240+
### 6. `types.ts`
241+
242+
Add the Core chain identifiers to your existing `EVMChains` enum. Simply append these two entries to the existing enum:
243+
244+
```ts
245+
export enum EVMChains {
246+
avalancheFuji = "avalancheFuji",
247+
arbitrumSepolia = "arbitrumSepolia",
248+
sepolia = "sepolia",
249+
baseSepolia = "baseSepolia",
250+
polygonAmoy = "polygonAmoy",
251+
// Add these Core network entries:
252+
coreTestnet2 = "coreTestnet2",
253+
coreMainnet = "coreMainnet"
254+
}
255+
```
256+
257+
:::info
258+
**Note**: Just append `coreTestnet2` and `coreMainnet` to your existing `EVMChains` enum. No need to modify the existing entries.
259+
:::
260+
261+
262+
263+
## Deployment
264+
265+
Once all configurations are updated:
266+
267+
1. Follow the [official Chainlink CCIP tutorial](https://docs.chain.link/ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-burn-mint-hardhat#tutorial).
268+
2. Use `coreTestnet2` or `coreMainnet` as your selected network when deploying tokens.
269+
3. Be sure to fund your LINK and native token balances.
270+
271+
You're now ready to build and deploy cross-chain tokens on the Core Blockchain using Chainlink CCIP.
272+
273+
## Resources
274+
275+
- [Chainlink CCIP Overview](https://docs.chain.link/ccip)
276+
- [CCIP Directory for Core Testnet](https://docs.chain.link/ccip/directory/testnet/chain/core-testnet)
277+
- [CCIP Directory for Core Mainnet](https://docs.chain.link/ccip/directory/mainnet/chain/core-mainnet)
278+
- [Chainlink Hardhat Examples Repo](https://github.com/smartcontractkit/smart-contract-examples/tree/main/ccip/cct/hardhat)
279+
- [Chainlink CCIP EVM Tutorial](https://docs.chain.link/ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-burn-mint-hardhat#tutorial)
280+
281+
282+

sidebars.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ const sidebars: SidebarsConfig = {
240240
label: "Bridging with Core",
241241
items: [
242242
"Dev-Guide/bridge-with-layerzero",
243+
"Dev-Guide/core-ccip-cross-chain-guide",
243244
"Dev-Guide/core-bridge-resources",
244245
"Dev-Guide/thirdweb-universal-bridge"
245246
],

0 commit comments

Comments
 (0)