SDK Explorer

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

Parameters
ImportContractRequest
object
Required
idempotency_key
string

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.

name
string
Required

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

description
string

The description for a contract.

address
string
Required

The on-chain address of this contract.

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
x_request_id
string

Developer-provided parameter used to identify this request. Useful when communicating with Circle Support.

Responses
Example
1from circle.web3 import smart_contract_platform
2from circle.web3 import utils
3
4client = utils.init_smart_contract_platform_client(api_key=key, entity_secret=entitySecret)
5
6api_instance = smart_contract_platform.DeployImportApi(client)
7request = smart_contract_platform.ImportContractRequest.from_dict({
8    "blockchain": "ETH-SEPOLIA",
9    "address": "0x1b44F3514812d835EB1BDB0acB33d3fA3351Ee43",
10    "name": "test"
11})
12response = api_instance.import_contract(import_contract_request=request)
13print(response.json())
14
ResponseChoose an example
1{
2  "data": {
3    "contract": {
4      "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",
5      "deployer_wallet_id": "f39e3dbd-84af-4d3d-b5ac-98fbe047ce6a",
6      "deployment_transaction_id": "00ca46f3-c31b-4e3a-92a9-068d4ff26a63",
7      "tx_hash": "0x4a25cc5e661d8504b59c5f38ba93f010e8518966f00e2ceda7955c4b8621357d",
8      "abi_json": "[{\"inputs\": [],\"stateMutability\": \"nonpayable\",\"type\": \"constructor\"},...",
9      "archived": false,
10      "blockchain": "MATIC-AMOY",
11      "bytecode": "0x60806040523480156200001157600080fd5b50604051806040...",
12      "contract_address": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb",
13      "contract_input_type": "IMPORT",
14      "deployer_address": "0x1bf9ad0cc2ad298c69a2995aa806ee832788218c",
15      "deployer_user_id": "",
16      "deployment_error_reason": "",
17      "deployment_error_details": "",
18      "name": "First Contract",
19      "description": "My first hello world contract",
20      "status": "PENDING",
21      "verification_status": "UNVERIFIED",
22      "metadata_link": "https://ipfs.io/ipfs/Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu",
23      "update_date": "2023-01-01T12:04:05Z",
24      "create_date": "2023-01-01T12:04:05Z",
25      "source_code": [
26        {
27          "file_name": "openzeppelin-solidity/contracts/math/SafeMath.sol",
28          "file_content": "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          "state_mutability": "nonpayable",
35          "type": "function",
36          "inputs": [
37            {
38              "components": [],
39              "indexed": false,
40              "name": "to",
41              "type": "address",
42              "flattened_type": ""
43            }
44          ],
45          "outputs": [
46            {
47              "components": [],
48              "indexed": false,
49              "name": "to",
50              "type": "address",
51              "flattened_type": ""
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              "flattened_type": ""
68            }
69          ]
70        }
71      ],
72      "implementation_contract": {}
73    }
74  }
75}
Did this page help you?
© 2023-2025 Circle Technology Services, LLC. All rights reserved.