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, the create2 form is protected by an Auth0 login. You can create your account signing up with your email.

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 Login

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

API

You can use the /verify/create2 API to verify create2 contracts. Read the API page for more details about how to call the API and how to authenticate.