Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vyper source mapping for runtime #171

Merged
merged 1 commit into from
Apr 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion crytic_compile/platform/vyper.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,14 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str):
crytic_compile.abis[contract_name] = info["abi"]
crytic_compile.bytecodes_init[contract_name] = info["bytecode"].replace("0x", "")
crytic_compile.bytecodes_runtime[contract_name] = info["bytecode_runtime"].replace("0x", "")
# Vyper does not provide the source mapping for the init bytecode
crytic_compile.srcmaps_init[contract_name] = []
crytic_compile.srcmaps_runtime[contract_name] = []
# info["source_map"]["pc_pos_map"] contains the source mapping in a simpler format
# However pc_pos_map_compressed" seems to follow solc's format, so for convenience
# We store the same
# TODO: create SourceMapping class, so that srcmaps_runtime would store an class
# That will give more flexebility to different compilers
crytic_compile.srcmaps_runtime[contract_name] = info["source_map"]["pc_pos_map_compressed"]

crytic_compile.filenames.add(contract_filename)

Expand Down