F2F: Fix crushes of the contracts containing non-ascii characters

Challenge: https://www.topcoder.com/challenges/30066271
Submission: 525176
Author: N1k1tung
pull/273/head
Dr. Sergey Pogodin 7 years ago
parent a0db35bade
commit a54a3fe919
  1. 2
      mythril/ether/soliditycontract.py
  2. 6
      tests/testdata/input_contracts/nonascii.sol
  3. 42097
      tests/testdata/outputs_expected_laser_result/nonascii.sol.json

@ -36,7 +36,7 @@ class SolidityContract(ETHContract):
self.solidity_files = [] self.solidity_files = []
for filename in data['sourceList']: for filename in data['sourceList']:
with open(filename, 'r') as file: with open(filename, 'r', encoding='utf-8') as file:
code = file.read() code = file.read()
self.solidity_files.append(SolidityFile(filename, code)) self.solidity_files.append(SolidityFile(filename, code))

@ -0,0 +1,6 @@
pragma solidity ^0.4.22;
contract nonAscii {
function renderNonAscii () public pure returns (string) {
return "Хэллоу Ворлд";
}
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save