Skip to content
Snippets Groups Projects
Unverified Commit c7933f09 authored by RJ Catalano's avatar RJ Catalano
Browse files

fixes snative calls from solc


Signed-off-by: default avatarRJ Catalano <rj@monax.io>
parent 3d0481a8
No related branches found
No related tags found
No related merge requests found
...@@ -567,13 +567,17 @@ func (vm *VM) call(caller, callee *Account, code, input []byte, value int64, gas ...@@ -567,13 +567,17 @@ func (vm *VM) call(caller, callee *Account, code, input []byte, value int64, gas
} }
acc := vm.appState.GetAccount(addr) acc := vm.appState.GetAccount(addr)
if acc == nil { if acc == nil {
return nil, firstErr(err, ErrUnknownAddress) if _, ok := registeredNativeContracts[addr]; !ok {
return nil, firstErr(err, ErrUnknownAddress)
}
stack.Push64(int64(1))
dbg.Printf(" => Hit native contract\n")
} else {
code := acc.Code
l := int64(len(code))
stack.Push64(l)
dbg.Printf(" => %d\n", l)
} }
code := acc.Code
l := int64(len(code))
stack.Push64(l)
dbg.Printf(" => %d\n", l)
case EXTCODECOPY: // 0x3C case EXTCODECOPY: // 0x3C
addr := stack.Pop() addr := stack.Pop()
if useGasNegative(gas, GasGetAccount, &err) { if useGasNegative(gas, GasGetAccount, &err) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment