Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Latest solidity support #393

Open
mstad opened this issue May 11, 2020 · 58 comments
Open

Latest solidity support #393

mstad opened this issue May 11, 2020 · 58 comments

Comments

@mstad
Copy link

mstad commented May 11, 2020

Hi,
is the last solidity supported 0.4.24? (I tried to compile contract using 0.5.x release and I receive an error). Is there a way to overcome these limitations?

@yxliang01
Copy link
Contributor

Hi @mstad , the latest official supported version is indeed 0.4 . It would be great if you can post 1. the minimum contract written in Solidity 0.5 that can't be run 2. the error you received here. Then, we can try to see how to overcome these.

@mstad
Copy link
Author

mstad commented May 11, 2020

Hi @yxliang01, as soon as I tried to analyze a contract (the contract has the pragma >0.5.0, and the solc that I have installed is the 0.5.15 release), I receive the error of 'compilation failed.' Analyzing it with -ce option, I receive the comment that the last supported solc release is 0.4.19.
I try to use the prebuild docker container and to build a new one from Github. Have I to try something different?

@yxliang01
Copy link
Contributor

No, the message of the officially supported version is not an error. Would be great if you can paste the contract and the full output log here.

@mstad
Copy link
Author

mstad commented May 11, 2020

The output is

WARNING:root:You are using an untested version of z3. 4.5.1 is the officially tested version
WARNING:root:You are using evm version 1.9.9. The supported version is 1.7.3
WARNING:root:You are using solc version 0.5.15, The latest supported version is 0.4.19
CRITICAL:root:Warning: This is a pre-release compiler version, please do not use it in production.

CRITICAL:root:Solidity compilation failed.

The file is:

pragma solidity >=0.5.0 < 0.6.0;

contract Ownable {
address public owner;

constructor () public {
    owner = msg.sender;
}

modifier onlyOwner() {
    require(msg.sender == owner);
    _;
}

function transferOwnership(address newOwner) public onlyOwner {
    if (newOwner != address(0)) {
        owner = newOwner;
    }
}

}

Note that I am using the Oyente build just-now; using the prebuild docker oyente, I had only this lines as warnings and errors:

WARNING:root:You are using solc version 0.5.15, The latest supported version is 0.4.19
CRITICAL:root:Warning: This is a pre-release compiler version, please do not use it in production.

CRITICAL:root:Solidity compilation failed.

Thanks

@yxliang01
Copy link
Contributor

@mstad Would you like to

  1. Build a new docker image from this master branch
  2. Use the -ce flag to see the error messages
    ?

@mstad
Copy link
Author

mstad commented May 13, 2020

Hi, sorry for the delay.

I build oyente docker container from the master branch as oyente.

Now, I am trying to using it sharing the directory in which I have some contract, but it retunr that it
does not find any file. Where I made a (for sure stupid) mistake?

docker run -it -v /home/.../simple_contracts/:/share oyente /share/myContract.sol -ce


CRITICAL:root:Skipping non-existent input file ""/share/myContract_0.5.15.sol""

CRITICAL:root:Solidity compilation failed.


@yxliang01
Copy link
Contributor

Why is the supplied path in docker run command is different from the one in error message?

@mstad
Copy link
Author

mstad commented May 13, 2020

The error message reports the path that in my intention was shared in the container... but I made a mistake, I think...

@yxliang01
Copy link
Contributor

@mstad I meant that the error message doesn't seem to correspond to the command you have pasted.

@mstad
Copy link
Author

mstad commented May 13, 2020

@yxliang01

you are totally right, I put the wrong filename... Inserting the right command, I receive an error

related to constructor. I attach the command, the error and the file. Thanks so much.


docker run -it -v /home/mirkostad/Programmi/perl/simple_contracts/:/share oyente -s /share/my.sol -ce

CRITICAL:root:/share/my.sol:7:16: Error: Expected identifier, got 'LParen'
constructor() public {
^

CRITICAL:root:Solidity compilation failed.


my.sol

pragma solidity >=0.5.0 < 0.6.0;

contract MyContract {

address owner;

constructor() public {
    owner = msg.sender;
}

function sendTo(address payable receiver, uint amount) public {
    require(tx.origin == owner);
    receiver.transfer(amount);
}

}


@yxliang01
Copy link
Contributor

@mstad I believe you are using the old solc 0.4.19 since it's the default version specified in the dockerfile. Therefore, it makes sense that it doesn't recognize the constructor keyword (added in 0.4.23) .

Would you like to simply try to use the latest 0.5 solc and see whether it works? A quick way is that you add --build-arg SOLC_VERSION=0.5.17 to the docker build command, and it might work straightaway.

P.S. You might want to care the comment formatting a bit :)

@mstad
Copy link
Author

mstad commented May 13, 2020

@yxliang01 I'll try to rebuild it now and I let you know asap. You are right for the formatting...

@mstad
Copy link
Author

mstad commented May 14, 2020

Hi, I tries to build the docker from master using:
$ docker build --build-arg SOLC_VERSION=0.5.15 -t oyente .
Then I launched Oyente and this is the output:
$ docker run -it -v /home/mirkostad/Programmi/perl/simple_contracts/:/share oyente -s /share/my.sol -ce
WARNING:root:You are using solc version 0.5.15, The latest supported version is 0.4.19
CRITICAL:root:
CRITICAL:root:Solidity compilation failed.

@yxliang01
Copy link
Contributor

@mstad Looks like the error might be in the stdout. I have just added stdout output of solc when compilation failed. Could you pull the latest master and build again, then run in the same manner?

@mstad
Copy link
Author

mstad commented May 14, 2020

@yxliang01 I'll do it now.

@mstad
Copy link
Author

mstad commented May 14, 2020

Hi, i'll tried and I received this output:
docker run -it -v /home/mirkostad/Programmi/perl/simple_contracts/:/share oyente -s /share/my.sol -ce
WARNING:root:You are using solc version 0.5.15, The latest supported version is 0.4.19
CRITICAL:root:solc output:

======= /share/my.sol:MyContract =======
Binary of the runtime part:
608060405234801561001057600080fd5b506004361061002b5760003560e01c80639e1a00aa14610030575b600080fd5b61007c6004803603604081101561004657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061007e565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16146100d757600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561011d573d6000803e3d6000fd5b50505056fea265627a7a723158206396e1cca8bf7327e62560d3816ad8bb68800c0a198ab8d2dad3f37c7b3b0e6d64736f6c634300050f0032

CRITICAL:root:
CRITICAL:root:Solidity compilation failed.

@yxliang01
Copy link
Contributor

@mstad the compilation succeeded, this means that it is the logic to extract the binary code is not supporting the new solc. Would you like to try branch fix-new-solc and see whether it works?

@mstad
Copy link
Author

mstad commented May 15, 2020

@yxliang01 Yes, I would try to do it.

@mstad
Copy link
Author

mstad commented May 16, 2020

@yxliang01 I build the container from fix-new-solc branch:
$ docker build --build-arg SOLC_VERSION=0.5.15 -t oyente .
I receive the following output:
docker run -it -v /home/mirkostad/Programmi/smart-contracts/Original/:/share oyente_mod:latest -s /share/0x1c_fixed.sol -ce
WARNING:root:You are using solc version 0.5.15, The latest supported version is 0.4.19
incomplete push instruction at 134
incomplete push instruction at 1318
incomplete push instruction at 60
Traceback (most recent call last):
File "/oyente/oyente/oyente.py", line 222, in
main()
File "/oyente/oyente/oyente.py", line 217, in main
exit_code = analyze_solidity()
File "/oyente/oyente/oyente.py", line 109, in analyze_solidity
inputs = helper.get_inputs()
File "/oyente/oyente/input_helper.py", line 75, in get_inputs
source_map = SourceMap(contract, self.source, 'solidity', self.root_path, self.remap, self.allow_paths)
File "/oyente/oyente/source_map.py", line 50, in init
self.source = self._get_source()
File "/oyente/oyente/source_map.py", line 139, in _get_source
SourceMap.sources[fname] = Source(fname)
File "/oyente/oyente/source_map.py", line 14, in init
self.content = self._load_content()
File "/oyente/oyente/source_map.py", line 19, in _load_content
content = f.read()
File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 83: ordinal not in range(128)
with the file
0x1c_fixed.txt
I do not know if I can try something different to try to use it with 0.5.x or it is not possible,

@yxliang01
Copy link
Contributor

@mstad Thanks again for testing. Looks like the previous patch fixed the compilation result passing problem which means we have made one step forward! According to this error message, I have just pushed new patch to branch fix-new-solc, would you like to try it again with this contract?

@mstad
Copy link
Author

mstad commented May 18, 2020

@yxliang01 Hi,i tried to use the fix-new-solc branch. I build the new container and tried the same contract. The analysis is not complete, but the output is slighlty different than before:
docker run -it -v /home/mirkostad/Programmi/smart-contracts/Original/:/share oyente_mod:latest -s /share/0x1c_fixed.sol -ce
WARNING:root:You are using solc version 0.5.15, The latest supported version is 0.4.19
incomplete push instruction at 134
incomplete push instruction at 1318
incomplete push instruction at 60
INFO:root:contract /share/0x1c_fixed.sol:ACL:
INFO:symExec: ============ Results ===========
Traceback (most recent call last):
File "/oyente/oyente/oyente.py", line 222, in
main()
File "/oyente/oyente/oyente.py", line 217, in main
exit_code = analyze_solidity()
File "/oyente/oyente/oyente.py", line 110, in analyze_solidity
results, exit_code = run_solidity_analysis(inputs)
File "/oyente/oyente/oyente.py", line 87, in run_solidity_analysis
result, return_code = symExec.run(disasm_file=inp['disasm_file'], source_map=inp['source_map'], source_file=inp['source'])
File "/oyente/oyente/symExec.py", line 2458, in run
analyze()
File "/oyente/oyente/symExec.py", line 2441, in analyze
run_build_cfg_and_analyze(timeout_cb=timeout_cb)
File "/oyente/oyente/symExec.py", line 2398, in run_build_cfg_and_analyze
build_cfg_and_analyze()
File "/oyente/oyente/symExec.py", line 225, in build_cfg_and_analyze
collect_vertices(tokens)
File "/oyente/oyente/symExec.py", line 341, in collect_vertices
idx = mapping_non_push_instruction(current_line_content, current_ins_address, idx, positions, length) if g_src_map else None
File "/oyente/oyente/symExec.py", line 281, in mapping_non_push_instruction
raise Exception("Source map error")
Exception: Source map error

@yxliang01
Copy link
Contributor

yxliang01 commented May 18, 2020

@mstad This means we moved one step again! I've made a new commit to the branch to print more information message for addressing this issue.

@mstad
Copy link
Author

mstad commented May 18, 2020

@yxliang01 Hi, i put here the new error message from the same file.
docker run -it -v /home/mirkostad/Programmi/smart-contracts/Original/:/share oyente_mod:latest -s /share/0x1c_fixed.sol -ce
WARNING:root:You are using solc version 0.5.15, The latest supported version is 0.4.19
incomplete push instruction at 134
incomplete push instruction at 1318
incomplete push instruction at 60
INFO:root:contract /share/0x1c_fixed.sol:ACL:
INFO:symExec: ============ Results ===========
Traceback (most recent call last):
File "/oyente/oyente/oyente.py", line 222, in
main()
File "/oyente/oyente/oyente.py", line 217, in main
exit_code = analyze_solidity()
File "/oyente/oyente/oyente.py", line 110, in analyze_solidity
results, exit_code = run_solidity_analysis(inputs)
File "/oyente/oyente/oyente.py", line 87, in run_solidity_analysis
result, return_code = symExec.run(disasm_file=inp['disasm_file'], source_map=inp['source_map'], source_file=inp['source'])
File "/oyente/oyente/symExec.py", line 2458, in run
analyze()
File "/oyente/oyente/symExec.py", line 2441, in analyze
run_build_cfg_and_analyze(timeout_cb=timeout_cb)
File "/oyente/oyente/symExec.py", line 2398, in run_build_cfg_and_analyze
build_cfg_and_analyze()
File "/oyente/oyente/symExec.py", line 225, in build_cfg_and_analyze
collect_vertices(tokens)
File "/oyente/oyente/symExec.py", line 341, in collect_vertices
idx = mapping_non_push_instruction(current_line_content, current_ins_address, idx, positions, length) if g_src_map else None
File "/oyente/oyente/symExec.py", line 281, in mapping_non_push_instruction
raise RuntimeError(F"Source map error, unknown name({name}) or instr_name({instr_name})")
RuntimeError: Source map error, unknown name(SHR) or instr_name(INVALID)

@mstad
Copy link
Author

mstad commented May 20, 2020

@yxliang01 Hi, do you have some news about it?

@yxliang01
Copy link
Contributor

Hi @mstad , I think I need more information. Can you run with --verbose option?

@mstad
Copy link
Author

mstad commented May 20, 2020

Hi, this are results with --verbose option; the file is attached.
0x1c_fixed.txt
docker run -it -v /home/mirkostad/Programmi/smart-contracts/Original/:/share oyente_mod:latest -s /share/0x1c_fixed.sol --verbose
WARNING:root:You are using solc version 0.5.15, The latest supported version is 0.4.19
incomplete push instruction at 134
incomplete push instruction at 1318
incomplete push instruction at 60
INFO:root:contract /share/0x1c_fixed.sol:ACL:
INFO:symExec: ============ Results ===========
DEBUG:symExec:PUSH1 0x80
DEBUG:symExec:PUSH1 0x40
DEBUG:symExec:MSTORE
DEBUG:symExec:CALLVALUE
DEBUG:symExec:DUP1
DEBUG:symExec:ISZERO
DEBUG:symExec:PUSH2 0x0010
DEBUG:symExec:JUMPI
DEBUG:symExec:PUSH1 0x00
DEBUG:symExec:DUP1
DEBUG:symExec:REVERT
DEBUG:symExec:JUMPDEST
DEBUG:symExec:POP
DEBUG:symExec:PUSH1 0x04
DEBUG:symExec:CALLDATASIZE
DEBUG:symExec:LT
DEBUG:symExec:PUSH2 0x0093
DEBUG:symExec:JUMPI
DEBUG:symExec:PUSH1 0x00
DEBUG:symExec:CALLDATALOAD
DEBUG:symExec:PUSH1 0xe0
DEBUG:symExec:INVALID 0x1c
Traceback (most recent call last):
File "/oyente/oyente/oyente.py", line 222, in
main()
File "/oyente/oyente/oyente.py", line 217, in main
exit_code = analyze_solidity()
File "/oyente/oyente/oyente.py", line 110, in analyze_solidity
results, exit_code = run_solidity_analysis(inputs)
File "/oyente/oyente/oyente.py", line 87, in run_solidity_analysis
result, return_code = symExec.run(disasm_file=inp['disasm_file'], source_map=inp['source_map'], source_file=inp['source'])
File "/oyente/oyente/symExec.py", line 2458, in run
analyze()
File "/oyente/oyente/symExec.py", line 2441, in analyze
run_build_cfg_and_analyze(timeout_cb=timeout_cb)
File "/oyente/oyente/symExec.py", line 2398, in run_build_cfg_and_analyze
build_cfg_and_analyze()
File "/oyente/oyente/symExec.py", line 225, in build_cfg_and_analyze
collect_vertices(tokens)
File "/oyente/oyente/symExec.py", line 341, in collect_vertices
idx = mapping_non_push_instruction(current_line_content, current_ins_address, idx, positions, length) if g_src_map else None
File "/oyente/oyente/symExec.py", line 281, in mapping_non_push_instruction
raise RuntimeError(F"Source map error, unknown name({name}) or instr_name({instr_name})")
RuntimeError: Source map error, unknown name(SHR) or instr_name(INVALID)

@yxliang01
Copy link
Contributor

@mstad Thanks again.

So, I think this exposes the following issues:

  1. your contract has opcode that is unsupported
  2. evm version too low to understand the opcode
  3. (potentially) parsing of new evm might be unsupported

To address them, we need to first try to build the image with --build-arg=ETHEREUM_VERSION=alltools-v1.9.14, then inspect the log.

@mstad
Copy link
Author

mstad commented May 20, 2020

@yxliang01 Hi build the branch with the following options:
docker build --build-arg SOLC_VERSION=0.5.15 --build-arg=ETHEREUM_VERSION=alltools-v1.9.14 -t oyente .
If this is correct... I have the following results (something seems changed)
docker run -it -v /home/mirkostad/Programmi/smart-contracts/Original/:/share oyente:latest -s /share/0x1c_fixed.sol --verbose
WARNING:root:You are using evm version 1.9.14. The supported version is 1.7.3
WARNING:root:You are using solc version 0.5.15, The latest supported version is 0.4.19
incomplete push instruction at 134
incomplete push instruction at 1318
incomplete push instruction at 60
INFO:root:contract /share/0x1c_fixed.sol:ACL:
INFO:symExec: ============ Results ===========
DEBUG:symExec:PUSH1 0x80
DEBUG:symExec:PUSH1 0x40
DEBUG:symExec:MSTORE
DEBUG:symExec:CALLVALUE
DEBUG:symExec:DUP1
DEBUG:symExec:ISZERO
DEBUG:symExec:PUSH2 0x0010
DEBUG:symExec:b JUMPI
Traceback (most recent call last):
File "/oyente/oyente/oyente.py", line 222, in
main()
File "/oyente/oyente/oyente.py", line 217, in main
exit_code = analyze_solidity()
File "/oyente/oyente/oyente.py", line 110, in analyze_solidity
results, exit_code = run_solidity_analysis(inputs)
File "/oyente/oyente/oyente.py", line 87, in run_solidity_analysis
result, return_code = symExec.run(disasm_file=inp['disasm_file'], source_map=inp['source_map'], source_file=inp['source'])
File "/oyente/oyente/symExec.py", line 2458, in run
analyze()
File "/oyente/oyente/symExec.py", line 2441, in analyze
run_build_cfg_and_analyze(timeout_cb=timeout_cb)
File "/oyente/oyente/symExec.py", line 2398, in run_build_cfg_and_analyze
build_cfg_and_analyze()
File "/oyente/oyente/symExec.py", line 225, in build_cfg_and_analyze
collect_vertices(tokens)
File "/oyente/oyente/symExec.py", line 341, in collect_vertices
idx = mapping_non_push_instruction(current_line_content, current_ins_address, idx, positions, length) if g_src_map else None
File "/oyente/oyente/symExec.py", line 281, in mapping_non_push_instruction
raise RuntimeError(F"Source map error, unknown name({name}) or instr_name({instr_name})")
RuntimeError: Source map error, unknown name(JUMPI) or instr_name(b)

@yxliang01
Copy link
Contributor

@mstad Looks like the output format of evm indeed changed from 1.7.3 . I might need to dig into some documentation etc to understand the changes in format.

@mstad
Copy link
Author

mstad commented Jun 2, 2020

Hi @yxliang01, anything new?

@mstad
Copy link
Author

mstad commented Jun 9, 2020

Hi, let me know if I have well understood; I have compiled with:
$ docker build --build-arg SOLC_VERSION=0.4.24 --build-arg=ETHEREUM_VERSION=alltools-v1.7.3 -t oyente .
Obviously, processing the 0x1c.sol file, that uses sol 0.5.15, we have the following results:
$ docker run -it -v /home/mirkostad/Programmi/smart-contracts/Original/:/share oyente:latest -s /share/0x1c_fixed.sol -ce

WARNING:root:You are using solc version 0.4.24, The latest supported version is 0.4.19
CRITICAL:root:solc output:

CRITICAL:root:/share/0x1c_fixed.sol:90:32: Error: Expected ',' but got 'payable'
function withdrawEth(address payable _to) external;
^-----^

CRITICAL:root:Solidity compilation failed.

@yxliang01
Copy link
Contributor

@mstad This is a valid compilation error since address payable type is introduced in 0.5.0 while you were using 0.4.24 .

@yxliang01
Copy link
Contributor

What we are interested here is whether Oyente can now support solc newer than 0.4.19 in the new fix-new-solc branch. So, the test Solidity file should be written in manner supported by the corresponding version under testing.

@mstad
Copy link
Author

mstad commented Jun 9, 2020

@yxliang01 You mean between 0.4.19 and 0.4.24?

@yxliang01
Copy link
Contributor

@mstad sorry I think I don't get what you are asking.

@mstad
Copy link
Author

mstad commented Jun 10, 2020

@yxliang01 Sorry, I wrote half of the sentence. You mean that the test Solidity file should be written, in this test, in Solidity release 0.4.x; am I right?

@yxliang01
Copy link
Contributor

@mstad What I meant essentially is that the input Solidity file should be written for solc 0.4.24 when the SOLC_VERSION=0.4.24 . To address the previous compilation error, you can simply change the type from address payable to address .

@mstad
Copy link
Author

mstad commented Jun 15, 2020

@yxliang01
0x1c_fixed_04_24.sol.txt
firstResult.txt

First test:
$ docker build --build-arg SOLC_VERSION=0.4.24 --build-arg=ETHEREUM_VERSION=alltools-v1.7.3 -t oyente .
$ docker run -it -v /home/mirkostad/Programmi/smart-contracts/Oyente_modified/:/share oyente:latest -s /share/0x1c_fixed_04_24.sol -ce
0x1c_fixed_04_24.sol and results as attachment-> ok

@mstad
Copy link
Author

mstad commented Jun 15, 2020

@yxliang01
Second test:
$ docker build --build-arg SOLC_VERSION=0.4.19 --build-arg=ETHEREUM_VERSION=alltools-v1.8.0 -t oyente2 .
docker run -it -v /home/mirkostad/Programmi/smart-contracts/Oyente_modified/:/share oyente:latest -s /share/0x1c_fixed_04_19.sol -ce >> secondResult.txt

0x1c_fixed_04_19.sol and secondResult.txt as attachment-> ok
secondResult.txt
0x1c_fixed_04_19.sol.txt

@mstad
Copy link
Author

mstad commented Jun 15, 2020

@yxliang01
Third test-> Nok
$ docker build --build-arg SOLC_VERSION=0.4.19 --build-arg=ETHEREUM_VERSION=alltools-v1.8.27 -t oyente3 .
$ docker run -it -v /home/mirkostad/Programmi/smart-contracts/Oyente_modified/:/share oyente3:latest -s /share/0x1c_fixed_04_19.sol -ce >> thirdResult.txt
thirdResilts as attachment-> Nok
thirdResult.txt
third_result_verbose.txt

@yxliang01
Copy link
Contributor

yxliang01 commented Jun 16, 2020

@mstad Nice! Looks like we can set the latest officially supported solc version to 0.4.24 after merging the branch fix-new-solc to master (will do in few days after reviewing carefully). The newer evm support is known to be up to version 1.8.0.

To better understand the supported solc versions, would you like to also try solc > 0.4.24 with evm == 1.8.0 to figure out the exact latest supported solc version?

By the way, just a small recommendation, maybe the results can be directly pasted here as code block, so that when others encounter errors, they might be able to find this issue by searching.

@mstad
Copy link
Author

mstad commented Jun 16, 2020

@yxliang01 Yes, I really would try. Tomorrow I use some other further version with evm both with 1.7.3 and 1.8.0 and we will see what happens. My impression is that the direct compatibility stops at 0.4.24 release but... only tests can speak definitively about it. If, in some way, it works with 0.5.0, my problems are solved. And.... yes, I insert code directly to help other users.

@mstad
Copy link
Author

mstad commented Jun 23, 2020

@yxliang01 I try to do the following
$ docker build --build-arg SOLC_VERSION=0.5.0 --build-arg=ETHEREUM_VERSION=alltools-v1.8.0 -t oyente5 .
$ docker run -it -v /home/mirkostad/Programmi/smart-contracts/Oyente_modified/:/share oyente5:latest -s /share/0x1c_fixed_0_5_0.sol -ce
WARNING:root:You are using evm version 1.8.0. The supported version is 1.7.3
WARNING:root:You are using solc version 0.5.0, The latest supported version is 0.4.19
CRITICAL:root:solc output:

CRITICAL:root:
CRITICAL:root:Solidity compilation failed.

If I run oyente5 with the file created for 0.4.19...
docker run -it -v /home/mirkostad/Programmi/smart-contracts/Oyente_modified/:/share oyente5:latest -s /share/0x1c_fixed_04_19.sol -ce
WARNING:root:You are using evm version 1.8.0. The supported version is 1.7.3
WARNING:root:You are using solc version 0.5.0, The latest supported version is 0.4.19
CRITICAL:root:solc output:

CRITICAL:root:/share/0x1c_fixed_04_19.sol:20:1: Error: Source file requires different compiler version (current compiler is 0.5.0+commit.1d4f565a.Linux.g++ - note that nightly builds are considered to be strictly less than the released version
pragma solidity 0.4.19;
^---------------------^
/share/0x1c_fixed_04_19.sol:276:5: Error: Functions are not allowed to have the same name as the contract. If you intend this to be a constructor, use "constructor(...) { ... }" to define it.
function Context () internal { }
^------------------------------^
/share/0x1c_fixed_04_19.sol:297:5: Error: Functions are not allowed to have the same name as the contract. If you intend this to be a constructor, use "constructor(...) { ... }" to define it.
function Ownable() internal {
^ (Relevant source part starts here and spans across multiple lines).
/share/0x1c_fixed_04_19.sol:636:3: Error: Functions are not allowed to have the same name as the contract. If you intend this to be a constructor, use "constructor(...) { ... }" to define it.
function PPDepositHolder(IPPGlobalRegistry _globalRegistry) public {
^ (Relevant source part starts here and spans across multiple lines).
/share/0x1c_fixed_04_19.sol:276:5: Warning: This declaration shadows an existing declaration.
function Context () internal { }
^------------------------------^
/share/0x1c_fixed_04_19.sol:273:1: The shadowed declaration is here:
contract Context {
^ (Relevant source part starts here and spans across multiple lines).

/share/0x1c_fixed_04_19.sol:297:5: Warning: This declaration shadows an existing declaration.
function Ownable() internal {
^ (Relevant source part starts here and spans across multiple lines).
/share/0x1c_fixed_04_19.sol:289:1: The shadowed declaration is here:
contract Ownable is Context {
^ (Relevant source part starts here and spans across multiple lines).

/share/0x1c_fixed_04_19.sol:636:3: Warning: This declaration shadows an existing declaration.
function PPDepositHolder(IPPGlobalRegistry _globalRegistry) public {
^ (Relevant source part starts here and spans across multiple lines).
/share/0x1c_fixed_04_19.sol:623:1: The shadowed declaration is here:
contract PPDepositHolder is IPPDepositHolder {
^ (Relevant source part starts here and spans across multiple lines).

/share/0x1c_fixed_04_19.sol:89:20: Error: Data location must be "calldata" for parameter in external function, but none was given.
function propose(bytes _data, string _dataLink) external ;
^---------^
/share/0x1c_fixed_04_19.sol:89:33: Error: Data location must be "calldata" for parameter in external function, but none was given.
function propose(bytes _data, string _dataLink) external ;
^--------------^
/share/0x1c_fixed_04_19.sol:92:25: Error: Data location must be "calldata" for parameter in external function, but none was given.
function fetchTokenId(bytes _data) external pure returns (uint256 tokenId);
^----------^

CRITICAL:root:Solidity compilation failed.

In your opinion.. is it possible that it works in some way for 0.5.x... or there is no way? In theory i will need... if in your opinion there is no way... I have to find another solution.

@mstad mstad closed this as completed Jun 23, 2020
@mstad mstad reopened this Jun 23, 2020
@yxliang01
Copy link
Contributor

Hi @mstad , supporting 0.5.x is definitely doable if not already supported. The second error is expected since the pragma specifies that only solc 0.4.19 can be used. What's interesting is the first error for which can potentially help us identify the problem. However, from your comment, it looks like solc didn't have any output nor error message. Would you like to execute solc in a oyente5 container and see whether it can compile? If not, paste the error message or whatever terminate output here.

@mstad
Copy link
Author

mstad commented Jun 25, 2020

Hi @yxliang01... How can I enter in the container without running oyente application?

@yxliang01
Copy link
Contributor

You can use --entrypoint=/bin/bash option, need to use it before the image name oyente5

@mstad
Copy link
Author

mstad commented Jun 25, 2020

@yxliang01
This is the output in the docker container:
root@b1e2b8cd763f:/oyente/oyente# python oyente.py -s /share/0x1c_fixed_0_5_0.sol
WARNING:root:You are using evm version 1.8.0. The supported version is 1.7.3
WARNING:root:You are using solc version 0.5.0, The latest supported version is 0.4.19
CRITICAL:root:Solidity compilation failed. Please use -ce flag to see the detail.
root@b1e2b8cd763f:/oyente/oyente# python oyente.py -s /share/0x1c_fixed_0_5_0.sol -ce
WARNING:root:You are using evm version 1.8.0. The supported version is 1.7.3
WARNING:root:You are using solc version 0.5.0, The latest supported version is 0.4.19
CRITICAL:root:solc output:

CRITICAL:root:
CRITICAL:root:Solidity compilation failed.
root@b1e2b8cd763f:/oyente/oyente# python oyente.py -s /share/0x1c_fixed_0_5_0.sol --verbose
WARNING:root:You are using evm version 1.8.0. The supported version is 1.7.3
WARNING:root:You are using solc version 0.5.0, The latest supported version is 0.4.19
CRITICAL:root:Solidity compilation failed. Please use -ce flag to see the detail.

@mstad

This comment has been minimized.

@mstad
Copy link
Author

mstad commented Jun 26, 2020

@yxliang01
The problem with python oyente.py -s /share/0x1c_fixed_0_5_0.sol was that the file has the pragma ^0.5.0 intead having pragma >=0.5.0; this error was not visualized as otuput.
Processing, into the docker container, some 0.5.x files, I was able to process without error 13 files of 15. As attachment the files that generates problems; following the related results:
--- > 0x3.sol
root@0e4cf47b6370:/oyente/oyente# python oyente.py -s /share/0x3.sol -ce
WARNING:root:You are using evm version 1.8.0. The supported version is 1.7.3
WARNING:root:You are using solc version 0.5.0, The latest supported version is 0.4.19
CRITICAL:root:solc output:

CRITICAL:root:
CRITICAL:root:Solidity compilation failed.

---> 0xdb.sol
root@0e4cf47b6370:/oyente/oyente# python oyente.py -s /share/0xdb.sol -ce
WARNING:root:You are using evm version 1.8.0. The supported version is 1.7.3
WARNING:root:You are using solc version 0.5.0, The latest supported version is 0.4.19
CRITICAL:root:solc output:

CRITICAL:root:/share/0xdb.sol:186:5: Error: Overriding function visibility differs.
function notifyTokensReceived(address _from, uint _value) public {
^ (Relevant source part starts here and spans across multiple lines).
/share/0xdb.sol:163:5: Overridden function is here:
function notifyTokensReceived(address _from, uint _value) external;
^-----------------------------------------------------------------^

/share/0xdb.sol:238:5: Error: Overriding function visibility differs.
function retrieveTokens(address _tokenContract) public {
^ (Relevant source part starts here and spans across multiple lines).
/share/0xdb.sol:219:5: Overridden function is here:
function retrieveTokens(address _tokenContract) external;
^-------------------------------------------------------^

/share/0xdb.sol:419:5: Error: Overriding function visibility differs.
function transferOwnership(address _newOwner) public only_owner {
^ (Relevant source part starts here and spans across multiple lines).
/share/0xdb.sol:398:5: Overridden function is here:
function transferOwnership(address _newOwner) external;
^-----------------------------------------------------^

/share/0xdb.sol:868:5: Error: Overriding function visibility differs.
function retrieveTokens(address _tokenContract) public only_owner not_accepted_token(_tokenContract) {
^ (Relevant source part starts here and spans across multiple lines).
/share/0xdb.sol:219:5: Overridden function is here:
function retrieveTokens(address _tokenContract) external;
^-------------------------------------------------------^

/share/0xdb.sol:238:5: Error: Overriding function visibility differs.
function retrieveTokens(address _tokenContract) public {
^ (Relevant source part starts here and spans across multiple lines).
/share/0xdb.sol:219:5: Overridden function is here:
function retrieveTokens(address _tokenContract) external;
^-------------------------------------------------------^

/share/0xdb.sol:419:5: Error: Overriding function visibility differs.
function transferOwnership(address _newOwner) public only_owner {
^ (Relevant source part starts here and spans across multiple lines).
/share/0xdb.sol:398:5: Overridden function is here:
function transferOwnership(address _newOwner) external;
^-----------------------------------------------------^

/share/0xdb.sol:186:5: Error: Overriding function visibility differs.
function notifyTokensReceived(address _from, uint _value) public {
^ (Relevant source part starts here and spans across multiple lines).
/share/0xdb.sol:163:5: Overridden function is here:
function notifyTokensReceived(address _from, uint _value) external;
^-----------------------------------------------------------------^
CRITICAL:root:Solidity compilation failed.

0x3.txt
0xdb.txt

If I want to try to build a container using --build-arg SOLC_VERSION=0.5.15 which --build-arg=ETHEREUM_VERSION=alltools-v1.x.x. you suggest I can try?

@yxliang01
Copy link
Contributor

@mstad
Given your results, I think it is fair to say that the branch fix-new-solc supports solc up to 0.5.0

Regarding the two errors you have encountered, I need to see the solc output on 0x3.sol to know what happened. For 0xdb.sol, I believe it is a bug or version incompatibility in the contract source code itself.

I think you can try alltools-v1.8.1 first, then slowly raise the version (e.g. 1.8.2, 1.8.3...) until encountering errors.

@mstad
Copy link
Author

mstad commented Jul 18, 2020

@yxliang01 Sorry for the delay. I am intending to do it
Anyway, in some tests, it seems really that building with solc=0.5.0 option and tools=1.8.0 there are no problems at all.
I tried also with solc=0.5.4 and alltools=1.8.0 and I found that all worked, but I tested only some cases.
Anyway, I will report to you my results when I can newly try on it.

@Mayur1496
Copy link
Contributor

@yxliang01
Latest Solidity version supported : 0.5.4
Latest evm version supported : 1.8.16
Tested on :

Output :

@mstad
Copy link
Author

mstad commented Sep 2, 2020

@Mayur1496 do you use the fix-new-solc branch?
The way to build the docker that you used is:
docker build --build-arg SOLC_VERSION=0.5.4 --build-arg=ETHEREUM_VERSION=alltools-v1.8.16 -t oyente ?

@Mayur1496
Copy link
Contributor

@mstad
I used the Full Installation method on fix-new-solc branch.
The docker build command that you mentioned seems correct to me :)

yxliang01 added a commit that referenced this issue Sep 4, 2020
After this PR, the latest known supported solc version is `0.5.4` with `evm` toolchain version `1.8.16`. Meanwhile, Solidity file containing non-ascii text will be supported.

Thanks @mstad and @Mayur1496 for reporting and testing (in #393 ).

Note that the version detection in Oyente is still unmodified as we plan to enhance the supported version detection later.

This might be the first PR breaking python 2 support and partially support python > 3 and < 3.6.
@taylorgag
Copy link

Hi, sorry for the delay.

I build oyente docker container from the master branch as oyente.

Now, I am trying to using it sharing the directory in which I have some contract, but it retunr that it
does not find any file. Where I made a (for sure stupid) mistake?

docker run -it -v /home/.../simple_contracts/:/share oyente /share/myContract.sol -ce

CRITICAL:root:Skipping non-existent input file ""/share/myContract_0.5.15.sol""

CRITICAL:root:Solidity compilation failed.

Hi, sorry for the delay.

I build oyente docker container from the master branch as oyente.

Now, I am trying to using it sharing the directory in which I have some contract, but it retunr that it
does not find any file. Where I made a (for sure stupid) mistake?

docker run -it -v /home/.../simple_contracts/:/share oyente /share/myContract.sol -ce

CRITICAL:root:Skipping non-existent input file ""/share/myContract_0.5.15.sol""

CRITICAL:root:Solidity compilation failed.

sorry to bother you ,but how to build oyente docker container from the master branch as oyente?

@yxliang01
Copy link
Contributor

yxliang01 commented Oct 15, 2020

@taylorgag You can use the command docker build -t oyente . under the Oyente root directory. If you have further issues/questions, please open a new issue (instead of replying to this issue as this is considered off-topic).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants