Skip to main content

Create2 Verification

Verify counterfactual smart contracts created with the opcode CREATE2 with session.

note

Session-based API is only meant for the sourcify.dev UI. Because it makes use of session cookies and it is not possible have Access-Control-Allow-Origin: * with credentials: true, meaning these endpoints can only be used on explicitly set domains on the browser. (e.g. sourcify.dev). Please use the verification API if you want Sourcify on your frontend.

URL : /session/verify/create2

Method : POST

body

{
"verificationId": "0xedb48e28ff41f826b1fbb20a7601e5f79bd0b1c08c36214de5b6a1e00c1bdb46",
"deployerAddress": "0x0000...",
"salt": "0x0000000000000000000000000000000000000000000000000000000000000001",
"constructorArgs": [
{ "type": "uint256", "value": "1" }
],
"create2Address": "0x0000...",
"clientToken": "CREATE2_CLIENT_TOKEN"
}
  • The verificationId is the Sourcify's session contract id, it needs to be the verificationId of a contract compiled by /session/create2/compile. On the UI it is done automatically.
  • The salt depends on the factory contract, please make sure to use the right type

Responses

Condition : The provided contract perfectly matches the one at the provided chainId and address.

Code : 200 OK

Content :

{
"contracts": [
{
"verificationId": "0x8e2d0b6fef24d782a7c47e67ddfd2f5ca9cace335ce42bd10701ebba609e1244",
"constructorArguments": [
{
"internalType": "uint256",
"name": "_number",
"type": "uint256"
}
],
"creationBytecode": "0x608060405234801561001057600080fd5b5060405161020638038061020683398181016040528101906100329190610054565b80600081905550506100a7565b60008151905061004e81610090565b92915050565b60006020828403121561006a5761006961008b565b5b60006100788482850161003f565b91505092915050565b6000819050919050565b600080fd5b61009981610081565b81146100a457600080fd5b50565b610150806100b66000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80632e64cec11461003b5780636057361d14610059575b600080fd5b610043610075565b60405161005091906100d9565b60405180910390f35b610073600480360381019061006e919061009d565b61007e565b005b60008054905090565b8060008190555050565b60008135905061009781610103565b92915050565b6000602082840312156100b3576100b26100fe565b5b60006100c184828501610088565b91505092915050565b6100d3816100f4565b82525050565b60006020820190506100ee60008301846100ca565b92915050565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea26469706673582212201d279c878911e1b98344e0d39ca1fe4c6aa7b9c649951e3abc365183e0e1695964736f6c63430008070033",
"compiledPath": "contracts/SingleFile.sol",
"name": "Storage",
"address": "0x4e3953cfaf4e3cc4e98d024aa1ec690733588e10",
"files": {
"found": ["contracts/SingleFile.sol"],
"missing": {},
"invalid": {}
},
"status": "perfect",
"storageTimestamp": "2022-10-26T15:08:14.320Z"
}
],
"unused": [],
"files": ["metadata.json", "SingleFile.sol"]
}