I have an address with some deployed modules, is there a way for me to translate the Bytecode / ABI info to a file.move so it will be human readable?
Aptos Bytecode / ABI to move file?
429 views Asked by Bob Sfog At
2
There are 2 answers
0
On
The previous answer states that decompilation is not possible. Now it is! 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 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 MoveStdlib/bytecode_modules
. Look for files with the .mv.move
extension.
Learn more here: https://aptoslabs.medium.com/move-revealed-the-revela-decompiler-b206eaf48b45.
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:
See this answer for much more information on the topic: How do I call a function in a different Move module / smart contract?
As for converting from bytecode to source, this is technically possible, but we have no tooling to support it today. Stay posted!