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
| Model | solc | Optimizer | EVM version | Pipeline |
|---|---|---|---|---|
| V1 | 0.8.30 | on, 300 runs | cancun | viaIR |
| V2 | 0.8.35 | on, 200 runs | cancun | viaIR |
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.AgiV2LaunchDeployerhas three CBOR blocks: its own, the curve's and the token's.