I'm noticing a difference in the binary generated using the same solc compiler in local and with Remix.
Here's the source code:
pragma solidity 0.8.20;
contract HelloWorld {}
I compiled it in local using solc 0.8.20+commit.a1b79de6.Darwin.appleclang
with the following command: solc --bin --evm-version=shanghai src/HelloWorld.sol
Then I compiled it using remix:
Using solc in local I get:
6080604052348015600e575f80fd5b50603e80601a5f395ff3fe60806040525f80fdfea26469706673582212207b2707958b214a2fbb3ee97873fd5450b38f093d306ca27f3ab234659b8a6f8064736f6c63430008140033
Using Remix:
6080604052348015600e575f80fd5b50603e80601a5f395ff3fe60806040525f80fdfea2646970667358221220d6df573e47185fc28b4a57d786409da70c81ef5acd34160533da68ef8405873c64736f6c63430008140033
At first sight the outputs look identical but they are different. I used the same compiler version, same evm version and no optimization, so I wonder what else could cause this difference?
Its problable that this difference is related with the part of the binary that cointains the metadata hash and not the code itself. See https://docs.soliditylang.org/en/latest/metadata.html
You can test use the flag
--no-cbor-metadata
or modify the settings of the compilier using these instructions:Full detais can be found here https://docs.soliditylang.org/en/latest/using-the-compiler.html#compiler-input-and-output-json-description%7D