3

As you can see in this line,

func (b *LesApiBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header) (*vm.EVM, func() error, error) {
    state.SetBalance(msg.From(), math.MaxBig256)
    context := core.NewEVMContext(msg, header, b.eth.blockchain, nil)
    return vm.NewEVM(context, state, b.eth.chainConfig, vm.Config{}), state.Error, nil
}

The GetEVM function has a side-effect that sets the balance of from address to MaxBig256. What's the logic behind it?

2

This is only the temporary EVM for running tnx to get the value then it doesn't make and changes in the state/blockchain

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.