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 1 year 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

@aaronmgdr Should we update the docs today? or a few days before Cel2 is available to use?

therealharpaljadeja avatar May 30 '24 14:05 therealharpaljadeja

These changes id wait until the testnet is ready.

aaronmgdr avatar May 30 '24 14:05 aaronmgdr

Now that the testnet is ready, what is the state of this issue?

karlb avatar Jul 09 '24 10:07 karlb

Waiting for CIP 66 to be implemented on Dango.

therealharpaljadeja avatar Jul 09 '24 11:07 therealharpaljadeja

Ok, then I'll move this to a different epic, since that is not included in the current testnet.

karlb avatar Jul 09 '24 11:07 karlb

Please do the changes that don't depend on CIP-66 (FeeCurrencyWhiteList => FeeCurrencyDirectory) now without waiting for CIP-66, since that will still take a while. If that is a signifiant amount of work, consider splitting the issue into two.

karlb avatar Jul 26 '24 07:07 karlb

CIP-66 won't be in during the alfajores migration and is also not at the top of the priority list after that. Please don't wait for CIP-66 to update the docs!

karlb avatar Sep 23 '24 08:09 karlb

we can close this as cip66 is not real

aaronmgdr avatar Sep 23 '24 09:09 aaronmgdr