Skip to content

reddio #324

@0XGuRuX0

Description

@0XGuRuX0

type Solidity struct {
*tripod.Tripod
ethState *EthState
cfg *GethConfig
stateConfig *config.Config
}

func newEVM(cfg *GethConfig) *vm.EVM {
return vm.NewEVM(blockContext, txContext,
cfg.State, cfg.ChainConfig, cfg.EVMConfig)
}

func (s *Solidity) ExecuteTxn(ctx *context.WriteContext) (err error) {
txReq := new(TxRequest)
err = ctx.BindJson(txReq)

vmenv := newEVM(cfg)
vmenv.StateDB = pending_state.NewPendingState(s.ethState.stateDB)


sender := vm.AccountRef(txReq.Origin)
rules := cfg.ChainConfig.Rules(vmenv.Context.BlockNumber, 
vmenv.Context.Random != nil, vmenv.Context.Time)

if txReq.Address == zeroAddress {
	return executeContractCreation(txReq, ethstate, cfg, 
    vmenv, sender, rules)
} else {
	return executeContractCall(txReq, ethstate, cfg, vmenv, 
    sender, rules)
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions