You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello devs 🌱 this is a migration path away from contractkit following the [public deprecation notice](https://forum.celo.org/t/sunsetting-contractkit/5337/1) of contractkit. This aims to give examples to help you move to [ethers](https://docs.ethers.org/).
4
+
5
+
## Initialization
6
+
7
+
```diff
8
+
- import Web3 from "web3";
9
+
- import { newKitFromWeb3 } from "@celo/contractkit";
10
+
11
+
- const web3 = new Web3("https://alfajores-forno.celo-testnet.org");
12
+
- const kit = newKitFromWeb3(web3);
13
+
+ import { providers } from 'ethers'
14
+
+
15
+
+ const provider = new providers.JsonRpcProvider('https://alfajores-forno.celo-testnet.org')
16
+
```
17
+
18
+
## Basic usage
19
+
20
+
While we cannot here show all the use-cases of contrackit or ethers or viem, let's try to give an overview of how they can be used for different goals.
I'll show the most "basic" interaction, which is a transfer. On CELO, it comes with a twist, you can transfer 4 currencies, CELO, cUSD, cEUR, and cREAL.
62
+
63
+
You can get the addresses on these tokens by heading to the explorer and getting their abi and addresses, or you can also use our [registry contract](https://docs.celo.org/developer/contractkit/contracts-wrappers-registry).
For more in depth examples, I highly recommend checking out the extensive documentations of both [ethers](https://docs.ethers.org/) and [viem](https://viem.sh/).
Hello devs 🌱 this is a migration path away from contractkit following the [public deprecation notice](https://forum.celo.org/t/sunsetting-contractkit/5337/1) of contractkit. This aims to give examples to help you move to either [ethers](https://docs.ethers.org/) or [viem](https://viem.sh/).
3
+
Hello devs 🌱 this is a migration path away from contractkit following the [public deprecation notice](https://forum.celo.org/t/sunsetting-contractkit/5337/1) of contractkit. This aims to give examples to help you move to [viem](https://viem.sh/).
4
4
5
5
## Initialization
6
6
7
-
With ethers:
8
-
9
-
```diff
10
-
- import Web3 from "web3";
11
-
- import { newKitFromWeb3 } from "@celo/contractkit";
12
-
13
-
- const web3 = new Web3("https://alfajores-forno.celo-testnet.org");
14
-
- const kit = newKitFromWeb3(web3);
15
-
+ import { providers } from 'ethers'
16
-
+
17
-
+ const provider = new providers.JsonRpcProvider('https://alfajores-forno.celo-testnet.org')
18
-
```
19
-
20
-
With viem:
21
-
22
7
```diff
23
8
- import Web3 from "web3";
24
9
- import { newKitFromWeb3 } from "@celo/contractkit";
@@ -40,14 +25,6 @@ While we cannot here show all the use-cases of contrackit or ethers or viem, let
> [viem does not currently support](<[source](https://viem.sh/docs/ethers-migration.html#viem-11)>) client-side signing (it's coming shortly!) – until then, you can use an Ethers Wallet
I'll show the most "basic" interaction, which is a CELO transfer:
74
+
I'll show the most "basic" interaction, which is a transfer. On CELO, it comes with a twist, you can transfer 4 currencies, CELO, cUSD, cEUR, and cREAL.
75
+
76
+
You can get the addresses on these tokens by heading to the explorer and getting their abi and addresses, or you can also use our [registry contract](https://docs.celo.org/developer/contractkit/contracts-wrappers-registry).
For more in depth examples, I highly recommend checking out the extensive documentations of both [ethers](https://docs.ethers.org/) and [viem](https://viem.sh/).
0 commit comments