Documentation
¶
Index ¶
- Variables
- type CallType
- type Contract
- func NewContract(depth int, origin types.Address, from types.Address, to types.Address, ...) *Contract
- func NewContractCall(depth int, origin types.Address, from types.Address, to types.Address, ...) *Contract
- func NewContractCreation(depth int, origin types.Address, from types.Address, to types.Address, ...) *Contract
- type Host
- type Runtime
- type StorageStatus
- type TxContext
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrGasConsumed = fmt.Errorf("gas has been consumed") ErrGasOverflow = fmt.Errorf("gas overflow") ErrStackOverflow = fmt.Errorf("stack overflow") ErrStackUnderflow = fmt.Errorf("stack underflow") ErrJumpDestNotValid = fmt.Errorf("jump destination is not valid") ErrMemoryOverflow = fmt.Errorf("error memory overflow") ErrNotEnoughFunds = fmt.Errorf("not enough funds") ErrMaxCodeSizeExceeded = errors.New("evm: max code size exceeded") ErrContractAddressCollision = errors.New("contract address collision") ErrDepth = errors.New("max call depth exceeded") ErrOpcodeNotFound = errors.New("opcode not found") ErrExecutionReverted = errors.New("execution was reverted") ErrCodeStoreOutOfGas = fmt.Errorf("code storage out of gas") )
Functions ¶
This section is empty.
Types ¶
type Contract ¶
type Contract struct {
Code []byte
Type CallType
CodeAddress types.Address
Address types.Address
Origin types.Address
Caller types.Address
Depth int
Value *big.Int
Input []byte
Gas uint64
Static bool
}
Contract is the instance being called
func NewContract ¶
func NewContractCall ¶
type Host ¶
type Host interface {
AccountExists(addr types.Address) bool
GetStorage(addr types.Address, key types.Hash) types.Hash
SetStorage(addr types.Address, key types.Hash, value types.Hash, discount bool) StorageStatus
GetBalance(addr types.Address) *big.Int
GetCodeSize(addr types.Address) int
GetCodeHash(addr types.Address) types.Hash
GetCode(addr types.Address) []byte
Selfdestruct(addr types.Address, beneficiary types.Address)
GetTxContext() TxContext
GetBlockHash(number int64) types.Hash
EmitLog(addr types.Address, topics []types.Hash, data []byte)
Callx(*Contract, Host) ([]byte, uint64, error)
Empty(addr types.Address) bool
GetNonce(addr types.Address) uint64
}
Host is the execution host
type Runtime ¶
type Runtime interface {
Run(c *Contract, host Host, config *chain.ForksInTime) ([]byte, uint64, error)
CanRun(c *Contract, host Host, config *chain.ForksInTime) bool
Name() string
}
Runtime can process contracts
type StorageStatus ¶
type StorageStatus int
StorageStatus is the status of the storage access
const ( // StorageUnchanged if the data has not changed StorageUnchanged StorageStatus = iota // StorageModified if the value has been modified StorageModified // StorageModifiedAgain if the value has been modified before in the txn StorageModifiedAgain // StorageAdded if this is a new entry in the storage StorageAdded // StorageDeleted if the storage was deleted StorageDeleted )
func (StorageStatus) String ¶
func (s StorageStatus) String() string
Click to show internal directories.
Click to hide internal directories.