update hashing technique used

pull/611/head
Joran Honig 6 years ago
parent 6f69858fbe
commit 2774fc65a2
  1. 8
      mythril/analysis/report.py
  2. 2
      solidity_examples/rubixi.sol

@ -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 = ""

@ -26,7 +26,7 @@ contract Rubixi {
Participant[] private participants;
//Fallback function
function() {
function() payable {
init();
}

Loading…
Cancel
Save