SDK Explorer

Deploy a smart contract using a template.

Parameters
TemplateContractDeploymentRequest
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.

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
wallet_id
string
Required

System-generated unique identifier of the resource.

name
string
Required

Name of the contract in your Circle console.

description
string

Description of the contract.

entity_secret_ciphertext
string

A base64 string expression of the entity secret ciphertext. The entity secret should be encrypted by the entity public key. Circle mandates that the entity secret ciphertext is unique for each API request.

template_parameters
object

JSON object that contains the template deployment parameters used to initialize the contract(s) on-chain.

fee_level
string

A dynamic blockchain fee level setting (LOW, MEDIUM, or HIGH) that will be used to pay gas for the transaction. Calculated based on network traffic, supply of validators, and demand for transaction verification. Cannot be used with gasPrice, priorityFee, or maxFee. Estimates for each fee level can be obtained through the POST /transactions/transfer/estimateFee API.

Allowed valuesLOWMEDIUMHIGH
gas_limit
string

The maximum units of gas to use for the transaction. Required if feeLevel is not provided. Estimates for this limit can be obtained through the POST /transactions/transfer/estimateFee API. GasLimit override (only supported for EOA wallets): Using gasLimit together with feeLevel, the provided gasLimit is required to be greater or equal to feeLevel estimation and will override the estimation's gasLimit.

gas_price
string

For blockchains without EIP-1559 support, the maximum price of gas, in gwei, to use per each unit of gas (see gasLimit). Requires gasLimit. Cannot be used with feeLevel, priorityFee, or maxFee. Estimates for this fee can be obtained through the POST /transactions/transfer/estimateFee API.

max_fee
string

For blockchains with EIP-1559 support, the maximum price per unit of gas (see gasLimit), in gwei. Requires priorityFee, and gasLimit to be present. Cannot be used with feeLevel or gasPrice. Estimates for this fee can be obtained through the POST /transactions/transfer/estimateFee API.

priority_fee
string

For blockchains with EIP-1559 support, the “tip”, in gwei, to add to the base fee as an incentive for validators. Please note that the maxFee and gasLimit parameters are required alongside the priorityFee. The feeLevel and gasPrice parameters cannot be used with the priorityFee. Estimations for this fee can be obtained through the POST /transactions/transfer/estimateFee API.

ref_id
string

RefID is a custom label field.

id
string
Required

The universally unique identifier of the resource.

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.TemplatesApi(client)
7request = smart_contract_platform.TemplateContractDeploymentRequest.from_dict({
8    "blockchain": "ETH-SEPOLIA",
9    "walletId": "301e9038-e4c3-5a77-a9fe-95fd644f4c85",
10    "name": "test",
11    "feeLevel": "HIGH",
12})
13response = api_instance.deploy_contract_template(id="a2b66f87-3131-2832-bcd3-175a36a4d442", template_contract_deployment_request=request)
14print(response.json())
15
ResponseChoose an example
1{
2  "data": {
3    "contract_ids": [
4      ""
5    ],
6    "transaction_id": ""
7  }
8}
Did this page help you?
© 2023-2025 Circle Technology Services, LLC. All rights reserved.