|
|
@ -104,30 +104,27 @@ class SlitherSolc(Slither): |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
for contract_data in data_loaded[self.get_children()]: |
|
|
|
for contract_data in data_loaded[self.get_children()]: |
|
|
|
# if self.solc_version == '0.3': |
|
|
|
|
|
|
|
# assert contract_data[self.get_key()] == 'Contract' |
|
|
|
assert contract_data[self.get_key()] in ['ContractDefinition', 'PragmaDirective', 'ImportDirective'] |
|
|
|
# contract = ContractSolc03(self, contract_data) |
|
|
|
if contract_data[self.get_key()] == 'ContractDefinition': |
|
|
|
if self.solc_version == '0.4': |
|
|
|
contract = ContractSolc04(self, contract_data) |
|
|
|
assert contract_data[self.get_key()] in ['ContractDefinition', 'PragmaDirective', 'ImportDirective'] |
|
|
|
if 'src' in contract_data: |
|
|
|
if contract_data[self.get_key()] == 'ContractDefinition': |
|
|
|
contract.set_offset(contract_data['src'], self) |
|
|
|
contract = ContractSolc04(self, contract_data) |
|
|
|
self._contractsNotParsed.append(contract) |
|
|
|
if 'src' in contract_data: |
|
|
|
elif contract_data[self.get_key()] == 'PragmaDirective': |
|
|
|
contract.set_offset(contract_data['src'], self) |
|
|
|
if self._is_compact_ast: |
|
|
|
self._contractsNotParsed.append(contract) |
|
|
|
pragma = Pragma(contract_data['literals']) |
|
|
|
elif contract_data[self.get_key()] == 'PragmaDirective': |
|
|
|
else: |
|
|
|
if self._is_compact_ast: |
|
|
|
pragma = Pragma(contract_data['attributes']["literals"]) |
|
|
|
pragma = Pragma(contract_data['literals']) |
|
|
|
pragma.set_offset(contract_data['src'], self) |
|
|
|
else: |
|
|
|
self._pragma_directives.append(pragma) |
|
|
|
pragma = Pragma(contract_data['attributes']["literals"]) |
|
|
|
elif contract_data[self.get_key()] == 'ImportDirective': |
|
|
|
pragma.set_offset(contract_data['src'], self) |
|
|
|
if self.is_compact_ast: |
|
|
|
self._pragma_directives.append(pragma) |
|
|
|
import_directive = Import(contract_data["absolutePath"]) |
|
|
|
elif contract_data[self.get_key()] == 'ImportDirective': |
|
|
|
else: |
|
|
|
if self.is_compact_ast: |
|
|
|
import_directive = Import(contract_data['attributes']["absolutePath"]) |
|
|
|
import_directive = Import(contract_data["absolutePath"]) |
|
|
|
import_directive.set_offset(contract_data['src'], self) |
|
|
|
else: |
|
|
|
self._import_directives.append(import_directive) |
|
|
|
import_directive = Import(contract_data['attributes']["absolutePath"]) |
|
|
|
|
|
|
|
import_directive.set_offset(contract_data['src'], self) |
|
|
|
|
|
|
|
self._import_directives.append(import_directive) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _parse_source_unit(self, data, filename): |
|
|
|
def _parse_source_unit(self, data, filename): |
|
|
|