Hello! I have deployed smart contract in the network.
I want to compare deployed contract bytecode with code on my server and make sure that they are same.
I used web3.eth.getCode(), but it returned other code than I have in .bin file.
Jan 4, 2022, 10:19 PM
What is the reason of such difference?
Deployed contract was created from last compiled contract version that I use for comparing
Jan 4, 2022, 10:21 PM
I fell upon the same kind of issue than you, that gave me a headache. I do not recall the details, but as far as I remember I was trying to compare the smart contract bytecode with the deployment transaction (that includes the constructor call with its arguments, on top of the smart contract bytecode). Curious to know the outcome of your issue
Go ahead
Jan 5, 2022, 2:01 AM
Did you compile both versions with the same optimizations?
Jan 5, 2022, 2:35 AM
For now I decided to correct others problems in my app, but when I will see solution I will tell you
I have only one compiled contract.
My simulation is deploying contract from compiled .bin and then comparing it code with this .bin.
But code is different and have different size.
Bytecode in the network has ~9500 symbols, my bytecode has ~13500 symbols.
Is it possible that EVM optimize code during deployment?
My simulation is deploying contract from compiled .bin and then comparing it code with this .bin.
But code is different and have different size.
Bytecode in the network has ~9500 symbols, my bytecode has ~13500 symbols.
Is it possible that EVM optimize code during deployment?
Jan 5, 2022, 10:10 AM