Move the v, r, s for catching exception

pull/326/head
Nikhil Parasaram 6 years ago
parent d4417a24b3
commit 24712509fb
  1. 8
      mythril/laser/ethereum/natives.py

@ -32,14 +32,16 @@ def extract32(data, i):
def ecrecover(data):
try:
data = bytearray(data)
except TypeError:
raise NativeContractException
message = b''.join([ALL_BYTES[x] for x in data[0:32]])
v = extract32(data, 32)
r = extract32(data, 64)
s = extract32(data, 96)
except TypeError:
raise NativeContractException
message = b''.join([ALL_BYTES[x] for x in data[0:32]])
if r >= secp256k1n or s >= secp256k1n or v < 27 or v > 28:
return []
try:

Loading…
Cancel
Save