Skip to content

Commit 636c14c

Browse files
martinvolGigaHierzlvpeschke
authored
Update add-gas-currency.md (#1970)
* Update add-gas-currency.md * Update add-gas-currency.md * Apply suggestions from code review Co-authored-by: Victoria <4222953+lvpeschke@users.noreply.github.com> --------- Co-authored-by: GigaHierz <55887077+GigaHierz@users.noreply.github.com> Co-authored-by: Victoria <4222953+lvpeschke@users.noreply.github.com>
1 parent 8a8de51 commit 636c14c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

docs/learn/add-gas-currency.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,33 @@ To enable a token as gas currency, two [governance proposals](/what-is-celo/usin
5656

5757
### Enabling the Oracle
5858

59+
#### Adding a new token to SortedOracles
60+
5961
The first proposal is meant to enable the oracle, by calling `SortedOracle.addOracle(address token, address oracleAddress)`. Potentially, this proposal could also transfer some Celo from the Community Fund to the oracle addresses to pay for gas.
6062

6163
An example of such proposal [can be found here](https://github.com/celo-org/governance/blob/main/CGPs/cgp-0085.md).
6264

63-
### Reporting
65+
#### Creating an equivalent Oracle
66+
67+
SortedOracles supports flagging two tokens as "equivalent". This way, no new oracle has to be deployed, which is useful for fiat-backed stablecoins. [Here is an example](https://github.com/celo-org/governance/pull/419/files#diff-ba5ba5397b269ceb4b93f3876bedabac605daeec083a364a270675242fe7c424) of this approach. Using this approach, it is not needed to submit two proposals, the change can be done in only one.
68+
69+
##### Reporting
6470

6571
Before submitting the second proposal, at least one of the oracle addresses need to call `report(address token, uint256 value, address lesserKey, address greaterKey)`. This will make a price available to the protocol for gas pricing.
6672

6773
### Enabling as Gas Token
6874

69-
The second proposal enables the gas token by calling `addToken(address tokenAddress)`. After this proposal passes, EOAs should be able to pay for gas in the enabled token.
75+
The second proposal enables the gas token by calling `FeeCurrencyDirectory.setCurrencyConfig(address token, address oracle, uint256 intrinsicGas)`. `intrinsicGas` is the estimated average amount of gas used by the functions `creditGasFees(...)` and `debitGasFees(...)`. A benchmark is recommended as an attachment to the governance proposal.
76+
77+
After this proposal passes, EOAs should be able to pay for gas in the enabled token.
7078

7179
An example of such proposal [can be found here](https://github.com/sirpy/governance/blob/1cee2314b357246385819e7e0713a272a55b0ec3/CGPs/cgp-0089.md).
7280

73-
It would be a good consideration to update popular tooling (like contractkit) before this proposal passes so that most developers are ready to use the new gas as soon as it enabled.
81+
It would be a good consideration to update popular tooling (like [contractkit](https://docs.celo.org/developer/contractkit)) before this proposal passes, so that most developers are ready to use the new gas as soon as it is enabled.
7482

7583
### Enabling with just one proposal
7684

77-
It is possible to simplify this process to one governance proposal. That'd proposal would have to enable the Governance contract as an oracle for the token to enable as gas token.
85+
It is possible to simplify this process to one governance proposal. That proposal would have to enable the Governance contract as an oracle for the token to enable as gas token.
7886

7987
Then, the governance proposal itself should report a reference value within the same proposal. This is particularly safe to do with stablecoins.
8088

0 commit comments

Comments
 (0)