github.com/ethereum-optimism/optimism/l2geth@v0.0.0-20230612200230-50b04ade19e3/rollup/rcfg/config.go (about)

     1  package rcfg
     2  
     3  import (
     4  	"math/big"
     5  	"os"
     6  
     7  	"github.com/ethereum-optimism/optimism/l2geth/common"
     8  )
     9  
    10  // UsingOVM is used to enable or disable functionality necessary for the OVM.
    11  var UsingOVM bool
    12  
    13  var (
    14  	// L2GasPriceSlot refers to the storage slot that the L2 gas price is stored
    15  	// in in the OVM_GasPriceOracle predeploy
    16  	L2GasPriceSlot = common.BigToHash(big.NewInt(1))
    17  	// L1GasPriceSlot refers to the storage slot that the L1 gas price is stored
    18  	// in in the OVM_GasPriceOracle predeploy
    19  	L1GasPriceSlot = common.BigToHash(big.NewInt(2))
    20  	// L2GasPriceOracleOwnerSlot refers to the storage slot that the owner of
    21  	// the OVM_GasPriceOracle is stored in
    22  	L2GasPriceOracleOwnerSlot = common.BigToHash(big.NewInt(0))
    23  	// L2GasPriceOracleAddress is the address of the OVM_GasPriceOracle
    24  	// predeploy
    25  	L2GasPriceOracleAddress = common.HexToAddress("0x420000000000000000000000000000000000000F")
    26  	// OverheadSlot refers to the storage slot in the OVM_GasPriceOracle that
    27  	// holds the per transaction overhead. This is added to the L1 cost portion
    28  	// of the fee
    29  	OverheadSlot = common.BigToHash(big.NewInt(3))
    30  	// ScalarSlot refers to the storage slot in the OVM_GasPriceOracle that
    31  	// holds the transaction fee scalar. This value is scaled upwards by
    32  	// the number of decimals
    33  	ScalarSlot = common.BigToHash(big.NewInt(4))
    34  	// DecimalsSlot refers to the storage slot in the OVM_GasPriceOracle that
    35  	// holds the number of decimals in the fee scalar
    36  	DecimalsSlot = common.BigToHash(big.NewInt(5))
    37  )
    38  
    39  func init() {
    40  	UsingOVM = os.Getenv("USING_OVM") == "true"
    41  }