|
|
@ -61,12 +61,10 @@ Solidity defines a [naming convention](https://solidity.readthedocs.io/en/v0.4.2 |
|
|
|
contract.source_mapping_str) |
|
|
|
contract.source_mapping_str) |
|
|
|
|
|
|
|
|
|
|
|
json = self.generate_json_result(info) |
|
|
|
json = self.generate_json_result(info) |
|
|
|
elem = dict() |
|
|
|
self.add_contract_to_json(contract, json, { |
|
|
|
elem['target'] = 'contract' |
|
|
|
"target": "contract", |
|
|
|
elem['convention'] = 'CapWords' |
|
|
|
"convention": "CapWords" |
|
|
|
elem['name'] = contract.name |
|
|
|
}) |
|
|
|
elem['source_mapping'] = contract.source_mapping |
|
|
|
|
|
|
|
json['elements'] = [elem] |
|
|
|
|
|
|
|
results.append(json) |
|
|
|
results.append(json) |
|
|
|
|
|
|
|
|
|
|
|
for struct in contract.structures: |
|
|
|
for struct in contract.structures: |
|
|
@ -78,13 +76,12 @@ Solidity defines a [naming convention](https://solidity.readthedocs.io/en/v0.4.2 |
|
|
|
info = info.format(struct.contract.name, struct.name, struct.source_mapping_str) |
|
|
|
info = info.format(struct.contract.name, struct.name, struct.source_mapping_str) |
|
|
|
|
|
|
|
|
|
|
|
json = self.generate_json_result(info) |
|
|
|
json = self.generate_json_result(info) |
|
|
|
elem = dict() |
|
|
|
self.add_struct_to_json(struct, json, { |
|
|
|
elem['target'] = 'structure' |
|
|
|
"target": "structure", |
|
|
|
elem['convention'] = 'CapWords' |
|
|
|
"convention": "CapWords" |
|
|
|
elem['name'] = struct.name |
|
|
|
}) |
|
|
|
elem['source_mapping'] = struct.source_mapping |
|
|
|
|
|
|
|
json['elements'] = [elem] |
|
|
|
|
|
|
|
results.append(json) |
|
|
|
results.append(json) |
|
|
|
|
|
|
|
|
|
|
|
for event in contract.events: |
|
|
|
for event in contract.events: |
|
|
|
if event.contract != contract: |
|
|
|
if event.contract != contract: |
|
|
|
continue |
|
|
|
continue |
|
|
@ -94,12 +91,10 @@ Solidity defines a [naming convention](https://solidity.readthedocs.io/en/v0.4.2 |
|
|
|
info = info.format(event.contract.name, event.name, event.source_mapping_str) |
|
|
|
info = info.format(event.contract.name, event.name, event.source_mapping_str) |
|
|
|
|
|
|
|
|
|
|
|
json = self.generate_json_result(info) |
|
|
|
json = self.generate_json_result(info) |
|
|
|
elem = dict() |
|
|
|
self.add_event_to_json(event, json, { |
|
|
|
elem['target'] = 'event' |
|
|
|
"target": "event", |
|
|
|
elem['convention'] = 'CapWords' |
|
|
|
"convention": "CapWords" |
|
|
|
elem['name'] = event.name |
|
|
|
}) |
|
|
|
elem['source_mapping'] = event.source_mapping |
|
|
|
|
|
|
|
json['elements'] = [elem] |
|
|
|
|
|
|
|
results.append(json) |
|
|
|
results.append(json) |
|
|
|
|
|
|
|
|
|
|
|
for func in contract.functions: |
|
|
|
for func in contract.functions: |
|
|
@ -111,12 +106,10 @@ Solidity defines a [naming convention](https://solidity.readthedocs.io/en/v0.4.2 |
|
|
|
info = info.format(func.contract.name, func.name, func.source_mapping_str) |
|
|
|
info = info.format(func.contract.name, func.name, func.source_mapping_str) |
|
|
|
|
|
|
|
|
|
|
|
json = self.generate_json_result(info) |
|
|
|
json = self.generate_json_result(info) |
|
|
|
elem = dict() |
|
|
|
self.add_function_to_json(func, json, { |
|
|
|
elem['target'] = 'function' |
|
|
|
"target": "function", |
|
|
|
elem['convention'] = 'mixedCase' |
|
|
|
"convention": "mixedCase" |
|
|
|
elem['name'] = func.name |
|
|
|
}) |
|
|
|
elem['source_mapping'] = func.source_mapping |
|
|
|
|
|
|
|
json['elements'] = [elem] |
|
|
|
|
|
|
|
results.append(json) |
|
|
|
results.append(json) |
|
|
|
|
|
|
|
|
|
|
|
for argument in func.parameters: |
|
|
|
for argument in func.parameters: |
|
|
@ -132,12 +125,10 @@ Solidity defines a [naming convention](https://solidity.readthedocs.io/en/v0.4.2 |
|
|
|
argument.source_mapping_str) |
|
|
|
argument.source_mapping_str) |
|
|
|
|
|
|
|
|
|
|
|
json = self.generate_json_result(info) |
|
|
|
json = self.generate_json_result(info) |
|
|
|
elem = dict() |
|
|
|
self.add_variable_to_json(argument, json, { |
|
|
|
elem['target'] = 'parameter' |
|
|
|
"target": "parameter", |
|
|
|
elem['convention'] = 'mixedCase' |
|
|
|
"convention": "mixedCase" |
|
|
|
elem['name'] = argument.name |
|
|
|
}) |
|
|
|
elem['source_mapping'] = argument.source_mapping |
|
|
|
|
|
|
|
json['elements'] = [elem] |
|
|
|
|
|
|
|
results.append(json) |
|
|
|
results.append(json) |
|
|
|
|
|
|
|
|
|
|
|
for var in contract.state_variables: |
|
|
|
for var in contract.state_variables: |
|
|
@ -150,12 +141,10 @@ Solidity defines a [naming convention](https://solidity.readthedocs.io/en/v0.4.2 |
|
|
|
info = info.format(var.contract.name, var.name, var.source_mapping_str) |
|
|
|
info = info.format(var.contract.name, var.name, var.source_mapping_str) |
|
|
|
|
|
|
|
|
|
|
|
json = self.generate_json_result(info) |
|
|
|
json = self.generate_json_result(info) |
|
|
|
elem = dict() |
|
|
|
self.add_variable_to_json(var, json, { |
|
|
|
elem['target'] = 'variable' |
|
|
|
"target": "variable", |
|
|
|
elem['convention'] = 'l_O_I_should_not_be_used' |
|
|
|
"convention": "l_O_I_should_not_be_used" |
|
|
|
elem['name'] = var.name |
|
|
|
}) |
|
|
|
elem['source_mapping'] = var.source_mapping |
|
|
|
|
|
|
|
json['elements'] = [elem] |
|
|
|
|
|
|
|
results.append(json) |
|
|
|
results.append(json) |
|
|
|
|
|
|
|
|
|
|
|
if var.is_constant is True: |
|
|
|
if var.is_constant is True: |
|
|
@ -168,12 +157,10 @@ Solidity defines a [naming convention](https://solidity.readthedocs.io/en/v0.4.2 |
|
|
|
info = info.format(var.contract.name, var.name, var.source_mapping_str) |
|
|
|
info = info.format(var.contract.name, var.name, var.source_mapping_str) |
|
|
|
|
|
|
|
|
|
|
|
json = self.generate_json_result(info) |
|
|
|
json = self.generate_json_result(info) |
|
|
|
elem = dict() |
|
|
|
self.add_variable_to_json(var, json, { |
|
|
|
elem['target'] = 'variable_constant' |
|
|
|
"target": "variable_constant", |
|
|
|
elem['convention'] = 'UPPER_CASE_WITH_UNDERSCORES' |
|
|
|
"convention": "UPPER_CASE_WITH_UNDERSCORES" |
|
|
|
elem['name'] = var.name |
|
|
|
}) |
|
|
|
elem['source_mapping'] = var.source_mapping |
|
|
|
|
|
|
|
json['elements'] = [elem] |
|
|
|
|
|
|
|
results.append(json) |
|
|
|
results.append(json) |
|
|
|
|
|
|
|
|
|
|
|
else: |
|
|
|
else: |
|
|
@ -186,12 +173,10 @@ Solidity defines a [naming convention](https://solidity.readthedocs.io/en/v0.4.2 |
|
|
|
info = info.format(var.contract.name, var.name, var.source_mapping_str) |
|
|
|
info = info.format(var.contract.name, var.name, var.source_mapping_str) |
|
|
|
|
|
|
|
|
|
|
|
json = self.generate_json_result(info) |
|
|
|
json = self.generate_json_result(info) |
|
|
|
elem = dict() |
|
|
|
self.add_variable_to_json(var, json, { |
|
|
|
elem['target'] = 'variable' |
|
|
|
"target": "variable", |
|
|
|
elem['convention'] = 'mixedCase' |
|
|
|
"convention": "mixedCase" |
|
|
|
elem['name'] = var.name |
|
|
|
}) |
|
|
|
elem['source_mapping'] = var.source_mapping |
|
|
|
|
|
|
|
json['elements'] = [elem] |
|
|
|
|
|
|
|
results.append(json) |
|
|
|
results.append(json) |
|
|
|
|
|
|
|
|
|
|
|
for enum in contract.enums: |
|
|
|
for enum in contract.enums: |
|
|
@ -203,12 +188,10 @@ Solidity defines a [naming convention](https://solidity.readthedocs.io/en/v0.4.2 |
|
|
|
info = info.format(enum.contract.name, enum.name, enum.source_mapping_str) |
|
|
|
info = info.format(enum.contract.name, enum.name, enum.source_mapping_str) |
|
|
|
|
|
|
|
|
|
|
|
json = self.generate_json_result(info) |
|
|
|
json = self.generate_json_result(info) |
|
|
|
elem = dict() |
|
|
|
self.add_enum_to_json(enum, json, { |
|
|
|
elem['target'] = 'enum' |
|
|
|
"target": "enum", |
|
|
|
elem['convention'] = 'CapWords' |
|
|
|
"convention": "CapWords" |
|
|
|
elem['name'] = enum.name |
|
|
|
}) |
|
|
|
elem['source_mapping'] = enum.source_mapping |
|
|
|
|
|
|
|
json['elements'] = [elem] |
|
|
|
|
|
|
|
results.append(json) |
|
|
|
results.append(json) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -223,12 +206,10 @@ Solidity defines a [naming convention](https://solidity.readthedocs.io/en/v0.4.2 |
|
|
|
modifier.source_mapping_str) |
|
|
|
modifier.source_mapping_str) |
|
|
|
|
|
|
|
|
|
|
|
json = self.generate_json_result(info) |
|
|
|
json = self.generate_json_result(info) |
|
|
|
elem = dict() |
|
|
|
self.add_function_to_json(modifier, json, { |
|
|
|
elem['target'] = 'modifier' |
|
|
|
"target": "modifier", |
|
|
|
elem['convention'] = 'mixedCase' |
|
|
|
"convention": "mixedCase" |
|
|
|
elem['name'] = modifier.name |
|
|
|
}) |
|
|
|
elem['source_mapping'] = modifier.source_mapping |
|
|
|
|
|
|
|
json['elements'] = [elem] |
|
|
|
|
|
|
|
results.append(json) |
|
|
|
results.append(json) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|