evm

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CanTransferDecorator

type CanTransferDecorator struct {
	// contains filtered or unexported fields
}

CanTransferDecorator checks if the sender is allowed to transfer funds according to the EVM block context rules.

func NewCanTransferDecorator

func NewCanTransferDecorator(evmKeeper EVMKeeper, opbKeeper opbkeeper.Keeper, tokenKeeper tokenkeeper.Keeper, permKeeper permkeeper.Keeper) CanTransferDecorator

NewCanTransferDecorator creates a new CanTransferDecorator instance.

func (CanTransferDecorator) AnteHandle

func (ctd CanTransferDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

AnteHandle creates an EVM from the message and calls the BlockContext CanTransfer function to see if the address can execute the transaction.

type ContractCallable

type ContractCallable interface {
	GetBlockContract(sdk.Context, []byte) bool
}

type EVMKeeper

type EVMKeeper interface {
	statedb.Keeper

	ChainID() *big.Int
	GetParams(ctx sdk.Context) evmtypes.Params
	NewEVM(ctx sdk.Context, msg core.Message, cfg *evmtypes.EVMConfig, tracer vm.EVMLogger, stateDB vm.StateDB) *vm.EVM
	DeductTxCostsFromUserBalance(
		ctx sdk.Context, msgEthTx evmtypes.MsgEthereumTx, txData evmtypes.TxData, denom string, homestead, istanbul, london bool,
	) (sdk.Coins, error)
	BaseFee(ctx sdk.Context, ethCfg *params.ChainConfig) *big.Int
	GetBalance(ctx sdk.Context, addr common.Address) *big.Int
	ResetTransientGasUsed(ctx sdk.Context)
}

EVMKeeper defines the expected keeper interface used on the Eth AnteHandler

type EthContractCallableDecorator

type EthContractCallableDecorator struct {
	// contains filtered or unexported fields
}

func NewEthContractCallableDecorator

func NewEthContractCallableDecorator(contractCallable ContractCallable) EthContractCallableDecorator

func (EthContractCallableDecorator) AnteHandle

func (e EthContractCallableDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)

type EthOpbValidator

type EthOpbValidator struct {
	// contains filtered or unexported fields
}

func NewEthOpbValidator

func NewEthOpbValidator(
	ctx sdk.Context,
	opbKeeper opbkeeper.Keeper,
	tokenKeeper tokenkeeper.Keeper,
	evmKeeper EVMKeeper,
	permKeeper permkeeper.Keeper,
) *EthOpbValidator

func (EthOpbValidator) CanTransfer

func (ov EthOpbValidator) CanTransfer(db vm.StateDB, userAddr common.Address, amount *big.Int) bool

func (EthOpbValidator) Transfer

func (ov EthOpbValidator) Transfer(db vm.StateDB, sender, recipient common.Address, amount *big.Int)

type EthSigVerificationDecorator

type EthSigVerificationDecorator struct {
	// contains filtered or unexported fields
}

EthSigVerificationDecorator validates an ethereum signatures

func NewEthSigVerificationDecorator

func NewEthSigVerificationDecorator(ek EVMKeeper, ak authante.AccountKeeper, signModeHandler authsigning.SignModeHandler) EthSigVerificationDecorator

NewEthSigVerificationDecorator creates a new EthSigVerificationDecorator

func (EthSigVerificationDecorator) AnteHandle

func (esvd EthSigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)

AnteHandle validates checks that the registered chain id is the same as the one on the message, and that the signer address matches the one defined on the message. It's not skipped for RecheckTx, because it set `From` address which is critical from other ante handler to work. Failure in RecheckTx will prevent tx to be included into block, especially when CheckTx succeed, in which case user won't see the error message.

type EthValidateBasicDecorator

type EthValidateBasicDecorator struct {
	// contains filtered or unexported fields
}

EthValidateBasicDecorator is adapted from ValidateBasicDecorator from cosmos-sdk, it ignores ErrNoSignatures

func NewEthValidateBasicDecorator

func NewEthValidateBasicDecorator(ek EVMKeeper) EthValidateBasicDecorator

NewEthValidateBasicDecorator creates a new EthValidateBasicDecorator

func (EthValidateBasicDecorator) AnteHandle

func (vbd EthValidateBasicDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

AnteHandle handles basic validation of tx

type WNodeKeeper

type WNodeKeeper struct {
	node.Keeper
}

func (WNodeKeeper) GetHistoricalInfo

func (node WNodeKeeper) GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool)

func (WNodeKeeper) GetValidatorByConsAddr

func (node WNodeKeeper) GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (validator stakingtypes.Validator, found bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL