-
Originally from Stack Overflow. I have an address with some deployed modules, is there a way for me to get the source code so it will be human readable? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
When you publish a Move module by default the CLI will include the source code as well as the bytecode. Authors do have the option to opt out of this behavior however. So there are two approaches: Source available on chainBy default, the source for a Move module is included when it is published on chain. If that is the case, you can download it like this: aptos move download --account 0x1 --package MoveStdlib Source not available on chainAptos Labs + Verichains recently released a decompiler for this purpose. The source code won't be an exact match syntactically of the original code, but it should be semantically identical. # Install Revela. The CLI needs this separate tool to decompile the bytecode.
aptos update revela
# Download the package from on chain, in this case MoveStdlib.
aptos move download --account 0x1 --bytecode --package MoveStdlib
# Decompile!
aptos move decompile --package-path MoveStdlib/bytecode_modules The output should be in Learn more here: https://aptoslabs.medium.com/move-revealed-the-revela-decompiler-b206eaf48b45. |
Beta Was this translation helpful? Give feedback.
When you publish a Move module by default the CLI will include the source code as well as the bytecode. Authors do have the option to opt out of this behavior however. So there are two approaches:
Source available on chain
By default, the source for a Move module is included when it is published on chain. If that is the case, you can download it like this:
Source not available on chain
Aptos Labs + Verichains recently released a decompiler for this purpose. The source code won't be an exact match syntactically of the original code, but it should be semantically identical.
# Install Revela. The CLI needs this separate tool to decompile…