oyente icon indicating copy to clipboard operation
oyente copied to clipboard

Add support for standard-json.

Open MicahZoltu opened this issue 7 years ago • 6 comments

In a complex project like Augur, the contracts don't compile by just passing them to solc because the system is made up of dozens of contracts that have intertwining references and a non-trivial build system. "Standard JSON" seems to be the recommended mechanism for defining complex builds for solc, so it would be nice if Oyente supported building from a "Standard JSON" file as well so large projects can leverage Oyente (arguably, large projects need Oyente more than small projects).

MicahZoltu avatar Oct 03 '17 02:10 MicahZoltu

Yes please +1

joeykrug avatar Oct 03 '17 02:10 joeykrug

Thanks @MicahZoltu Will consider this

luongnt95 avatar Oct 07 '17 08:10 luongnt95

@luongnt95 looks like support was added here--does it work? :)

beaugunderson avatar Nov 15 '17 00:11 beaugunderson

@beaugunderson it's not fully supported. Could you help me test this feature? Just report any problems you have with this feature. Thanks

luongnt95 avatar Dec 01 '17 13:12 luongnt95

Below is a standard JSON output file for solidity, trying it with:

oyente/oyente.py --standard-json --source contracts.json

Traceback (most recent call last):
  File "oyente/oyente.py", line 209, in <module>
    main()
  File "oyente/oyente.py", line 202, in main
    exit_code = analyze_solidity(input_type='standard_json')
  File "oyente/oyente.py", line 105, in analyze_solidity
    helper = InputHelper(InputHelper.STANDARD_JSON, source=args.source, allow_paths=args.allow_paths)
  File "/home/ubuntu/workspace/oyente/input_helper.py", line 44, in __init__
    raise Exception("'%s' attribute can't be None" % attr)
Exception: 'allow_paths' attribute can't be None

contracts.json.zip

It'd be simplest if we could use the solidity json output as then we'd never run into path or build issues w/ oyente.

From above, perhaps it takes the solidity json input instead? I tried that and got the same error though

joeykrug avatar Jan 01 '18 20:01 joeykrug

@joeykrug Currently, Oyente only gets json input as the input. In order to run json input with Oyente, you also have to use --alow-paths parameter as in solc oyente/oyente.py --standard-json --source input_json.json --allow-paths <absolute paht>

luongnt95 avatar Jan 03 '18 17:01 luongnt95