Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Invalid bytecode generated by neo-boa #40

Closed
brianlenz opened this issue Feb 2, 2018 · 4 comments
Closed

Invalid bytecode generated by neo-boa #40

brianlenz opened this issue Feb 2, 2018 · 4 comments

Comments

@brianlenz
Copy link

We are using neo-boa 0.2.1 in order to work around compiler issues in neo-boa 0.2.2 (see #35).

This issue might have the same root cause as #29, but I'm creating anew since it seems like this issue is manifesting itself in a much worse way, with no identified workaround as of yet.

When issuing a testinvoke, we are getting this kind of response, even though the function only ever returns either True or False:

[I 180202 15:36:54 EventHub:71] [test_mode][SmartContract.Execution.Success] [521ce5bdb87b53f7163217fba66663e605f08fce] [b'kyc_ok', b'pre_end', b'r1', b'\x00\xb8d\xd9E', b'\x00\x90/P\t', b'\x00 _\xa0\x12', b'\x00@\xf0\x9b\xbc\xe1\x08', b'\xad\x0e', b'pub_start', b'r2', b'\x00\xac#\xfc\x06', b'\x00\xad\xd5\xc0\x07', b'r3', b'\x00\xe8vH\x17', b'\x00\xdb\x8bU\x07', b'\x00\xac#\xfc\x06', b'\x10\xe1\xb3Z', b'\xf0\x1e\x02', b'\x00\x00\x8dI\xfd\x1a\x07', b'team_tokens', b'\x80\xad*\\', b'\x00\x80S\xee{\xa8\n', b'company_tokens', b'\x00`\x8f\xc6\x92\xa3"', b'rewards_fund', b'\x00']
Used 1.365 Gas 

-------------------------------------------------------------------------------------------------------------------------------------
Test invoke successful
Total operations: 1365
Results ['Struct: [<neo.VM.InteropService.ByteArray object at 0x109c306d8>, <neo.VM.InteropService.ByteArray object at 0x109c30048>, <neo.VM.InteropService.ByteArray object at 0x109c30940>, <neo.VM.InteropService.ByteArray object at 0x109c30588>, <neo.VM.InteropService.ByteArray object at 0x109c30b70>, <neo.VM.InteropService.ByteArray object at 0x109c30160>, <neo.VM.InteropService.ByteArray object at 0x109c30be0>, <neo.VM.InteropService.ByteArray object at 0x109c30a90>, <neo.VM.InteropService.ByteArray object at 0x109c307b8>, <neo.VM.InteropService.ByteArray object at 0x109c30198>, <neo.VM.InteropService.ByteArray object at 0x109c30c18>, <neo.VM.InteropService.ByteArray object at 0x109c30f28>, <neo.VM.InteropService.ByteArray object at 0x109c30b00>, <neo.VM.InteropService.ByteArray object at 0x109c30cc0>, <neo.VM.InteropService.ByteArray object at 0x109c30dd8>, <neo.VM.InteropService.ByteArray object at 0x109c30ef0>, <neo.VM.InteropService.ByteArray object at 0x109c307f0>, <neo.VM.InteropService.ByteArray object at 0x109c30f98>, <neo.VM.InteropService.ByteArray object at 0x109c30400>, <neo.VM.InteropService.ByteArray object at 0x109c30748>, <neo.VM.InteropService.ByteArray object at 0x109c30ba8>, <neo.VM.InteropService.ByteArray object at 0x10a589390>, <neo.VM.InteropService.ByteArray object at 0x10a5896d8>, <neo.VM.InteropService.ByteArray object at 0x10a589438>, <neo.VM.InteropService.ByteArray object at 0x10a5895f8>] ', "ByteArray: bytearray(b'\\x00')"]
Invoke TX GAS cost: 0.0
Invoke TX fee: 0.001
-------------------------------------------------------------------------------------------------------------------------------------

It seems like the actual value being returned is some kind of full representation of the stack?

If we actually try to invoke it, there are a bunch of different tracebacks as a result:

[E 180202 15:28:11 ExecutionEngine:852] COULD NOT EXECUTE OP: Invalid list operation b'z' ROLL
[E 180202 15:28:11 ExecutionEngine:853] Invalid list operation
    Traceback (most recent call last):
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 850, in StepInto
        self.ExecuteOp(op, self.CurrentContext)
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 299, in ExecuteOp
        estack.PushT(estack.Remove(n))
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/RandomAccessStack.py", line 57, in Remove
        raise Exception("Invalid list operation")
    Exception: Invalid list operation
[I 180202 15:28:11 InteropService:96] Trying to get big integer Array: ['Struct: [<neo.VM.InteropService.ByteArray object at 0x131da17b8>, <neo.VM.InteropService.ByteArray object at 0x131da15f8>, <neo.VM.InteropService.ByteArray object at 0x131da1438>, <neo.VM.InteropService.ByteArray object at 0x131da14e0>, <neo.VM.InteropService.ByteArray object at 0x131da14a8>, <neo.VM.InteropService.ByteArray object at 0x131da1390>, <neo.VM.InteropService.ByteArray object at 0x131da11d0>, <neo.VM.InteropService.ByteArray object at 0x131da1198>, <neo.VM.InteropService.ByteArray object at 0x131da16a0>, <neo.VM.InteropService.ByteArray object at 0x131da10b8>, <neo.VM.InteropService.ByteArray object at 0x131da1f28>, <neo.VM.InteropService.ByteArray object at 0x131da1748>, <neo.VM.InteropService.ByteArray object at 0x131da1160>, <neo.VM.InteropService.ByteArray object at 0x131da1ac8>, <neo.VM.InteropService.ByteArray object at 0x131da1cc0>, <neo.VM.InteropService.ByteArray object at 0x131da1cf8>, <neo.VM.InteropService.ByteArray object at 0x131da1d30>, <neo.VM.InteropService.ByteArray object at 0x131da1d68>, <neo.VM.InteropService.ByteArray object at 0x131da1a90>, <neo.VM.InteropService.ByteArray object at 0x131da1b00>, <neo.VM.InteropService.ByteArray object at 0x131da1b38>, <neo.VM.InteropService.ByteArray object at 0x133116630>, <neo.VM.InteropService.ByteArray object at 0x131da1c18>, <neo.VM.InteropService.ByteArray object at 0x131da1c50>, <neo.VM.InteropService.ByteArray object at 0x131da1da0>] ', 'Struct: [<neo.VM.InteropService.ByteArray object at 0x131da17b8>, <neo.VM.InteropService.ByteArray object at 0x131da15f8>, <neo.VM.InteropService.ByteArray object at 0x131da1438>, <neo.VM.InteropService.ByteArray object at 0x131da14e0>, <neo.VM.InteropService.ByteArray object at 0x131da14a8>, <neo.VM.InteropService.ByteArray object at 0x131da1390>, <neo.VM.InteropService.ByteArray object at 0x131da11d0>, <neo.VM.InteropService.ByteArray object at 0x131da1198>, <neo.VM.InteropService.ByteArray object at 0x131da16a0>, <neo.VM.InteropService.ByteArray object at 0x131da10b8>, <neo.VM.InteropService.ByteArray object at 0x131da1f28>, <neo.VM.InteropService.ByteArray object at 0x131da1748>, <neo.VM.InteropService.ByteArray object at 0x131da1160>, <neo.VM.InteropService.ByteArray object at 0x131da1ac8>, <neo.VM.InteropService.ByteArray object at 0x131da1cc0>, <neo.VM.InteropService.ByteArray object at 0x131da1cf8>, <neo.VM.InteropService.ByteArray object at 0x131da1d30>, <neo.VM.InteropService.ByteArray object at 0x131da1d68>, <neo.VM.InteropService.ByteArray object at 0x131da1a90>, <neo.VM.InteropService.ByteArray object at 0x131da1b00>, <neo.VM.InteropService.ByteArray object at 0x131da1b38>, <neo.VM.InteropService.ByteArray object at 0x133116630>, <neo.VM.InteropService.ByteArray object at 0x131da1c18>, <neo.VM.InteropService.ByteArray object at 0x131da1c50>, <neo.VM.InteropService.ByteArray object at 0x131da1da0>] ', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None'] 
[E 180202 15:28:11 ExecutionEngine:852] COULD NOT EXECUTE OP: Not Supported b'\xc4' SETITEM
[E 180202 15:28:11 ExecutionEngine:853] Not Supported
    Traceback (most recent call last):
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 850, in StepInto
        self.ExecuteOp(op, self.CurrentContext)
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 724, in ExecuteOp
        index = estack.Pop().GetBigInteger()
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/InteropService.py", line 97, in GetBigInteger
        raise Exception("Not Supported")
    Exception: Not Supported
[E 180202 15:28:11 ExecutionEngine:852] COULD NOT EXECUTE OP: Invalid list operation b'z' ROLL
[E 180202 15:28:11 ExecutionEngine:853] Invalid list operation
    Traceback (most recent call last):
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 850, in StepInto
        self.ExecuteOp(op, self.CurrentContext)
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 299, in ExecuteOp
        estack.PushT(estack.Remove(n))
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/RandomAccessStack.py", line 57, in Remove
        raise Exception("Invalid list operation")
    Exception: Invalid list operation
[I 180202 15:28:11 InteropService:96] Trying to get big integer Array: ['Struct: [<neo.VM.InteropService.ByteArray object at 0x131da17b8>, <neo.VM.InteropService.ByteArray object at 0x131da15f8>, <neo.VM.InteropService.ByteArray object at 0x131da1438>, <neo.VM.InteropService.ByteArray object at 0x131da14e0>, <neo.VM.InteropService.ByteArray object at 0x131da14a8>, <neo.VM.InteropService.ByteArray object at 0x131da1390>, <neo.VM.InteropService.ByteArray object at 0x131da11d0>, <neo.VM.InteropService.ByteArray object at 0x131da1198>, <neo.VM.InteropService.ByteArray object at 0x131da16a0>, <neo.VM.InteropService.ByteArray object at 0x131da10b8>, <neo.VM.InteropService.ByteArray object at 0x131da1f28>, <neo.VM.InteropService.ByteArray object at 0x131da1748>, <neo.VM.InteropService.ByteArray object at 0x131da1160>, <neo.VM.InteropService.ByteArray object at 0x131da1ac8>, <neo.VM.InteropService.ByteArray object at 0x131da1cc0>, <neo.VM.InteropService.ByteArray object at 0x131da1cf8>, <neo.VM.InteropService.ByteArray object at 0x131da1d30>, <neo.VM.InteropService.ByteArray object at 0x131da1d68>, <neo.VM.InteropService.ByteArray object at 0x131da1a90>, <neo.VM.InteropService.ByteArray object at 0x131da1b00>, <neo.VM.InteropService.ByteArray object at 0x131da1b38>, <neo.VM.InteropService.ByteArray object at 0x133116630>, <neo.VM.InteropService.ByteArray object at 0x131da1c18>, <neo.VM.InteropService.ByteArray object at 0x131da1c50>, <neo.VM.InteropService.ByteArray object at 0x131da1da0>] ', 'Struct: [<neo.VM.InteropService.ByteArray object at 0x131da17b8>, <neo.VM.InteropService.ByteArray object at 0x131da15f8>, <neo.VM.InteropService.ByteArray object at 0x131da1438>, <neo.VM.InteropService.ByteArray object at 0x131da14e0>, <neo.VM.InteropService.ByteArray object at 0x131da14a8>, <neo.VM.InteropService.ByteArray object at 0x131da1390>, <neo.VM.InteropService.ByteArray object at 0x131da11d0>, <neo.VM.InteropService.ByteArray object at 0x131da1198>, <neo.VM.InteropService.ByteArray object at 0x131da16a0>, <neo.VM.InteropService.ByteArray object at 0x131da10b8>, <neo.VM.InteropService.ByteArray object at 0x131da1f28>, <neo.VM.InteropService.ByteArray object at 0x131da1748>, <neo.VM.InteropService.ByteArray object at 0x131da1160>, <neo.VM.InteropService.ByteArray object at 0x131da1ac8>, <neo.VM.InteropService.ByteArray object at 0x131da1cc0>, <neo.VM.InteropService.ByteArray object at 0x131da1cf8>, <neo.VM.InteropService.ByteArray object at 0x131da1d30>, <neo.VM.InteropService.ByteArray object at 0x131da1d68>, <neo.VM.InteropService.ByteArray object at 0x131da1a90>, <neo.VM.InteropService.ByteArray object at 0x131da1b00>, <neo.VM.InteropService.ByteArray object at 0x131da1b38>, <neo.VM.InteropService.ByteArray object at 0x133116630>, <neo.VM.InteropService.ByteArray object at 0x131da1c18>, <neo.VM.InteropService.ByteArray object at 0x131da1c50>, <neo.VM.InteropService.ByteArray object at 0x131da1da0>] ', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None'] 
[E 180202 15:28:11 ExecutionEngine:852] COULD NOT EXECUTE OP: Not Supported b'\xc4' SETITEM
[E 180202 15:28:11 ExecutionEngine:853] Not Supported
    Traceback (most recent call last):
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 850, in StepInto
        self.ExecuteOp(op, self.CurrentContext)
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 724, in ExecuteOp
        index = estack.Pop().GetBigInteger()
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/InteropService.py", line 97, in GetBigInteger
        raise Exception("Not Supported")
    Exception: Not Supported
[E 180202 15:28:11 ExecutionEngine:852] COULD NOT EXECUTE OP: Invalid list operation b'z' ROLL
[E 180202 15:28:11 ExecutionEngine:853] Invalid list operation
    Traceback (most recent call last):
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 850, in StepInto
        self.ExecuteOp(op, self.CurrentContext)
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 299, in ExecuteOp
        estack.PushT(estack.Remove(n))
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/RandomAccessStack.py", line 57, in Remove
        raise Exception("Invalid list operation")
    Exception: Invalid list operation
[I 180202 15:28:11 InteropService:96] Trying to get big integer Array: ['Struct: [<neo.VM.InteropService.ByteArray object at 0x131da17b8>, <neo.VM.InteropService.ByteArray object at 0x131da15f8>, <neo.VM.InteropService.ByteArray object at 0x131da1438>, <neo.VM.InteropService.ByteArray object at 0x131da14e0>, <neo.VM.InteropService.ByteArray object at 0x131da14a8>, <neo.VM.InteropService.ByteArray object at 0x131da1390>, <neo.VM.InteropService.ByteArray object at 0x131da11d0>, <neo.VM.InteropService.ByteArray object at 0x131da1198>, <neo.VM.InteropService.ByteArray object at 0x131da16a0>, <neo.VM.InteropService.ByteArray object at 0x131da10b8>, <neo.VM.InteropService.ByteArray object at 0x131da1f28>, <neo.VM.InteropService.ByteArray object at 0x131da1748>, <neo.VM.InteropService.ByteArray object at 0x131da1160>, <neo.VM.InteropService.ByteArray object at 0x131da1ac8>, <neo.VM.InteropService.ByteArray object at 0x131da1cc0>, <neo.VM.InteropService.ByteArray object at 0x131da1cf8>, <neo.VM.InteropService.ByteArray object at 0x131da1d30>, <neo.VM.InteropService.ByteArray object at 0x131da1d68>, <neo.VM.InteropService.ByteArray object at 0x131da1a90>, <neo.VM.InteropService.ByteArray object at 0x131da1b00>, <neo.VM.InteropService.ByteArray object at 0x131da1b38>, <neo.VM.InteropService.ByteArray object at 0x133116630>, <neo.VM.InteropService.ByteArray object at 0x131da1c18>, <neo.VM.InteropService.ByteArray object at 0x131da1c50>, <neo.VM.InteropService.ByteArray object at 0x131da1da0>] ', 'Struct: [<neo.VM.InteropService.ByteArray object at 0x131da17b8>, <neo.VM.InteropService.ByteArray object at 0x131da15f8>, <neo.VM.InteropService.ByteArray object at 0x131da1438>, <neo.VM.InteropService.ByteArray object at 0x131da14e0>, <neo.VM.InteropService.ByteArray object at 0x131da14a8>, <neo.VM.InteropService.ByteArray object at 0x131da1390>, <neo.VM.InteropService.ByteArray object at 0x131da11d0>, <neo.VM.InteropService.ByteArray object at 0x131da1198>, <neo.VM.InteropService.ByteArray object at 0x131da16a0>, <neo.VM.InteropService.ByteArray object at 0x131da10b8>, <neo.VM.InteropService.ByteArray object at 0x131da1f28>, <neo.VM.InteropService.ByteArray object at 0x131da1748>, <neo.VM.InteropService.ByteArray object at 0x131da1160>, <neo.VM.InteropService.ByteArray object at 0x131da1ac8>, <neo.VM.InteropService.ByteArray object at 0x131da1cc0>, <neo.VM.InteropService.ByteArray object at 0x131da1cf8>, <neo.VM.InteropService.ByteArray object at 0x131da1d30>, <neo.VM.InteropService.ByteArray object at 0x131da1d68>, <neo.VM.InteropService.ByteArray object at 0x131da1a90>, <neo.VM.InteropService.ByteArray object at 0x131da1b00>, <neo.VM.InteropService.ByteArray object at 0x131da1b38>, <neo.VM.InteropService.ByteArray object at 0x133116630>, <neo.VM.InteropService.ByteArray object at 0x131da1c18>, <neo.VM.InteropService.ByteArray object at 0x131da1c50>, <neo.VM.InteropService.ByteArray object at 0x131da1da0>] ', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None'] 
[E 180202 15:28:11 ExecutionEngine:852] COULD NOT EXECUTE OP: Not Supported b'\xc4' SETITEM
[E 180202 15:28:11 ExecutionEngine:853] Not Supported
    Traceback (most recent call last):
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 850, in StepInto
        self.ExecuteOp(op, self.CurrentContext)
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 724, in ExecuteOp
        index = estack.Pop().GetBigInteger()
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/InteropService.py", line 97, in GetBigInteger
        raise Exception("Not Supported")
    Exception: Not Supported
[E 180202 15:28:11 ExecutionEngine:852] COULD NOT EXECUTE OP: Invalid list operation b'z' ROLL
[E 180202 15:28:11 ExecutionEngine:853] Invalid list operation
    Traceback (most recent call last):
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 850, in StepInto
        self.ExecuteOp(op, self.CurrentContext)
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 299, in ExecuteOp
        estack.PushT(estack.Remove(n))
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/RandomAccessStack.py", line 57, in Remove
        raise Exception("Invalid list operation")
    Exception: Invalid list operation
[I 180202 15:28:11 InteropService:96] Trying to get big integer Array: ['Struct: [<neo.VM.InteropService.ByteArray object at 0x131da17b8>, <neo.VM.InteropService.ByteArray object at 0x131da15f8>, <neo.VM.InteropService.ByteArray object at 0x131da1438>, <neo.VM.InteropService.ByteArray object at 0x131da14e0>, <neo.VM.InteropService.ByteArray object at 0x131da14a8>, <neo.VM.InteropService.ByteArray object at 0x131da1390>, <neo.VM.InteropService.ByteArray object at 0x131da11d0>, <neo.VM.InteropService.ByteArray object at 0x131da1198>, <neo.VM.InteropService.ByteArray object at 0x131da16a0>, <neo.VM.InteropService.ByteArray object at 0x131da10b8>, <neo.VM.InteropService.ByteArray object at 0x131da1f28>, <neo.VM.InteropService.ByteArray object at 0x131da1748>, <neo.VM.InteropService.ByteArray object at 0x131da1160>, <neo.VM.InteropService.ByteArray object at 0x131da1ac8>, <neo.VM.InteropService.ByteArray object at 0x131da1cc0>, <neo.VM.InteropService.ByteArray object at 0x131da1cf8>, <neo.VM.InteropService.ByteArray object at 0x131da1d30>, <neo.VM.InteropService.ByteArray object at 0x131da1d68>, <neo.VM.InteropService.ByteArray object at 0x131da1a90>, <neo.VM.InteropService.ByteArray object at 0x131da1b00>, <neo.VM.InteropService.ByteArray object at 0x131da1b38>, <neo.VM.InteropService.ByteArray object at 0x133116630>, <neo.VM.InteropService.ByteArray object at 0x131da1c18>, <neo.VM.InteropService.ByteArray object at 0x131da1c50>, <neo.VM.InteropService.ByteArray object at 0x131da1da0>] ', 'Struct: [<neo.VM.InteropService.ByteArray object at 0x131da17b8>, <neo.VM.InteropService.ByteArray object at 0x131da15f8>, <neo.VM.InteropService.ByteArray object at 0x131da1438>, <neo.VM.InteropService.ByteArray object at 0x131da14e0>, <neo.VM.InteropService.ByteArray object at 0x131da14a8>, <neo.VM.InteropService.ByteArray object at 0x131da1390>, <neo.VM.InteropService.ByteArray object at 0x131da11d0>, <neo.VM.InteropService.ByteArray object at 0x131da1198>, <neo.VM.InteropService.ByteArray object at 0x131da16a0>, <neo.VM.InteropService.ByteArray object at 0x131da10b8>, <neo.VM.InteropService.ByteArray object at 0x131da1f28>, <neo.VM.InteropService.ByteArray object at 0x131da1748>, <neo.VM.InteropService.ByteArray object at 0x131da1160>, <neo.VM.InteropService.ByteArray object at 0x131da1ac8>, <neo.VM.InteropService.ByteArray object at 0x131da1cc0>, <neo.VM.InteropService.ByteArray object at 0x131da1cf8>, <neo.VM.InteropService.ByteArray object at 0x131da1d30>, <neo.VM.InteropService.ByteArray object at 0x131da1d68>, <neo.VM.InteropService.ByteArray object at 0x131da1a90>, <neo.VM.InteropService.ByteArray object at 0x131da1b00>, <neo.VM.InteropService.ByteArray object at 0x131da1b38>, <neo.VM.InteropService.ByteArray object at 0x133116630>, <neo.VM.InteropService.ByteArray object at 0x131da1c18>, <neo.VM.InteropService.ByteArray object at 0x131da1c50>, <neo.VM.InteropService.ByteArray object at 0x131da1da0>] ', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None'] 
[E 180202 15:28:11 ExecutionEngine:852] COULD NOT EXECUTE OP: Not Supported b'\xc4' SETITEM
[E 180202 15:28:11 ExecutionEngine:853] Not Supported
    Traceback (most recent call last):
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 850, in StepInto
        self.ExecuteOp(op, self.CurrentContext)
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 724, in ExecuteOp
        index = estack.Pop().GetBigInteger()
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/InteropService.py", line 97, in GetBigInteger
        raise Exception("Not Supported")
    Exception: Not Supported
[E 180202 15:28:11 ExecutionEngine:852] COULD NOT EXECUTE OP: 'NoneType' object has no attribute 'IsArray' b'\xc3' PICKITEM
[E 180202 15:28:11 ExecutionEngine:853] 'NoneType' object has no attribute 'IsArray'
    Traceback (most recent call last):
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 850, in StepInto
        self.ExecuteOp(op, self.CurrentContext)
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 705, in ExecuteOp
        if not item.IsArray:
    AttributeError: 'NoneType' object has no attribute 'IsArray'
[E 180202 15:28:11 ExecutionEngine:852] COULD NOT EXECUTE OP: Invalid list operation b'|' SWAP
[E 180202 15:28:11 ExecutionEngine:853] Invalid list operation
    Traceback (most recent call last):
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 850, in StepInto
        self.ExecuteOp(op, self.CurrentContext)
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/ExecutionEngine.py", line 313, in ExecuteOp
        x1 = estack.Pop()
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/RandomAccessStack.py", line 45, in Pop
        return self.Remove(0)
      File "/Users/brian/Projects/Narrative/neo-python/neo/VM/RandomAccessStack.py", line 57, in Remove
        raise Exception("Invalid list operation")
    Exception: Invalid list operation
[E 180202 15:28:11 StateMachine:453] could not get storage context Invalid list operation 
[I 180202 15:28:11 EventHub:71] [test_mode][SmartContract.Storage.Get] [6e945ca41064e1c451d11a7a4eaa84d119c7cfbc] ["b'owner' -> bytearray(b'\\xde\\xf3Z-\\x0ci\\xfe\\xb9\\xc4\\xcc\\x96p\\x1f\\xd4\\xdb\\x8fZ\\x044\\x00')"]
[I 180202 15:28:11 EventHub:71] [test_mode][SmartContract.Storage.Get] [6e945ca41064e1c451d11a7a4eaa84d119c7cfbc] ["b'team_tokens' -> bytearray(b'')"]
[I 180202 15:28:11 EventHub:71] [test_mode][SmartContract.Storage.Put] [6e945ca41064e1c451d11a7a4eaa84d119c7cfbc] ["b'team_tokens' -> bytearray(b'\\x00\\x80\\xc6\\xa4~\\x8d\\x03')"]
[I 180202 15:28:11 EventHub:71] [test_mode][SmartContract.Execution.Fail] [6e945ca41064e1c451d11a7a4eaa84d119c7cfbc] [None, 6]
Error testing contract invoke
@brianlenz
Copy link
Author

I have an update! After many hours of testing and trying different things, I was able to come up with a couple of hacks that work around this issue. I'll post exact steps to reproduce the issue here, which will hopefully be helpful.

Here is the commit that works around the two issues we identified, with appropriate notes and comments:

NarrativeCompany/tokensale-neo-smartcontract@e50a00f

Here is the prior version that is broken:

https://github.com/NarrativeNetwork/tokensale-neo-smartcontract/tree/0b6bb33008a9222757fa398bdf52c70d7b4f5c23

Steps to reproduce the issue:

Edit original_owner in nrvtoken.py to be the script hash of the address you'll deploy from.

Compile and deploy ico_template.py.

Run the following to bootstrap the contract:

testinvoke {script_hash} deploy []

Then, just run any of the following to see the issue:

testinvoke {script_hash} transfer_team_tokens ['{addr}',1]
testinvoke {script_hash} transfer_company_tokens ['{addr}',1]
testinvoke {script_hash} mint_rewards_tokens ['{addr}',1]

You can use any address for {addr}; it's just the destination address where the tokens will be minted to.

Then, try again with the updated version:

https://github.com/NarrativeNetwork/tokensale-neo-smartcontract/tree/master

You should see that it works properly after the changes.

@thdxr
Copy link

thdxr commented Feb 18, 2018

I'm running into this problem as well. Is the issue that a function cannot call another function?

@localhuman
Copy link
Collaborator

This should be resolved in v0.3.3

@localhuman
Copy link
Collaborator

Going to close this one out.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants