Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support salted contract construction #485

Closed
dmihal opened this issue May 13, 2020 · 2 comments
Closed

Support salted contract construction #485

dmihal opened this issue May 13, 2020 · 2 comments
Labels
bug Something isn't working enhancement New feature or request High Priority

Comments

@dmihal
Copy link

dmihal commented May 13, 2020

Solidity 0.6.2 added support for Create2 using the salt modifier:

new MyContract{salt: bytes32(0)}(arg);

It looks like #424 added support for this type of syntax for call(), but salted creation still fails with the following error:

ERROR:root:Error in .
ERROR:root:Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/slither/__main__.py", line 606, in main_impl
    printer_classes)
  File "/usr/local/lib/python3.7/site-packages/slither/__main__.py", line 68, in process_all
    compilation, args, detector_classes, printer_classes)
  File "/usr/local/lib/python3.7/site-packages/slither/__main__.py", line 55, in process_single
    **vars(args))
  File "/usr/local/lib/python3.7/site-packages/slither/slither.py", line 86, in __init__
    self._analyze_contracts()
  File "/usr/local/lib/python3.7/site-packages/slither/solc_parsing/slitherSolc.py", line 254, in _analyze_contracts
    self._analyze_third_part(contracts_to_be_analyzed, libraries)
  File "/usr/local/lib/python3.7/site-packages/slither/solc_parsing/slitherSolc.py", line 332, in _analyze_third_part
    self._analyze_variables_modifiers_functions(contract)
  File "/usr/local/lib/python3.7/site-packages/slither/solc_parsing/slitherSolc.py", line 372, in _analyze_variables_modifiers_functions
    contract.analyze_content_functions()
  File "/usr/local/lib/python3.7/site-packages/slither/solc_parsing/declarations/contract.py", line 291, in analyze_content_functions
    function.analyze_content()
  File "/usr/local/lib/python3.7/site-packages/slither/solc_parsing/declarations/function.py", line 240, in analyze_content
    node.analyze_expressions(self)
  File "/usr/local/lib/python3.7/site-packages/slither/solc_parsing/cfg/node.py", line 31, in analyze_expressions
    expression = parse_expression(self._unparsed_expression, caller_context)
  File "/usr/local/lib/python3.7/site-packages/slither/solc_parsing/expressions/expression_parsing.py", line 417, in parse_expression
    return parse_call(expression, caller_context)
  File "/usr/local/lib/python3.7/site-packages/slither/solc_parsing/expressions/expression_parsing.py", line 271, in parse_call
    called = parse_expression(expression['expression'], caller_context)
  File "/usr/local/lib/python3.7/site-packages/slither/solc_parsing/expressions/expression_parsing.py", line 422, in parse_expression
    assert isinstance(called, MemberAccess)
AssertionError
@montyly
Copy link
Member

montyly commented May 14, 2020

Hi @dmihal

Thanks for pointing this out. We will add the support for salt soon.

@montyly montyly added bug Something isn't working enhancement New feature or request and removed enhancement New feature or request labels May 14, 2020
@montyly montyly added enhancement New feature or request High Priority labels Jun 5, 2020
@montyly montyly closed this as completed in f8b5a1a Jun 8, 2020
@montyly
Copy link
Member

montyly commented Jun 8, 2020

Hi @dmihal, salted contracts are now supported in master, and the fix will present in upcoming release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request High Priority
Projects
None yet
Development

No branches or pull requests

2 participants