The compiler output contains a key-value pair with three keys: compile output, vyper version and zkvyper version.
Currently the compile output used filename with the prefix of './' removed. this doesnt work if './' is not in the prefix:
(venv) % python scripts/deploy_infra.py
Traceback (most recent call last):
...
contract_obj = boa.loads_partial(source_code=new_source, filename=contract_file)
File ".../venv/lib/python3.10/site-packages/boa/interpret.py", line 163, in loads_partial
data = compiler_data(source_code, name, deployer_class, **compiler_args)
File ".../venv/lib/python3.10/site-packages/boa/interpret.py", line 110, in compiler_data
return _disk_cache.caching_lookup(cache_key, func)
File ".../venv/lib/python3.10/site-packages/boa/util/disk_cache.py", line 70, in caching_lookup
res = func()
File ".../venv/lib/python3.10/site-packages/boa/interpret.py", line 100, in func
ret = deployer.create_compiler_data(
File ".../venv/lib/python3.10/site-packages/boa_zksync/deployer.py", line 36, in create_compiler_data
return compile_zksync_source(source_code, contract_name, compiler_args)
File "...venv/lib/python3.10/site-packages/boa_zksync/compile.py", line 70, in compile_zksync_source
return compile_zksync(name, filename, compiler_args, source_code)
File ".../venv/lib/python3.10/site-packages/boa_zksync/compile.py", line 43, in compile_zksync
compile_output = output[filename.removeprefix("./")]
KeyError: '/var/folders/w7/3c51j_5j2gq4n13mljt4rrb80000gn/T/tmp8ziczmee/VyperContract.vy'
How I did it
I added a helper method to fetch the correct key, but then it also breaks if the other key names change or if the number of keys change.
How to verify it
you can try to deloy curve stableswap infra on zksync here:
you need to call python scripts/deploy_infra.py and that should cleanly deploy. ensure you have the right env keys (it will bork at first but you'll find the changes you need to do'.
Description for the changelog
Fetch compiler output from stdout without guessing the path of the temp filename.
What I did
The compiler output contains a key-value pair with three keys: compile output, vyper version and zkvyper version.
Currently the compile output used filename with the prefix of './' removed. this doesnt work if './' is not in the prefix:
How I did it
I added a helper method to fetch the correct key, but then it also breaks if the other key names change or if the number of keys change.
How to verify it
you can try to deloy curve stableswap infra on zksync here:
https://github.com/curvefi/stableswap-ng/blob/main/scripts/deploy_infra.py
you need to call
python scripts/deploy_infra.py
and that should cleanly deploy. ensure you have the right env keys (it will bork at first but you'll find the changes you need to do'.Description for the changelog
Fetch compiler output from stdout without guessing the path of the temp filename.
Cute Animal Picture