docs icon indicating copy to clipboard operation
docs copied to clipboard

Update Info about Easy Fee Tokens / Fee Currencies for L2

Open aaronmgdr opened this issue 8 months ago • 6 comments

For Cel2 some updates are needed to docs when talking about easy fee feature.

In general FeeCurrencyWhiteList => FeeCurrencyDirectory

  1. https://docs.celo.org/protocol/transaction/transaction-types should be updated like https://github.com/celo-org/txtypes/pull/12/files
  2. https://docs.celo.org/protocol/transaction/erc20-transaction-fees write a section about differences between cip66 and previous standards.

Please add this to paying for gas in tokens page

Understanding CIP66 vs previous fee currency transaction types

While Celo has had support for paying for gas with specific fee tokens since day 1. the implementation of this feature has gone thru a few iterations of transaction types. CIP 66 aka type 122 has some significant changes to be aware of as a developer.

  1. In contracts to all other types where the price of gas was denominated in the token paying for it, cip 66 is denominated in CELO. This means the maxFeePerGas and maxPriorityFeePerGas fields are used and can be built exactly like a EIP 1559 transactions.

::info:: when providing feeCurrency its safer to either provide all the three maxFeePerGas, maxPriorityFeePerGas and maxFeeInFeeCurrency fields yourself or none and let the library calculate them for you. as there could be ambiguity on whether the maxFeePerGas you give the library was calculated in the fee token or in CELO ::info::

  1. maxFeeInFeeCurrency field. This is unique to CIP 66. While most libraries that support cip 66 (viem, contractkit, celo-ethers-wrapper) will calculate this for you, by calculating it yourself you have more control and guarantee the transaction will be type 122.

aaronmgdr avatar May 29 '24 08:05 aaronmgdr