diff --git a/README.md b/README.md index bbb0663..332e933 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,13 @@ and a single Celo transaction type. | Chain | Transaction type | # | Specification | Recommended | Support | Comment | |---|---|---|---|---|---|---| -| | Dynamic fee transaction v2 | `123` | [CIP-64](https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0064.md) | ✅ | Active 🟢 | Supports paying gas in custom fee currencies | -| | Dynamic fee transaction | `2` | [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) ([CIP-42](https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0042.md)) | ✅ | Active 🟢 | Typical Ethereum transaction | +| | Dynamic fee transaction | `123` | [CIP-64](https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0064.md) | ✅ | Active 🟢 | Supports paying gas in custom fee currencies | +| | Dynamic fee transaction | `2` | [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) | ✅ | Active 🟢 | Typical Ethereum transaction | | | Access list transaction | `1` | [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) ([CIP-35](https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0035.md)) | ❌ | Active 🟢 | Does not support dynamically changing _base fee_ per gas | | | Legacy transaction | `0` | [Ethereum Yellow Paper](https://ethereum.github.io/yellowpaper/paper.pdf) ([CIP-35](https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0035.md)) | ❌ | Active 🟢 | Does not support dynamically changing _base fee_ per gas | -### Scheduled for deprecation on Celo + +### Sunset Transaction types on Celo | Chain | Transaction type | # | Specification | Recommended | Support | Comment | |---|---|---|---|---|---|---| @@ -33,7 +34,7 @@ The stages of support are: - **Active support** 🟢: the transaction type is supported and recommended for use. - **Security support** 🟠: the transaction type is supported but not recommended for use because it might be deprecated in the future. -- **Deprecated** 🔴: the transaction type is not supported and not recommended for use. +- **Sunset** 🔴: the transaction type was supported in the past but will fail now. ### Client library support @@ -49,7 +50,8 @@ Legend: | [`viem`](https://www.npmjs.com/package/viem) | TS/JS | ✅ | | ✅ | >[1.19.5][1] | --- | | [`ethers`](https://www.npmjs.com/package/ethers) | TS/JS | ✅ | | ❌ | | [Discussion](https://github.com/ethers-io/ethers.js/issues/3747) with maintainer.
Currently only supported via
[`@celo-tools/celo-ethers-wrapper`](https://www.npmjs.com/package/@celo-tools/celo-ethers-wrapper) | | [`@celo-tools/celo-ethers-wrapper`](https://www.npmjs.com/package/@celo-tools/celo-ethers-wrapper) | TS/JS | ✅ | | ✅ | >[2.0.0](https://github.com/celo-tools/celo-ethers-wrapper/releases/tag/2.0.0) | --- | -| [`web3`](https://www.npmjs.com/package/web3) | TS/JS | ✅ | | ❌ | | Currently only supported via
[`@celo/contractkit`](https://www.npmjs.com/package/@celo/contractkit) | +| [`web3 v1`](https://www.npmjs.com/package/web3) | TS/JS | ✅ | | ❌ | | Only supported via
[`@celo/contractkit`](https://www.npmjs.com/package/@celo/contractkit) | +| [`web3 v4`](https://www.npmjs.com/package/web3) | TS/JS | ✅ | | ❌ | | Use [@celo/web3-plugin-transaction-types](https://github.com/celo-org/web3-plugin-transaction-types) | | [`@celo/contractkit`](https://www.npmjs.com/package/@celo/contractkit) | TS/JS | ✅ | | ✅ | >[5.0.0](https://github.com/celo-org/celo-monorepo/releases/tag/v5.0) | --- | | [`Web3j`](https://docs.web3j.io/) | Java | ✅ | | ❌ | | --- | | `rust-ethers` | Rust | ✅ | | ❌ | | --- | @@ -203,7 +205,7 @@ they are commonly referred to as "type 0" transactions. > parameters: `feecurrency`, `gatewayfeerecipient`, and `gatewayfee`. > **Warning** -> This transaction type is scheduled for deprecation. A deprecation warning was published in the +> This transaction type has been sunset. A deprecation warning was published in the > [Gingerbread hard fork](https://github.com/celo-org/celo-proposals/blob/8260b49b2ec9a87ded6727fec7d9104586eb0752/CIPs/cip-0062.md#deprecation-warning) > on [Sep 26, 2023](https://forum.celo.org/t/mainnet-alfajores-gingerbread-hard-fork-release-sep-26-17-00-utc/6499). @@ -224,7 +226,7 @@ they are commonly referred to as "type 0" transactions. > parameters: `feecurrency`, `gatewayfeerecipient`, and `gatewayfee`. > **Warning** -> This transaction type is scheduled for deprecation. A deprecation warning was published in the +> This transaction type has been sunset. Do not use. A deprecation warning was published in the > [Gingerbread hard fork](https://github.com/celo-org/celo-proposals/blob/8260b49b2ec9a87ded6727fec7d9104586eb0752/CIPs/cip-0062.md#deprecation-warning) > on [Sep 26, 2023](https://forum.celo.org/t/mainnet-alfajores-gingerbread-hard-fork-release-sep-26-17-00-utc/6499). diff --git a/demo.ts b/demo.ts index 8e7db23..ffbaf91 100644 --- a/demo.ts +++ b/demo.ts @@ -1,7 +1,6 @@ import { createPublicClient, createWalletClient, - hexToBigInt, http, parseEther, parseGwei, @@ -40,7 +39,7 @@ async function demoLegacyTransactionType() { }); const transactionReceipt = await publicClient.waitForTransactionReceipt({ - hash: await transactionHash, + hash: transactionHash, }); printFormattedTransactionReceipt(transactionReceipt); @@ -62,7 +61,7 @@ async function demoDynamicFeeTransactionType() { }); const transactionReceipt = await publicClient.waitForTransactionReceipt({ - hash: await transactionHash, + hash: transactionHash, }); printFormattedTransactionReceipt(transactionReceipt); @@ -80,17 +79,41 @@ async function demoFeeCurrencyTransactionType() { to: "0x70997970c51812dc3a010c7d01b50e0d17dc79c8", // Recipient (illustrative address) value: parseEther("0.01"), // 0.01 CELO feeCurrency: "0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1", // cUSD fee currency - maxFeePerGas: parseGwei("10"), // Special field for dynamic fee transaction type (EIP-1559) - maxPriorityFeePerGas: parseGwei("10"), // Special field for dynamic fee transaction type (EIP-1559) + maxFeePerGas: parseGwei("10"), // Denominated in the token the fee is paid in + maxPriorityFeePerGas: parseGwei("10"), // Denominated in the token the fee is paid in }); const transactionReceipt = await publicClient.waitForTransactionReceipt({ - hash: await transactionHash, + hash: transactionHash, }); printFormattedTransactionReceipt(transactionReceipt); } +// /** +// * Transaction type: 122 (0x7a) +// * Name: "Celo Denominated Easy Fee Transaction" +// * Description: Celo dynamic fee transaction (with custom fee currency) +// */ +// async function demoCeloDenominatedFeeCurrencyTransactionType() { +// console.log(`Initiating Celo denominated fee currency transaction...`); +// const transactionHash = await walletClient.sendTransaction({ +// account, // Sender +// to: "0x70997970c51812dc3a010c7d01b50e0d17dc79c8", // Recipient (illustrative address) +// value: parseEther("0.01"), // 0.01 CELO +// feeCurrency: "0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1", // cUSD fee currency +// maxFeePerGas: parseGwei("10"), // Denominated in CELO but paid in the fee currency +// maxPriorityFeePerGas: parseGwei("10"), // Denominated in CELO but paid in the fee currency +// maxFeeInFeeCurrency: parseGwei("10") // Calculated as maxFeePerGas * gasLimit * conversionRateFromCELOtoToken +// }); + +// const transactionReceipt = await publicClient.waitForTransactionReceipt({ +// hash: transactionHash, +// }); + +// printFormattedTransactionReceipt(transactionReceipt); +// } + function printFormattedTransactionReceipt(transactionReceipt: any) { const { @@ -124,7 +147,7 @@ function printFormattedTransactionReceipt(transactionReceipt: any) { console.log(`Transaction details:`, filteredTransactionReceipt, `\n`); } -// Wrap both demos in an async function to await their completion +// Wrap all demos in an async function to await their completion async function runDemosSequentially() { // Run each demo and await its completion await demoLegacyTransactionType();