How to use the vyper.compiler.compile function in vyper

To help you get started, we’ve selected a few vyper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vyperlang / vyper / tests / parser / exceptions / test_invalid_type_exception.py View on Github external
def test_invalid_type_exception(bad_code):
    with raises(InvalidTypeException):
        compiler.compile(bad_code)
github vyperlang / vyper / tests / parser / syntax / test_code_size.py View on Github external
def test_block_success(good_code):
    assert compiler.compile(good_code) is not None
github vyperlang / vyper / tests / parser / syntax / test_slice.py View on Github external
def test_slice_success(good_code):
    assert compiler.compile(good_code) is not None
github vyperlang / vyper / tests / parser / syntax / test_as_wei_value.py View on Github external
def test_as_wei_success(good_code):
    assert compiler.compile(good_code) is not None
github vyperlang / vyper / tests / parser / syntax / test_minmax.py View on Github external
def test_block_fail(bad_code):

    with raises(TypeMismatchException):
        compiler.compile(bad_code)
github vyperlang / vyper / tests / parser / syntax / test_public.py View on Github external
def test_public_success(good_code):
    assert compiler.compile(good_code) is not None
github vyperlang / vyper / tests / parser / syntax / test_selfdestruct.py View on Github external
def test_block_fail(bad_code):

    with raises(TypeMismatchException):
        compiler.compile(bad_code)
github vyperlang / vyper / tests / parser / syntax / test_as_uint256.py View on Github external
def test_as_wei_success(good_code):
    assert compiler.compile(good_code) is not None
github ethereum / sharding / tools / vyper_compile_script.py View on Github external
def generate_compiled_json(file_path: str) -> None:
    vmc_code = open(file_path).read()
    abi = compiler.mk_full_signature(vmc_code)
    bytecode = compiler.compile(vmc_code)
    bytecode_hex = '0x' + bytecode.hex()
    contract_json = {
        'abi': abi,
        'bytecode': bytecode_hex,
    }
    # write json
    basename = os.path.basename(file_path)
    dirname = os.path.dirname(file_path)
    contract_name = basename.split('.')[0]
    with open(dirname + "/{}.json".format(contract_name), 'w') as f_write:
        json.dump(contract_json, f_write)