|
|
@ -2,9 +2,9 @@ import logging |
|
|
|
import json |
|
|
|
import json |
|
|
|
import operator |
|
|
|
import operator |
|
|
|
from jinja2 import PackageLoader, Environment |
|
|
|
from jinja2 import PackageLoader, Environment |
|
|
|
|
|
|
|
import sha3 |
|
|
|
import hashlib |
|
|
|
import hashlib |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Issue: |
|
|
|
class Issue: |
|
|
|
def __init__( |
|
|
|
def __init__( |
|
|
|
self, |
|
|
|
self, |
|
|
@ -32,9 +32,9 @@ class Issue: |
|
|
|
self.lineno = None |
|
|
|
self.lineno = None |
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
|
try: |
|
|
|
s = hashlib.sha3_256() |
|
|
|
keccak = sha3.keccak_256() |
|
|
|
s.update(bytes.fromhex(bytecode)) |
|
|
|
keccak.update(bytes.fromhex(bytecode)) |
|
|
|
self.bytecode_hash = "0x" + s.hexdigest() |
|
|
|
self.bytecode_hash = "0x" + keccak.hexdigest() |
|
|
|
except ValueError: |
|
|
|
except ValueError: |
|
|
|
logging.debug("Unable to change the bytecode to bytes. Bytecode: {}".format(bytecode)) |
|
|
|
logging.debug("Unable to change the bytecode to bytes. Bytecode: {}".format(bytecode)) |
|
|
|
self.bytecode_hash = "" |
|
|
|
self.bytecode_hash = "" |
|
|
|