How to download smart contract code from tronchain

is it possible to download the source code of a smart contract from tronscan or any other way using python, js or the tronscan api?
thanks.

2 Likes

you can get the ABI with the tronweb API

just copy paste it from the reading side

1 Like

i need the actual source code

1 Like

i know, but i need to do it programatically. do you know any way to do so?

that’s not possible, the closest you can get is by decompiling the bytecode but that won’t give you a perfect match. Search for “solidity decompilers”

lol, i just opened a topic about how evm decompilers doesnt work that well. gues there isnt a tvm decompilers?

the thing is that for any other block explorer you have the option to download the code through their api, is it possible in tronscan?

1 Like