Commit 601abcb8 authored by Mark Tyneway's avatar Mark Tyneway

core-utils: delete dead fee docs

A very legacy version of fee calculation was still in
the readme. This commit deletes the information from
the readme.
parent 8b11e73e
...@@ -24,32 +24,3 @@ $ yarn start ...@@ -24,32 +24,3 @@ $ yarn start
$ yarn test $ yarn test
$ yarn lint $ yarn lint
``` ```
### L2 Fees
`TxGasLimit` can be used to `encode` and `decode` the L2 Gas Limit
locally.
```typescript
import { TxGasLimit } from '@eth-optimism/core-utils'
import { JsonRpcProvider } from 'ethers'
const L2Provider = new JsonRpcProvider('https://mainnet.optimism.io')
const L1Provider = new JsonRpcProvider('http://127.0.0.1:8545')
const l2GasLimit = await L2Provider.send('eth_estimateExecutionGas', [tx])
const l1GasPrice = await L1Provider.getGasPrice()
const encoded = TxGasLimit.encode({
data: '0x',
l1GasPrice,
l2GasLimit,
l2GasPrice: 10000000,
})
const decoded = TxGasLimit.decode(encoded)
assert(decoded.eq(gasLimit))
const estimate = await L2Provider.estimateGas()
assert(estimate.eq(encoded))
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment