|
|
|
@ -3,15 +3,28 @@ from mythril.ethereum.evmcontract import EVMContract |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Source: |
|
|
|
|
"""Class to handle to source data""" |
|
|
|
|
|
|
|
|
|
def __init__( |
|
|
|
|
self, source_type=None, source_format=None, source_list=None, meta=None |
|
|
|
|
): |
|
|
|
|
""" |
|
|
|
|
:param source_type: whether it is a solidity-file or evm-bytecode |
|
|
|
|
:param source_format: whether it is bytecode, ethereum-address or text |
|
|
|
|
:param source_list: List of files |
|
|
|
|
:param meta: meta data |
|
|
|
|
""" |
|
|
|
|
self.source_type = source_type |
|
|
|
|
self.source_format = source_format |
|
|
|
|
self.source_list = [] |
|
|
|
|
self.meta = meta |
|
|
|
|
|
|
|
|
|
def get_source_from_contracts_list(self, contracts): |
|
|
|
|
""" |
|
|
|
|
get the source data from the contracts list |
|
|
|
|
:param contracts: the list of contracts |
|
|
|
|
:return: |
|
|
|
|
""" |
|
|
|
|
if contracts is None or len(contracts) == 0: |
|
|
|
|
return |
|
|
|
|
if isinstance(contracts[0], SolidityContract): |
|
|
|
|