diff --git a/docs/cel2/contract-addresses.md b/docs/cel2/contract-addresses.md new file mode 100644 index 0000000000..74d5877486 --- /dev/null +++ b/docs/cel2/contract-addresses.md @@ -0,0 +1,21 @@ +--- +title: Contract Addresses +--- + +## Holesky (L1) + +| Contract Name | Address | +| :-------------------------------: | :----------------------------------------: | +| L1CrossDomainMessenger | 0xd51013941d49631846fe52028C8D7a6EeBf06C98 | +| L1ERC721BridgeProxy | 0x856dD9501a509D3738aE2da7B79cDA1731d8E9b3 | +| L1StandardBridgeProxy | 0x9FEBd0F16b97e0AEF9151AF07106d733E87B1be4 | +| OptimismMintableERC20FactoryProxy | 0x95E7A21b705a971BDBC999295f4a3c04CDfC52F0 | +| OptimismPortalProxy | 0xB29597c6866c6C2870348f1035335B75eEf79d07 | +| ProxyAdmin | 0x02E65F11504e328A6DabB38b0D05854297466178 | +| SystemConfigProxy | 0x43cb8878b4B62D9853452140eFB42CF30672e23a | +| DisputeGameFactoryProxy | 0x831f39053688f05698ad0fB5f4DE7e56B2949c55 | +| AnchorStateRegistryProxy | 0xedf4ed5230f9B1F54C33F381C1990129f30E9196 | +| DelayedWETHProxy | 0xb9034e29a6e5c94ae50F4eDBf8450492Bf6f636C | +| Mips | 0xcc6342CfF04DE2Ed80C812470BFF54A7A7184fF8 | + +## Cel2 Dango Testnet(L2) diff --git a/docs/cel2/fee-currencies.md b/docs/cel2/fee-currencies.md index 39cb70fcea..8bd9793faf 100644 --- a/docs/cel2/fee-currencies.md +++ b/docs/cel2/fee-currencies.md @@ -1,8 +1,8 @@ --- -title: Fee Currencies on Cel2 +title: Fee Abstraction on Cel2 --- -## Fee Currency Addresses +## Fee Abstraction Addresses ### Get list of whitelisted Fee Currencies @@ -10,9 +10,9 @@ title: Fee Currencies on Cel2 celocli network:whitelist --node https://forno.dango.celo-testnet.org ``` -### Using Fee Currency +### Using Fee Abstraction -Transfer 1 USDC using USDC as Fee Currency +Transfer 1 USDC using USDC as fee currency ```bash celocli transfer:erc20 --erc20Address 0x2F25deB3848C207fc8E0c34035B3Ba7fC157602B --from 0x22ae7Cf4cD59773f058B685a7e6B7E0984C54966 --to 0xDF7d8B197EB130cF68809730b0D41999A830c4d7 --value 1000000 --gasCurrency 0x4822e58de6f5e485eF90df51C41CE01721331dC0 --privateKey [PRIVATE_KEY] diff --git a/docs/developer/build-on-minipay/overview.mdx b/docs/developer/build-on-minipay/overview.mdx index a2129d516a..441e098bf2 100644 --- a/docs/developer/build-on-minipay/overview.mdx +++ b/docs/developer/build-on-minipay/overview.mdx @@ -66,7 +66,6 @@ MiniPay is available inside Opera Mini on Android phones only. To ensure that yo alt="MiniPay dApp testing" /> - :::info One can also setup their project, using the MiniPay template available [here](https://github.com/celo-org/minipay-template) ::: @@ -90,7 +89,7 @@ This will provide you with a public URL that tunnels to your localhost. ### Get your dApp ready for MiniPay :::warning -MiniPay uses Custom Fee Currency based transactions, which is not supported by Ethers.js and web3.js. +MiniPay uses Custom Fee Abstraction based transactions, which is not supported by Ethers.js and web3.js. ::: #### 1. Viem diff --git a/docs/developer/fee-currency.md b/docs/developer/fee-currency.md index f080a94b69..6c33ab13c6 100644 --- a/docs/developer/fee-currency.md +++ b/docs/developer/fee-currency.md @@ -1,5 +1,5 @@ --- -title: Implementing Fee Currency in Wallets +title: Implementing Fee Abstraction in Wallets description: How to allow your wallet users to pay for gas fee using alternate fee currencies --- @@ -11,7 +11,7 @@ This works by specifying a token/adapter address as a value for the `feeCurrency The below steps describe how wallets can implement the alternate fee currency feature in order to allow users to use alternate assets in the user's wallet to pay for gas fees. -## Enabling Transactions with ERC20 Token as Fee Currency +## Enabling Transactions with ERC20 Token as fee currency We recommend using the [viem](https://viem.sh) library as it has support for the `feeCurrency` field in the transaction required for sending transaction where the gas fees will be paid in ERC20 tokens. @@ -83,7 +83,7 @@ async function main() { } ``` -### Sending transaction using alternate fee currency +### Sending transaction using Fee Abstraction Sending transaction with fee currency other than the native currency of the network is pretty straightforward all you need to do is set the `feeCurrency` property in the transaction object with the address of the token/adapter you want to use to pay for gas fees. diff --git a/docs/developer/viem/index.md b/docs/developer/viem/index.md index 6380d22446..adad303924 100644 --- a/docs/developer/viem/index.md +++ b/docs/developer/viem/index.md @@ -5,7 +5,7 @@ description: Using Viem with Celo ## Viem -Viem is full featured lightweight javascript library for interacting with EVM chains with *first class support for Celo*. +Viem is full featured lightweight javascript library for interacting with EVM chains with _first class support for Celo_. Viem is used by [Wagmi](https://wagmi.sh/) and [Rainbowkit](https://www.rainbowkit.com/). @@ -19,22 +19,21 @@ The TLDR is that passing a celo chain from `viem/chains` into the config of `cre // see viem docs for more info on setup // Create a wallet client that will sign the transaction - const client = createWalletClient({ - account, - // Passing chain is how viem knows to try serializing tx as cip42. - chain: celoAlfajores, - transport: http(), - }) - - client.writeContract({ - abi: ANY_CONTRACT_ABI, - address: ANY_CONTRACT_ABI_ADDRESS, - functionName: "contractMethod", - args: [to, parseEther(value)], - // set the fee currency on the contract write call - feeCurrency: FEE_CURRENCIES_ALFAJORES["cusd"] - }) - +const client = createWalletClient({ + account, + // Passing chain is how viem knows to try serializing tx as cip42. + chain: celoAlfajores, + transport: http(), +}); + +client.writeContract({ + abi: ANY_CONTRACT_ABI, + address: ANY_CONTRACT_ABI_ADDRESS, + functionName: "contractMethod", + args: [to, parseEther(value)], + // set the fee currency on the contract write call + feeCurrency: FEE_CURRENCIES_ALFAJORES["cusd"], +}); ``` ## Gas Price @@ -46,12 +45,11 @@ async function getGasPrice(client, feeCurrencyAddress?: Address) { const priceHex = await client.request({ method: "eth_gasPrice", params: [feeCurrencyAddress], - }) - return hexToBigInt(priceHex) + }); + return hexToBigInt(priceHex); } -tx.maxFeePerGas = await getGasPrice(client, tx.feeCurrency) - +tx.maxFeePerGas = await getGasPrice(client, tx.feeCurrency); ``` -For an interactive example of using viem with Celo's fee currency feature [see our demo](https://rainbowkit-with-celo.vercel.app/fee-currency) +For an interactive example of using viem with Celo's Fee Abstraction feature [see our demo](https://rainbowkit-with-celo.vercel.app/fee-currency) diff --git a/docs/protocol/transaction/erc20-transaction-fees.md b/docs/protocol/transaction/erc20-transaction-fees.md index 1c23715703..f3eb1db0aa 100644 --- a/docs/protocol/transaction/erc20-transaction-fees.md +++ b/docs/protocol/transaction/erc20-transaction-fees.md @@ -44,7 +44,7 @@ Adapters can also be used to query `balanceOf(address)` of an account, but it wi N/A -### Enabling Transactions with ERC20 Token as Fee Currency in a wallet +### Enabling Transactions with ERC20 Token as fee currency in a wallet We recommend using the [viem](https://viem.sh/) library as it has support for the `feeCurrency` field in the transaction required for sending transaction where the gas fees will be paid in ERC20 tokens. diff --git a/sidebars.js b/sidebars.js index 93ae8e9895..4bb3a7b3c7 100644 --- a/sidebars.js +++ b/sidebars.js @@ -474,7 +474,7 @@ const sidebars = { }, { type: "doc", - label: "Fee Currency", + label: "Fee Abstraction", id: "developer/fee-currency", }, { @@ -1137,6 +1137,11 @@ const sidebars = { label: "Deploy Contract", id: "cel2/deploy-contract", }, + { + type: "doc", + label: "Contract Addresses", + id: "cel2/contract-addresses", + }, { type: "link", label: "Cel2 Dango Bridge",