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?


you can get the ABI with the tronweb API

just copy paste it from the reading side


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?

1 Like

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?

1 Like

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

I don’t think it’s possible… Probably use a decompiler

1 Like

I really find this interesting