context.go 850 Bytes
Newer Older
1 2 3 4 5
package script

import (
	"math/big"

6
	"github.com/ethereum-optimism/optimism/op-chain-ops/script/addresses"
7

8
	"github.com/ethereum/go-ethereum/common"
9 10 11 12 13 14 15 16
)

const (
	// DefaultFoundryGasLimit is set to int64.max in foundry.toml
	DefaultFoundryGasLimit = 9223372036854775807
)

type Context struct {
17 18 19 20 21 22 23 24 25
	ChainID      *big.Int
	Sender       common.Address
	Origin       common.Address
	FeeRecipient common.Address
	GasLimit     uint64
	BlockNum     uint64
	Timestamp    uint64
	PrevRandao   common.Hash
	BlobHashes   []common.Hash
26 27 28
}

var DefaultContext = Context{
29
	ChainID:      big.NewInt(1337),
30 31
	Sender:       addresses.DefaultSenderAddr,
	Origin:       addresses.DefaultSenderAddr,
32 33 34 35 36 37
	FeeRecipient: common.Address{},
	GasLimit:     DefaultFoundryGasLimit,
	BlockNum:     0,
	Timestamp:    0,
	PrevRandao:   common.Hash{},
	BlobHashes:   []common.Hash{},
38
}