-
Notifications
You must be signed in to change notification settings - Fork 88
Adding a new platform
Feist Josselin edited this page Jun 27, 2019
·
1 revision
New platforms can be added to: https://github.com/crytic/crytic-compile/tree/master/crytic_compile/platform
A platform must have the following functions:
def compile(crytic_compile, target, **kwargs):
'''
Is called to compile the project
Args:
crytic_compile: the crytic-compile object
target (str): file/directory to compile
kwargs: additional kwargs arguments
'''A call to compile must set:
crytic_compile.contracts_namescrytic_compile.contracts_filenamescrytic_compile.abiscrytic_compile.bytecodes_initcrytic_compile.bytecodes_runtimecrytic_compile.srcmaps_initcrytic_compile.srcmaps_runtimecrytic_compile.compiler_versioncrytic_compile.filenamescrytic_compile.astscrytic_compile.type
type requires to create a new type in https://github.com/crytic/crytic-compile/blob/master/crytic_compile/platform/types.py
def is_platform_name(target):
'''
Return true if the platform is detected
Args:
target (str): file/directory to compile
'''def is_dependency(path):
'''
Return true if the path is a dependency
Args:
path (str): file/directory to compile
'''crytic.compile.py must also be updated: