Documentation ¶
Index ¶
- func CheckSenderBalance(balance sdkmath.Int, txData evmtypes.TxData) error
- func GasToRefund(availableRefund, gasConsumed, refundQuotient uint64) uint64
- type Keeper
- func (k Keeper) Account(c context.Context, req *types.QueryAccountRequest) (*types.QueryAccountResponse, error)
- func (k *Keeper) AddEvents(events sdk.Events)
- func (k Keeper) AddTransientGasUsed(ctx sdk.Context, gasUsed uint64) (uint64, error)
- func (k *Keeper) AddTypedEvents(tevs []proto.Message) error
- func (k Keeper) AddressConvert(_ context.Context, req *types.QueryAddressConvertRequest) (*types.QueryAddressConvertResponse, error)
- func (k *Keeper) ApplyAutoMessageWithConfig(ctx sdk.Context, msg core.Message, tracer vm.EVMLogger, commit bool, ...) (*types.MsgEthereumTxResponse, error)
- func (k *Keeper) ApplyCosmosMessageWithConfig(ctx sdk.Context, msg core.Message, tracer vm.EVMLogger, commit bool, ...) (*types.MsgEthereumTxResponse, error)
- func (k *Keeper) ApplyEvents(ctx sdk.Context, isVmError bool)
- func (k *Keeper) ApplyMessage(ctx sdk.Context, msg core.Message, tracer vm.EVMLogger, commit bool) (*types.MsgEthereumTxResponse, error)
- func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, tracer vm.EVMLogger, commit bool, ...) (*types.MsgEthereumTxResponse, error)
- func (k *Keeper) ApplyTransaction(ctx sdk.Context, tx *ethtypes.Transaction) (*types.MsgEthereumTxResponse, error)
- func (k Keeper) Balance(c context.Context, req *types.QueryBalanceRequest) (*types.QueryBalanceResponse, error)
- func (k Keeper) BaseFee(c context.Context, _ *types.QueryBaseFeeRequest) (*types.QueryBaseFeeResponse, error)
- func (k Keeper) BaseFeeParam(c context.Context, _ *types.QueryBaseFeeRequest) (*types.QueryBaseFeeResponse, error)
- func (k Keeper) BlockGas(c context.Context, _ *types.QueryBlockGasRequest) (*types.QueryBlockGasResponse, error)
- func (k Keeper) CalculateBaseFee(ctx sdk.Context) *big.Int
- func (k Keeper) Code(c context.Context, req *types.QueryCodeRequest) (*types.QueryCodeResponse, error)
- func (k Keeper) CosmosAccount(c context.Context, req *types.QueryCosmosAccountRequest) (*types.QueryCosmosAccountResponse, error)
- func (k Keeper) DeductTxCostsFromUserBalance(ctx sdk.Context, msgEthTx evmtypes.MsgEthereumTx, txData evmtypes.TxData, ...) (sdk.Coins, error)
- func (k *Keeper) DeleteAccount(ctx sdk.Context, addr common.Address) error
- func (k *Keeper) EVMConfig(ctx sdk.Context) (*types.EVMConfig, error)
- func (k Keeper) EmitBlockBloomEvent(ctx sdk.Context, bloom ethtypes.Bloom) error
- func (k Keeper) EstimateGas(c context.Context, req *types.EthCallRequest) (*types.EstimateGasResponse, error)
- func (k Keeper) EthCall(c context.Context, req *types.EthCallRequest) (*types.MsgEthereumTxResponse, error)
- func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*types.MsgEthereumTxResponse, error)
- func (k *Keeper) ExportGenesis(ctx sdk.Context, ak types.AccountKeeper) *types.GenesisState
- func (k *Keeper) ForEachStorage(ctx sdk.Context, addr common.Address, cb func(key, value common.Hash) bool)
- func (k *Keeper) GetAccount(ctx sdk.Context, addr common.Address) *statedb.Account
- func (k *Keeper) GetAccountOrEmpty(ctx sdk.Context, addr common.Address) statedb.Account
- func (k Keeper) GetAccountStorage(ctx sdk.Context, address common.Address) types.Storage
- func (k *Keeper) GetAccountWithoutBalance(ctx sdk.Context, addr common.Address) *statedb.Account
- func (k *Keeper) GetBalance(ctx sdk.Context, addr common.Address) *big.Int
- func (k *Keeper) GetBalanceV011(ctx sdk.Context, addr common.Address) *big.Int
- func (k Keeper) GetBaseFee(ctx sdk.Context, ethCfg *params.ChainConfig) *big.Int
- func (k Keeper) GetBaseFeeParam(ctx sdk.Context) *big.Int
- func (k Keeper) GetBaseFeeParamV011(ctx sdk.Context) *big.Int
- func (k Keeper) GetBlockBloomTransient(ctx sdk.Context) *big.Int
- func (k Keeper) GetBlockGasUsed(ctx sdk.Context) uint64
- func (k *Keeper) GetCode(ctx sdk.Context, codeHash common.Hash) []byte
- func (k Keeper) GetCoinbaseAddress(ctx sdk.Context) (common.Address, error)
- func (k *Keeper) GetEthIntrinsicGas(ctx sdk.Context, msg core.Message, cfg *params.ChainConfig, ...) (uint64, error)
- func (k Keeper) GetHashFn(ctx sdk.Context) vm.GetHashFunc
- func (k Keeper) GetLogSizeTransient(ctx sdk.Context) uint64
- func (k *Keeper) GetNonce(ctx sdk.Context, addr common.Address) uint64
- func (k Keeper) GetParams(ctx sdk.Context) (p types.Params)
- func (k Keeper) GetParamsV011(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetSdkMsg(from sdk.AccAddress, data []byte) (*types.MsgCosmosData, error)
- func (k *Keeper) GetState(ctx sdk.Context, addr common.Address, key common.Hash) common.Hash
- func (k Keeper) GetTransientGasUsed(ctx sdk.Context) uint64
- func (k Keeper) GetTxIndexTransient(ctx sdk.Context) uint64
- func (k *Keeper) InitGenesis(ctx sdk.Context, accountKeeper types.AccountKeeper, data types.GenesisState) []abci.ValidatorUpdate
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k *Keeper) NewEVM(ctx sdk.Context, msg core.Message, cfg *types.EVMConfig, tracer vm.EVMLogger, ...) *vm.EVM
- func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k *Keeper) ParseProtoFromDataFn(ctx sdk.Context) vm.ParseProtoFromDataFunc
- func (k *Keeper) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error
- func (k *Keeper) RefundGas(ctx sdk.Context, msg core.Message, leftoverGas uint64, denom string) error
- func (k *Keeper) ResetGasMeterAndConsumeGas(ctx sdk.Context, gasUsed uint64)
- func (k Keeper) ResetTransientGasUsed(ctx sdk.Context)
- func (k *Keeper) RunSdkMsgFn(ctx sdk.Context, simulate bool) vm.RunSdkMsgFunc
- func (k *Keeper) SetAccount(ctx sdk.Context, addr common.Address, account statedb.Account) error
- func (k *Keeper) SetBalance(ctx sdk.Context, addr common.Address, amount *big.Int) error
- func (k Keeper) SetBaseFeeParam(ctx sdk.Context, baseFee *big.Int)
- func (k Keeper) SetBlockBloomTransient(ctx sdk.Context, bloom *big.Int)
- func (k Keeper) SetBlockGasUsed(ctx sdk.Context, gas uint64)
- func (k *Keeper) SetCode(ctx sdk.Context, codeHash, code []byte)
- func (k *Keeper) SetHooks(eh types.EvmHooks) *Keeper
- func (k Keeper) SetLogSizeTransient(ctx sdk.Context, logSize uint64)
- func (k *Keeper) SetMsgServiceRouter(msgServiceRouter *baseapp.MsgServiceRouter)
- func (k *Keeper) SetParamSpace(paramSpace paramtypes.Subspace)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error
- func (k *Keeper) SetState(ctx sdk.Context, addr common.Address, key common.Hash, value []byte)
- func (k *Keeper) SetTracer(tracer string)
- func (k Keeper) SetTransientGasUsed(ctx sdk.Context, gasUsed uint64)
- func (k *Keeper) SetTransientKey(transientKey storetypes.StoreKey)
- func (k Keeper) SetTxIndexTransient(ctx sdk.Context, index uint64)
- func (k Keeper) Storage(c context.Context, req *types.QueryStorageRequest) (*types.QueryStorageResponse, error)
- func (k Keeper) TraceBlock(c context.Context, req *types.QueryTraceBlockRequest) (*types.QueryTraceBlockResponse, error)
- func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*types.QueryTraceTxResponse, error)
- func (k Keeper) Tracer(ctx sdk.Context, msg core.Message, ethCfg *params.ChainConfig) vm.EVMLogger
- func (k *Keeper) TxConfig(ctx sdk.Context, txHash common.Hash) statedb.TxConfig
- func (k *Keeper) UpdateImplmentationProposal(goCtx context.Context, msg *types.MsgUpdateImplmentationProposal) (*types.MsgUpdateImplmentationProposalResponse, error)
- func (k *Keeper) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error)
- func (k Keeper) VMConfig(ctx sdk.Context, cfg *types.EVMConfig, tracer vm.EVMLogger) vm.Config
- func (k Keeper) ValidatorAccount(c context.Context, req *types.QueryValidatorAccountRequest) (*types.QueryValidatorAccountResponse, error)
- type MigratableContract
- type Migrator
- type MultiEvmHooks
- type ProposalCounsil
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSenderBalance ¶
CheckSenderBalance validates that the tx cost value is positive and that the sender has enough funds to pay for the fees and value of the transaction.
func GasToRefund ¶
GasToRefund calculates the amount of gas the state machine should refund to the sender. It is capped by the refund quotient value. Note: do not pass 0 to refundQuotient
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper grants access to the EVM module state and implements the go-ethereum StateDB interface.
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey storetypes.StoreKey, ak types.AccountKeeper, bankKeeper types.BankKeeper, sk types.StakingKeeper, authority string, ) *Keeper
NewKeeper generates new evm module keeper
func (Keeper) Account ¶
func (k Keeper) Account(c context.Context, req *types.QueryAccountRequest) (*types.QueryAccountResponse, error)
Account implements the Query/Account gRPC method
func (Keeper) AddTransientGasUsed ¶
AddTransientGasUsed accumulate gas used by each eth msgs included in current cosmos tx.
func (*Keeper) AddTypedEvents ¶ added in v0.12.0
func (Keeper) AddressConvert ¶ added in v0.10.0
func (k Keeper) AddressConvert(_ context.Context, req *types.QueryAddressConvertRequest) (*types.QueryAddressConvertResponse, error)
func (*Keeper) ApplyAutoMessageWithConfig ¶ added in v0.12.0
func (k *Keeper) ApplyAutoMessageWithConfig(ctx sdk.Context, msg core.Message, tracer vm.EVMLogger, commit bool, cfg *types.EVMConfig, txConfig statedb.TxConfig) (*types.MsgEthereumTxResponse, error)
ApplyAutoMessageWithConfig automatic handle where msg should be proceed
func (*Keeper) ApplyCosmosMessageWithConfig ¶ added in v0.12.0
func (k *Keeper) ApplyCosmosMessageWithConfig(ctx sdk.Context, msg core.Message, tracer vm.EVMLogger, commit bool, cfg *types.EVMConfig, txConfig statedb.TxConfig) (*types.MsgEthereumTxResponse, error)
ApplyCosmosMessageWithConfig runs and attempts to perform a state transition with the given transaction for cosmos msd (i.e. Message), that will only be persisted (committed) to the underlying KVStore if the transaction does not fail. It will be executed only if all checks are fine. In case tx aborted, it should not been even commited because it does not use statedb
func (*Keeper) ApplyEvents ¶ added in v0.12.0
func (*Keeper) ApplyMessage ¶
func (k *Keeper) ApplyMessage(ctx sdk.Context, msg core.Message, tracer vm.EVMLogger, commit bool) (*types.MsgEthereumTxResponse, error)
ApplyMessage calls ApplyMessageWithConfig with default EVMConfig
func (*Keeper) ApplyMessageWithConfig ¶
func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, tracer vm.EVMLogger, commit bool, cfg *types.EVMConfig, txConfig statedb.TxConfig) (*types.MsgEthereumTxResponse, error)
ApplyMessageWithConfig computes the new state by applying the given message against the existing state. If the message fails, the VM execution error with the reason will be returned to the client and the transaction won't be committed to the store.
Reverted state ¶
The snapshot and rollback are supported by the `statedb.StateDB`.
Different Callers ¶
It's called in three scenarios: 1. `ApplyTransaction`, in the transaction processing flow. 2. `EthCall/EthEstimateGas` grpc query handler. 3. Called by other native modules directly.
Prechecks and Preprocessing ¶
All relevant state transition prechecks for the MsgEthereumTx are performed on the AnteHandler, prior to running the transaction against the state. The prechecks run are the following:
1. the nonce of the message caller is correct 2. caller has enough balance to cover transaction fee(gaslimit * gasprice) 3. the amount of gas required is available in the block 4. the purchased gas is enough to cover intrinsic usage 5. there is no overflow when calculating intrinsic gas 6. caller has enough balance to cover asset transfer for **topmost** call
The preprocessing steps performed by the AnteHandler are:
1. set up the initial access list (iff fork > Berlin)
Tracer parameter ¶
It should be a `vm.Tracer` object or nil, if pass `nil`, it'll create a default one based on keeper options.
Commit parameter ¶
If commit is true, the `StateDB` will be committed, otherwise discarded.
func (*Keeper) ApplyTransaction ¶
func (k *Keeper) ApplyTransaction(ctx sdk.Context, tx *ethtypes.Transaction) (*types.MsgEthereumTxResponse, error)
ApplyTransaction runs and attempts to perform a state transition with the given transaction (i.e. Message), that will only be persisted (committed) to the underlying KVStore if the transaction does not fail.
Gas tracking ¶
Ethereum consumes gas according to the EVM opcodes instead of general reads and writes to store. Because of this, the state transition needs to ignore the SDK gas consumption mechanism defined by the GasKVStore and instead consume the amount of gas used by the VM execution. The amount of gas used is tracked by the EVM and returned in the execution result.
Prior to the execution, the starting tx gas meter is saved and replaced with an infinite gas meter in a new context in order to ignore the SDK gas consumption config values (read, write, has, delete). After the execution, the gas used from the message execution will be added to the starting gas consumed, taking into consideration the amount of gas returned. Finally, the context is updated with the EVM gas consumed value prior to returning.
For relevant discussion see: https://github.com/cosmos/cosmos-sdk/discussions/9072
func (Keeper) Balance ¶
func (k Keeper) Balance(c context.Context, req *types.QueryBalanceRequest) (*types.QueryBalanceResponse, error)
Balance implements the Query/Balance gRPC method
func (Keeper) BaseFee ¶
func (k Keeper) BaseFee(c context.Context, _ *types.QueryBaseFeeRequest) (*types.QueryBaseFeeResponse, error)
BaseFee implements the Query/BaseFee gRPC method
func (Keeper) BaseFeeParam ¶
func (k Keeper) BaseFeeParam(c context.Context, _ *types.QueryBaseFeeRequest) (*types.QueryBaseFeeResponse, error)
BaseFeeParam implements the Query/BaseFeeParam gRPC method
func (Keeper) BlockGas ¶
func (k Keeper) BlockGas(c context.Context, _ *types.QueryBlockGasRequest) (*types.QueryBlockGasResponse, error)
BlockGas implements the Query/BlockGas gRPC method
func (Keeper) CalculateBaseFee ¶
CalculateBaseFee calculates the base fee for the current block. This is only calculated once per block during BeginBlock. If the NoBaseFee parameter is enabled or below activation height, this function returns nil. NOTE: This code is inspired from the go-ethereum EIP1559 implementation and adapted to Cosmos SDK-based chains. For the canonical code refer to: https://github.com/ethereum/go-ethereum/blob/master/consensus/misc/eip1559.go
func (Keeper) Code ¶
func (k Keeper) Code(c context.Context, req *types.QueryCodeRequest) (*types.QueryCodeResponse, error)
Code implements the Query/Code gRPC method
func (Keeper) CosmosAccount ¶
func (k Keeper) CosmosAccount(c context.Context, req *types.QueryCosmosAccountRequest) (*types.QueryCosmosAccountResponse, error)
func (Keeper) DeductTxCostsFromUserBalance ¶
func (k Keeper) DeductTxCostsFromUserBalance( ctx sdk.Context, msgEthTx evmtypes.MsgEthereumTx, txData evmtypes.TxData, denom string, homestead, istanbul, london bool, ) (sdk.Coins, error)
DeductTxCostsFromUserBalance it calculates the tx costs and deducts the fees
func (*Keeper) DeleteAccount ¶
DeleteAccount handles contract's suicide call: - clear balance - remove code - remove states - remove auth account
func (Keeper) EmitBlockBloomEvent ¶
EmitBlockBloomEvent emit block bloom events
func (Keeper) EstimateGas ¶
func (k Keeper) EstimateGas(c context.Context, req *types.EthCallRequest) (*types.EstimateGasResponse, error)
EstimateGas implements eth_estimateGas rpc api.
func (Keeper) EthCall ¶
func (k Keeper) EthCall(c context.Context, req *types.EthCallRequest) (*types.MsgEthereumTxResponse, error)
EthCall implements eth_call rpc api.
func (*Keeper) EthereumTx ¶
func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*types.MsgEthereumTxResponse, error)
EthereumTx implements the gRPC MsgServer interface. It receives a transaction which is then executed (i.e. applied) against the go-ethereum EVM. The provided SDK Context is set to the Keeper so that it can implement and call the StateDB methods without receiving it as a function parameter.
func (*Keeper) ExportGenesis ¶ added in v0.12.0
func (k *Keeper) ExportGenesis(ctx sdk.Context, ak types.AccountKeeper) *types.GenesisState
ExportGenesis exports genesis state of the EVM module
func (*Keeper) ForEachStorage ¶
func (k *Keeper) ForEachStorage(ctx sdk.Context, addr common.Address, cb func(key, value common.Hash) bool)
ForEachStorage iterate contract storage, callback return false to break early
func (*Keeper) GetAccount ¶
GetAccount returns nil if account is not exist, returns error if it's not `EthAccountI`
func (*Keeper) GetAccountOrEmpty ¶
GetAccountOrEmpty returns empty account if not exist, returns error if it's not `EthAccount`
func (Keeper) GetAccountStorage ¶
GetAccountStorage return state storage associated with an account
func (*Keeper) GetAccountWithoutBalance ¶
GetAccountWithoutBalance load nonce and codehash without balance, more efficient in cases where balance is not needed.
func (*Keeper) GetBalance ¶
GetBalance load account's balance of gas token
func (*Keeper) GetBalanceV011 ¶ added in v0.12.2
GetBalanceV011 load account's balance of gas token for th old blocks before migrations
func (Keeper) GetBaseFee ¶
GetBaseFee returns current base fee, return values: - `nil`: london hardfork not enabled. - `0`: london hardfork enabled but feemarket is not enabled. - `n`: both london hardfork and feemarket are enabled.
func (Keeper) GetBaseFeeParam ¶
GetBaseFeeParam get's the base fee from the paramSpace return nil if base fee is not enabled
func (Keeper) GetBaseFeeParamV011 ¶ added in v0.12.0
GetBaseFeeParam get's the base fee from the paramSpace return nil if base fee is not enabled
func (Keeper) GetBlockBloomTransient ¶
GetBlockBloomTransient returns bloom bytes for the current block height
func (Keeper) GetBlockGasUsed ¶
GetBlockGasUsed returns the last block gas used value from the store.
func (*Keeper) GetCode ¶
GetCode loads contract code from database, implements `statedb.Keeper` interface.
func (Keeper) GetCoinbaseAddress ¶
GetCoinbaseAddress returns the block proposer's validator operator address.
func (*Keeper) GetEthIntrinsicGas ¶
func (k *Keeper) GetEthIntrinsicGas(ctx sdk.Context, msg core.Message, cfg *params.ChainConfig, isContractCreation bool) (uint64, error)
GetEthIntrinsicGas returns the intrinsic gas cost for the transaction
func (Keeper) GetHashFn ¶
func (k Keeper) GetHashFn(ctx sdk.Context) vm.GetHashFunc
GetHashFn implements vm.GetHashFunc for stratos. It handles 3 cases:
- The requested height matches the current height from context (and thus same epoch number)
- The requested height is from a previous height from the same chain epoch
- The requested height is from a height greater than the latest one
func (Keeper) GetLogSizeTransient ¶
GetLogSizeTransient returns EVM log index on the current block.
func (*Keeper) GetNonce ¶
GetNonce returns the sequence number of an account, returns 0 if not exists.
func (Keeper) GetParamsV011 ¶ added in v0.12.0
GetParams returns the total set of evm parameters.
func (Keeper) GetSdkMsg ¶ added in v0.12.0
func (k Keeper) GetSdkMsg(from sdk.AccAddress, data []byte) (*types.MsgCosmosData, error)
GetSdkMsg return prepared msg from data
func (*Keeper) GetState ¶
GetState loads contract state from database, implements `statedb.Keeper` interface.
func (Keeper) GetTransientGasUsed ¶
GetTransientGasUsed returns the gas used by current cosmos tx.
func (Keeper) GetTxIndexTransient ¶
GetTxIndexTransient returns EVM transaction index on the current block.
func (*Keeper) InitGenesis ¶ added in v0.12.0
func (k *Keeper) InitGenesis( ctx sdk.Context, accountKeeper types.AccountKeeper, data types.GenesisState, ) []abci.ValidatorUpdate
InitGenesis initializes genesis state based on exported genesis
func (*Keeper) NewEVM ¶
func (k *Keeper) NewEVM( ctx sdk.Context, msg core.Message, cfg *types.EVMConfig, tracer vm.EVMLogger, stateDB vm.StateDB, ) *vm.EVM
NewEVM generates a go-ethereum VM from the provided Message fields and the chain parameters (ChainConfig and module Params). It additionally sets the validator operator address as the coinbase address to make it available for the COINBASE opcode, even though there is no beneficiary of the coinbase transaction (since we're not mining).
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params implements the Query/Params gRPC method
func (*Keeper) ParseProtoFromDataFn ¶ added in v0.12.0
func (k *Keeper) ParseProtoFromDataFn(ctx sdk.Context) vm.ParseProtoFromDataFunc
ParseProtoFromDataFn parse data and get proto info
func (*Keeper) PostTxProcessing ¶
func (k *Keeper) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error
PostTxProcessing delegate the call to the hooks. If no hook has been registered, this function returns with a `nil` error
func (*Keeper) RefundGas ¶
func (k *Keeper) RefundGas(ctx sdk.Context, msg core.Message, leftoverGas uint64, denom string) error
RefundGas transfers the leftover gas to the sender of the message, caped to half of the total gas consumed in the transaction. Additionally, the function sets the total gas consumed to the value returned by the EVM execution, thus ignoring the previous intrinsic gas consumed during in the AnteHandler.
func (*Keeper) ResetGasMeterAndConsumeGas ¶
ResetGasMeterAndConsumeGas reset first the gas meter consumed value to zero and set it back to the new value 'gasUsed'
func (Keeper) ResetTransientGasUsed ¶
ResetTransientGasUsed reset gas used to prepare for execution of current cosmos tx, called in ante handler.
func (*Keeper) RunSdkMsgFn ¶ added in v0.12.0
RunSdkMsg execute cosmos msg from payload (NOTE: simulate=true always in smart contracts!!!)
func (*Keeper) SetAccount ¶
SetAccount updates nonce/balance/codeHash together.
func (*Keeper) SetBalance ¶
SetBalance update account's balance, compare with current balance first, then decide to mint or burn.
func (Keeper) SetBaseFeeParam ¶
SetBaseFeeParam set's the base fee in the paramSpace
func (Keeper) SetBlockBloomTransient ¶
SetBlockBloomTransient sets the given bloom bytes to the transient store. This value is reset on every block.
func (Keeper) SetBlockGasUsed ¶
SetBlockGasUsed gets the block gas consumed to the store. CONTRACT: this should be only called during EndBlock.
func (*Keeper) SetHooks ¶
SetHooks sets the hooks for the EVM module It should be called only once during initialization, it panics if called more than once.
func (Keeper) SetLogSizeTransient ¶
SetLogSizeTransient fetches the current EVM log index from the transient store, increases its value by one and then sets the new index back to the transient store.
func (*Keeper) SetMsgServiceRouter ¶ added in v0.12.0
func (k *Keeper) SetMsgServiceRouter(msgServiceRouter *baseapp.MsgServiceRouter)
func (*Keeper) SetParamSpace ¶ added in v0.12.0
func (k *Keeper) SetParamSpace(paramSpace paramtypes.Subspace)
LEGACY BUT REQUIRED
func (Keeper) SetTransientGasUsed ¶
SetTransientGasUsed sets the gas used by current cosmos tx.
func (*Keeper) SetTransientKey ¶ added in v0.12.0
func (k *Keeper) SetTransientKey(transientKey storetypes.StoreKey)
func (Keeper) SetTxIndexTransient ¶
SetTxIndexTransient set the index of processing transaction
func (Keeper) Storage ¶
func (k Keeper) Storage(c context.Context, req *types.QueryStorageRequest) (*types.QueryStorageResponse, error)
Storage implements the Query/Storage gRPC method
func (Keeper) TraceBlock ¶
func (k Keeper) TraceBlock(c context.Context, req *types.QueryTraceBlockRequest) (*types.QueryTraceBlockResponse, error)
TraceBlock configures a new tracer according to the provided configuration, and executes the given message in the provided environment for all the transactions in the queried block. The return value will be tracer dependent.
func (Keeper) TraceTx ¶
func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*types.QueryTraceTxResponse, error)
TraceTx configures a new tracer according to the provided configuration, and executes the given message in the provided environment. The return value will be tracer dependent.
func (*Keeper) UpdateImplmentationProposal ¶ added in v0.12.0
func (k *Keeper) UpdateImplmentationProposal(goCtx context.Context, msg *types.MsgUpdateImplmentationProposal) (*types.MsgUpdateImplmentationProposalResponse, error)
UpdateImplmentationProposal update proxy with new implementation for counsil addresses
func (*Keeper) UpdateParams ¶ added in v0.12.0
func (k *Keeper) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error)
UpdateParams updates the module parameters
func (Keeper) VMConfig ¶
VMConfig creates an EVM configuration from the debug setting and the extra EIPs enabled on the module parameters. The config generated uses the default JumpTable from the EVM.
func (Keeper) ValidatorAccount ¶
func (k Keeper) ValidatorAccount(c context.Context, req *types.QueryValidatorAccountRequest) (*types.QueryValidatorAccountResponse, error)
type MigratableContract ¶ added in v0.12.0
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func NewMigrator ¶
func NewMigrator(keeper Keeper, legacySubspace types.ParamsSubspace) Migrator
NewMigrator returns a new Migrator.
type MultiEvmHooks ¶
MultiEvmHooks combine multiple evm hooks, all hook functions are run in array sequence
func NewMultiEvmHooks ¶
func NewMultiEvmHooks(hooks ...types.EvmHooks) MultiEvmHooks
NewMultiEvmHooks combine multiple evm hooks
func (MultiEvmHooks) PostTxProcessing ¶
func (mh MultiEvmHooks) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error
PostTxProcessing delegate the call to underlying hooks
type ProposalCounsil ¶ added in v0.12.0
type ProposalCounsil struct {
// contains filtered or unexported fields
}
func NewProposalCounsil ¶ added in v0.12.0
func NewProposalCounsil(k *Keeper, ctx sdk.Context) (*ProposalCounsil, error)
func (*ProposalCounsil) Migrate1to2 ¶ added in v0.12.0
func (pc *ProposalCounsil) Migrate1to2() error
Migrate1to2 for initialize contract on v0.12
func (*ProposalCounsil) UpdateProxyImplementation ¶ added in v0.12.0
func (pc *ProposalCounsil) UpdateProxyImplementation(p *types.UpdateImplmentationProposal) error