API Reference

Import a contract

posthttps://api.circle.com/v1/w3s/contracts/import

  • Reference
  • Playground

Add an existing smart contract to your library of contracts. It also can be done in the Developer Services Console.

Body parameters
blockchain
string
Required

The blockchain network that the resource is to be created on or is currently on. Required along with sourceAddress if you don't provide walletId. The blockchain and walletId fields are mutually exclusive.

Allowed valuesETHETH-SEPOLIAMATICMATIC-AMOYARBARB-SEPOLIAUNIUNI-SEPOLIABASEBASE-SEPOLIAOPOP-SEPOLIA
address
string
Required

The on-chain address of this contract.

name
string
Required

The name for a contract. Must be alphanumeric [a-zA-Z0-9].

idempotencyKey
string
Required

Universally unique identifier (UUID v4) idempotency key. This key is utilized to ensure exactly-once execution of mutating requests. To create a UUIDv4 go to uuidgenerator.net. If the same key is reused, it will be treated as the same request and the original response will be returned.

description
string

The description for a contract.

Response
RequestChoose a language
ResponseChoose an example
1{
2  "data": {
3    "contract": {
4      "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",
5      "deployerWalletID": "f39e3dbd-84af-4d3d-b5ac-98fbe047ce6a",
6      "deploymentTransactionId": "00ca46f3-c31b-4e3a-92a9-068d4ff26a63",
7      "txHash": "0x4a25cc5e661d8504b59c5f38ba93f010e8518966f00e2ceda7955c4b8621357d",
8      "abiJson": "[{\"inputs\": [],\"stateMutability\": \"nonpayable\",\"type\": \"constructor\"},...",
9      "archived": false,
10      "blockchain": "MATIC-AMOY",
11      "bytecode": "0x60806040523480156200001157600080fd5b50604051806040...",
12      "contractAddress": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb",
13      "contractInputType": "IMPORT",
14      "deployerAddress": "0x1bf9ad0cc2ad298c69a2995aa806ee832788218c",
15      "deployerUserID": "",
16      "deploymentErrorReason": "",
17      "deploymentErrorDetails": "",
18      "name": "First Contract",
19      "description": "My first hello world contract",
20      "status": "PENDING",
21      "verificationStatus": "UNVERIFIED",
22      "metadataLink": "https://ipfs.io/ipfs/Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu",
23      "updateDate": "2023-01-01T12:04:05Z",
24      "createDate": "2023-01-01T12:04:05Z",
25      "sourceCode": [
26        {
27          "fileName": "openzeppelin-solidity/contracts/math/SafeMath.sol",
28          "fileContent": "pragma solidity ^0.4.24;\n\n/**\n * @title SafeMath\n * @dev Math operations with safety checks..."
29        }
30      ],
31      "functions": [
32        {
33          "name": "approve",
34          "stateMutability": "nonpayable",
35          "type": "function",
36          "inputs": [
37            {
38              "components": [],
39              "indexed": false,
40              "name": "to",
41              "type": "address",
42              "flattenedType": ""
43            }
44          ],
45          "outputs": [
46            {
47              "components": [],
48              "indexed": false,
49              "name": "to",
50              "type": "address",
51              "flattenedType": ""
52            }
53          ]
54        }
55      ],
56      "events": [
57        {
58          "name": "Approval",
59          "type": "event",
60          "anonymous": false,
61          "inputs": [
62            {
63              "components": [],
64              "indexed": false,
65              "name": "to",
66              "type": "address",
67              "flattenedType": ""
68            }
69          ]
70        }
71      ],
72      "implementationContract": {}
73    }
74  }
75}
Did this page help you?
© 2023-2025 Circle Technology Services, LLC. All rights reserved.