Move fee abstraction docs to "Build on Celo" section#2163
Conversation
Split the single fee abstraction page into three focused pages: - Overview: what fee abstraction is, allowlist, adapters - Using Fee Abstraction: practical guide with viem and CLI - Adding Fee Currencies: IFeeCurrency interface and implementation Update all cross-references and redirects.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
Add sections explaining why fee abstraction matters, how it works at the protocol level, and key use cases.
| const hash = await client.sendTransaction({ | ||
| ...{ to, data: dataAfterFeeCalculation }, | ||
| feeCurrency: USDC_ADAPTER_MAINNET, | ||
| }); |
There was a problem hiding this comment.
This function seems wrong.
It takes amountInWei, but only uses it to calculate the fee and then sends 1 ether - the fee.
Also it's handling USDC which has 6 decimals so accepting an amount in wei also seems wrong, and using parse ether, which also returns wei!
I find this is pretty confusing, and also unnecessarily complex for an example. I would simplify it to
an example that simply shows sending a given amount determined by the user, rather than removing the fee from the amount to send.
And possibly having one example showing using an adapted token and one example showing using a non adapted token.
There was a problem hiding this comment.
I reverted to the original, untouched examples for now.
They might not be perfect, but I think they're not in scope for this PR.
- Move allowlist and adapters sections from overview to using-fee-abstraction - Fix celocli command to use --node celo for consistency - Rewrite send example: use parseUnits with correct decimals, remove confusing fee subtraction logic, show both adapted (USDC) and non-adapted (USDm) token examples - Move gas estimation to its own section - Note that viem sets CIP-64 tx type automatically
we can improve them later
Split the single fee abstraction page into three focused pages:
Update all cross-references and redirects.