aboutsummaryrefslogtreecommitdiff
path: root/core/vm
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2020-07-29 12:01:05 -0400
committerDeterminant <[email protected]>2020-07-29 12:01:05 -0400
commit1f49826de2bb8bb4f5f99f69fd2beb039b1172d9 (patch)
tree4db4d3687f89f55c42898ba12e59e2236da03558 /core/vm
parent67ae6a33a4bfd74dad0a043f07f91647d34cff8d (diff)
clean upmulti-coin
Diffstat (limited to 'core/vm')
-rw-r--r--core/vm/interpreter.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go
index 3d388d6..e23896a 100644
--- a/core/vm/interpreter.go
+++ b/core/vm/interpreter.go
@@ -26,6 +26,13 @@ import (
"github.com/ava-labs/go-ethereum/log"
)
+var (
+ BuiltinAddr = common.Address{
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ }
+)
+
// Config are the configuration options for the Interpreter
type Config struct {
Debug bool // Enables debugging
@@ -131,6 +138,13 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter {
// considered a revert-and-consume-all-gas operation except for
// errExecutionReverted which means revert-and-keep-gas-left.
func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (ret []byte, err error) {
+ if contract.Address() == BuiltinAddr {
+ self := AccountRef(contract.Caller())
+ if _, ok := contract.caller.(*Contract); ok {
+ contract = contract.AsDelegate()
+ }
+ contract.self = self
+ }
if in.intPool == nil {
in.intPool = poolOfIntPools.get()
defer func() {