Documentation ¶
Index ¶
- Variables
- func GetCoinbaseAddress(txIdx int) sdk.AccAddress
- func SplitUseiWeiAmount(amt *big.Int) (sdk.Int, sdk.Int)
- func TransferWithoutEvents(db vm.StateDB, sender, recipient common.Address, amount *big.Int)
- type DBImpl
- func (s *DBImpl) AddAddressToAccessList(addr common.Address)
- func (s *DBImpl) AddBalance(evmAddr common.Address, amt *big.Int, reason tracing.BalanceChangeReason)
- func (s *DBImpl) AddLog(l *ethtypes.Log)
- func (s *DBImpl) AddPreimage(_ common.Hash, _ []byte)
- func (s *DBImpl) AddRefund(gas uint64)
- func (s *DBImpl) AddSlotToAccessList(addr common.Address, slot common.Hash)
- func (s *DBImpl) AddSurplus(surplus sdk.Int)
- func (s *DBImpl) AddressInAccessList(addr common.Address) bool
- func (s *DBImpl) Commit(uint64, bool) (common.Hash, error)
- func (s *DBImpl) Copy() vm.StateDB
- func (s *DBImpl) CreateAccount(acc common.Address)
- func (s *DBImpl) Created(acc common.Address) bool
- func (s *DBImpl) Ctx() sdk.Context
- func (s *DBImpl) DisableEvents()
- func (s *DBImpl) Empty(addr common.Address) bool
- func (s *DBImpl) EnableEvents()
- func (s *DBImpl) Err() error
- func (s *DBImpl) Error() error
- func (s *DBImpl) Exist(addr common.Address) bool
- func (s *DBImpl) Finalise(bool)
- func (s *DBImpl) Finalize() (surplus sdk.Int, err error)
- func (s *DBImpl) GetAllLogs() []*ethtypes.Log
- func (s *DBImpl) GetBalance(evmAddr common.Address) *big.Int
- func (s *DBImpl) GetCode(addr common.Address) []byte
- func (s *DBImpl) GetCodeHash(addr common.Address) common.Hash
- func (s *DBImpl) GetCodeSize(addr common.Address) int
- func (s *DBImpl) GetCommittedState(addr common.Address, hash common.Hash) common.Hash
- func (s *DBImpl) GetLogs(common.Hash, uint64, common.Hash) []*ethtypes.Log
- func (s *DBImpl) GetNonce(addr common.Address) uint64
- func (s *DBImpl) GetPrecompileError() error
- func (s *DBImpl) GetRefund() uint64
- func (s *DBImpl) GetState(addr common.Address, hash common.Hash) common.Hash
- func (s *DBImpl) GetStorageRoot(common.Address) common.Hash
- func (s *DBImpl) GetTransientState(addr common.Address, key common.Hash) common.Hash
- func (s *DBImpl) HasSelfDestructed(acc common.Address) bool
- func (s *DBImpl) IntermediateRoot(bool) common.Hash
- func (s *DBImpl) MarkAccount(acc common.Address, status []byte)
- func (s *DBImpl) Preimages() map[common.Hash][]byte
- func (s *DBImpl) Prepare(_ params.Rules, sender, coinbase common.Address, dest *common.Address, ...)
- func (s *DBImpl) RevertToSnapshot(rev int)
- func (s *DBImpl) SelfDestruct(acc common.Address)
- func (s *DBImpl) Selfdestruct6780(acc common.Address)
- func (s *DBImpl) SetBalance(evmAddr common.Address, amt *big.Int, reason tracing.BalanceChangeReason)
- func (s *DBImpl) SetCode(addr common.Address, code []byte)
- func (s *DBImpl) SetEVM(evm *vm.EVM)
- func (s *DBImpl) SetLogger(logger *tracing.Hooks)
- func (s *DBImpl) SetNonce(addr common.Address, nonce uint64)
- func (s *DBImpl) SetPrecompileError(err error)
- func (s *DBImpl) SetState(addr common.Address, key common.Hash, val common.Hash)
- func (s *DBImpl) SetStorage(addr common.Address, states map[common.Hash]common.Hash)
- func (s *DBImpl) SetTransientState(addr common.Address, key, val common.Hash)
- func (s *DBImpl) SetTxContext(common.Hash, int)
- func (s *DBImpl) SlotInAccessList(addr common.Address, slot common.Hash) (addressOk bool, slotOk bool)
- func (s *DBImpl) Snapshot() int
- func (s *DBImpl) SubBalance(evmAddr common.Address, amt *big.Int, reason tracing.BalanceChangeReason)
- func (s *DBImpl) SubRefund(gas uint64)
- func (s *DBImpl) TxIndex() int
- func (s *DBImpl) WithCtx(ctx sdk.Context)
- func (s *DBImpl) WithErr(err error)
- type EVMKeeper
- type Logs
- type TemporaryState
Constants ¶
This section is empty.
Variables ¶
var ( // Represents the sum of all unassociated evm account balances // If evm module balance is higher than this value at the end of // the transaction, we need to burn from module balance in order // for this number to align. GasRefundKey = []byte{0x01} LogsKey = []byte{0x02} AccessListKey = []byte{0x03} )
* Transient Module State Keys
var ( AccountCreated = []byte{0x01} AccountDeleted = []byte{0x02} )
* Transient Account State Keys
var CoinbaseAddressPrefix = []byte("evm_coinbase")
var SdkUseiToSweiMultiplier = sdk.NewIntFromBigInt(UseiToSweiMultiplier)
var UseiToSweiMultiplier = big.NewInt(1_000_000_000_000)
UseiToSweiMultiplier Fields that were denominated in usei will be converted to swei (1usei = 10^12swei) for existing Ethereum application (which assumes 18 decimal points) to display properly.
Functions ¶
func GetCoinbaseAddress ¶
func GetCoinbaseAddress(txIdx int) sdk.AccAddress
Types ¶
type DBImpl ¶
type DBImpl struct {
// contains filtered or unexported fields
}
Initialized for each transaction individually
func (*DBImpl) AddAddressToAccessList ¶
func (*DBImpl) AddBalance ¶
func (*DBImpl) AddPreimage ¶
AddPreimage records a SHA3 preimage seen by the VM. AddPreimage performs a no-op since the EnablePreimageRecording flag is disabled on the vm.Config during state transitions. No store trie preimages are written to the database.
func (*DBImpl) AddSlotToAccessList ¶
func (*DBImpl) AddSurplus ¶
func (*DBImpl) CreateAccount ¶
func (*DBImpl) DisableEvents ¶
func (s *DBImpl) DisableEvents()
func (*DBImpl) Empty ¶
Empty returns whether the given account is empty. Empty is defined according to EIP161 (balance = nonce = code = 0).
func (*DBImpl) EnableEvents ¶
func (s *DBImpl) EnableEvents()
func (*DBImpl) Exist ¶
Exist reports whether the given account exists in state. Notably this should also return true for self-destructed accounts.
func (*DBImpl) GetAllLogs ¶
func (*DBImpl) GetCommittedState ¶
func (*DBImpl) GetPrecompileError ¶
func (*DBImpl) GetTransientState ¶
func (*DBImpl) HasSelfDestructed ¶
the Ethereum semantics of HasSelfDestructed checks if the account is self destructed in the **CURRENT** block
func (*DBImpl) RevertToSnapshot ¶
func (*DBImpl) SelfDestruct ¶
debits account's balance. The corresponding credit happens here: https://github.com/sei-protocol/go-ethereum/blob/master/core/vm/instructions.go#L825 clear account's state except the transient state (in Ethereum transient states are still available even after self destruction in the same tx)
func (*DBImpl) Selfdestruct6780 ¶
func (*DBImpl) SetBalance ¶
func (s *DBImpl) SetBalance(evmAddr common.Address, amt *big.Int, reason tracing.BalanceChangeReason)
should only be called during simulation
func (*DBImpl) SetPrecompileError ¶
func (*DBImpl) SetStorage ¶
func (*DBImpl) SetTransientState ¶
func (*DBImpl) SlotInAccessList ¶
func (*DBImpl) SubBalance ¶
type EVMKeeper ¶
type EVMKeeper interface { PrefixStore(sdk.Context, []byte) sdk.KVStore PurgePrefix(sdk.Context, []byte) GetSeiAddress(sdk.Context, common.Address) (sdk.AccAddress, bool) GetSeiAddressOrDefault(ctx sdk.Context, evmAddress common.Address) sdk.AccAddress BankKeeper() bankkeeper.Keeper GetBaseDenom(sdk.Context) string DeleteAddressMapping(sdk.Context, sdk.AccAddress, common.Address) GetCode(sdk.Context, common.Address) []byte SetCode(sdk.Context, common.Address, []byte) GetCodeHash(sdk.Context, common.Address) common.Hash GetCodeSize(sdk.Context, common.Address) int GetState(sdk.Context, common.Address, common.Hash) common.Hash SetState(sdk.Context, common.Address, common.Hash, common.Hash) AccountKeeper() *authkeeper.AccountKeeper GetFeeCollectorAddress(sdk.Context) (common.Address, error) GetNonce(sdk.Context, common.Address) uint64 SetNonce(sdk.Context, common.Address, uint64) PrepareReplayedAddr(ctx sdk.Context, addr common.Address) }
type TemporaryState ¶
type TemporaryState struct {
// contains filtered or unexported fields
}
in-memory state that's generated by a specific EVM snapshot in a single transaction
func NewTemporaryState ¶
func NewTemporaryState() *TemporaryState