Search code examples
soliditysmartcontracts

SmartContracts/Solidity: Can anyone see my smartcontract Code? Or is it kept private?


I've been spending some time working on an NFT Game when I realized if other people know my contract methods and ABI they could easily hack the game. So I was just wondering if people can see my Contract Code and get my ABI without me knowing.


Solution

  • When you write the smart contract, solidity compiler spits out ABI and bytecode. we use ABI to interact with the deployed contract. Bytecode is an executable code on EVM and stored on blockchain.

    enter image description here

    There are some decompilers to read this bytecode but as far as I know they are not perfectly decompiling the bytecode.