Building the contracts

The source of every contract is verified on the explorer. Compiled with these settings, it reproduces the bytecode on chain.

The pinned settings

ModelsolcOptimizerEVM versionPipeline
V10.8.30on, 300 runscancunviaIR
V20.8.35on, 200 runscancunviaIR

Any other setting gives different bytes. V1 does not compile without viaIR.

Checking a deployed address

Even with the same source, the compiled bytecode and the code on chain differ in two places, which a comparison has to mask:

  • Immutables. Values set at construction are zeros in the artifact and real data on chain. Their positions are in the artifact's deployedBytecode.immutableReferences.
  • Metadata of embedded contracts. A contract that deploys another (new X()) carries X's creation code, which ends in a CBOR block hashing X's source and settings; any source change, even a comment, changes it. AgiV2LaunchDeployer has three CBOR blocks: its own, the curve's and the token's.