Skip to main content

Create2 Verification

Sourcify allows you to verify counterfactual smart contracts (i.e., contracts not yet deployed on the chain) that will be deployed with the CREATE2 opcode.

Create2

The CREATE2 opcode gives us the ability deterministically generate a contract address where a contract will be deployed, without ever having to do so.

The whole idea behind this opcode is to make the resulting address independent of future events. Regardless of what may happen on the blockchain, it will always be possible to deploy the contract at the precomputed address.

New addresses are a function of:

  • The deployer address
  • A salt (an arbitrary value)
  • The to-be-deployed contract's "init code" which usually consists of:
    • the creation bytecode
    • constructor arguments

Verification UI

Using the UI it is possible to verify a counterfactual smart contract, in this moment the API is protected by a client token in order to prevent spamming. It is possible to request access by sending an email to hello@sourcify.dev.

Features:

  • The contracts' creation bytecode is generated automatically server side by recompiling the contracts
  • The required constructor arguments are exctracted automatically from the metadata
  • While filling the fields you will see a preview of the create2 generated address above the Verify button.

Create2 Verification

Lookup UI

In the Lookup UI a create2 verified contract will be displayed as verified even if has not yet been deployed on any chain.

Also, the page will show

  • The deployer address
  • The salt
  • The constructor arguments

Create2 Lookup