From 2774fc65a26fdeecaf79a373510647bfec7f009c Mon Sep 17 00:00:00 2001 From: Joran Honig Date: Wed, 24 Oct 2018 21:27:38 +0200 Subject: [PATCH] update hashing technique used --- mythril/analysis/report.py | 8 ++++---- solidity_examples/rubixi.sol | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mythril/analysis/report.py b/mythril/analysis/report.py index e4443cfa..5d79bcf9 100644 --- a/mythril/analysis/report.py +++ b/mythril/analysis/report.py @@ -2,9 +2,9 @@ import logging import json import operator from jinja2 import PackageLoader, Environment +import sha3 import hashlib - class Issue: def __init__( self, @@ -32,9 +32,9 @@ class Issue: self.lineno = None try: - s = hashlib.sha3_256() - s.update(bytes.fromhex(bytecode)) - self.bytecode_hash = "0x" + s.hexdigest() + keccak = sha3.keccak_256() + keccak.update(bytes.fromhex(bytecode)) + self.bytecode_hash = "0x" + keccak.hexdigest() except ValueError: logging.debug("Unable to change the bytecode to bytes. Bytecode: {}".format(bytecode)) self.bytecode_hash = "" diff --git a/solidity_examples/rubixi.sol b/solidity_examples/rubixi.sol index 91fda1b6..301e9196 100644 --- a/solidity_examples/rubixi.sol +++ b/solidity_examples/rubixi.sol @@ -26,7 +26,7 @@ contract Rubixi { Participant[] private participants; //Fallback function - function() { + function() payable { init(); }