How to view the exported functions of a smart contract in MultiversX

103 Views Asked by At

Is there any way to see the exported functions of a smart contract deployed by somebody else given the address of the contract? I tried in explorer and all I was able to see was the compiled code.

1

There are 1 best solutions below

0
On

Easiest way would be to have access to the contract's .abi.json file.

If you don't have it, then the "reverse engineer" way would be to take the contract's bytecode from the explorer and open it with a web assembly interpreter (e.g. the WebAssembly VSCode extension).

Thus you'll be able to see the contract's interpreted web assembly functions and their opcodes. You should be able to find a list of entries like export "function_name" (func $rust_function_name).

From this point on, you'll either have to employ some educated guesses to figure out endpoints from views along with their corresponding parameters... or try them out exhaustively.