Skip to content

Library Documentation

Feist Josselin edited this page Apr 18, 2019 · 4 revisions

To add crytic-compile options to argparser:

from crytic_compile import cryticparser

...
cryticparser.init(parser)

To compile a project:

from crytic_compile import CryticCompile, InvalidCompilation
...
    args = parser.parse_args()
    try:
        cryticCompile = CryticCompile(**vars(args))
        for contract in cryticCompile.contracts_name:
            print(f'Contract {contract}')
            print(f'ABI: {cryticCompile.abi(contract)}')
            print(f'Init bytecode: {cryticCompile.init_bytecode(contract)}')
            print(f'Runtime bytecode: {cryticCompile.runtime_bytecode(contract)}')
    except InvalidCompilation as e:
        logger.error(e)
Clone this wiki locally