SDK Explorer

Deploy a smart contract on a specified blockchain using the contract's ABI and bytecode. The deployment will originate from one of your Circle Programmable Wallets.

Parameters
input
object
Required

Represents the input parameters for deploying a contract.

abiJson
string
Required

The contract's ABI in a JSON stringified format.

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 valuesARBARB-SEPOLIABASEBASE-SEPOLIAETHETH-SEPOLIAMATICMATIC-AMOYOPOP-SEPOLIAUNIUNI-SEPOLIA
bytecode
string
Required

Bytecode of the contract being deployed.

constructorParameters
array of anys

A list of arguments to pass to the contract's constructor function. Must be an empty array if there are no constructor parameters.

description
string

The description for the contract.

fee
object
Required

Represents the configuration for setting fees. It can be either FeeLevelInput, GasInput, or FeeInput.

option 1:
config
object
Required
gasLimit
string
Required

The maximum gas units for the transaction, required if feeLevel isn't provided. Use the Estimate Fee methods for this limit's estimation.

maxFee
string
Required

The maximum price per gas unit (see gasLimit), in gwei. Requires priorityFee, and gasLimit, but incompatible with feeLevel or gasPrice. Use the Estimate Fee methods to get this fee's estimates.

priorityFee
string
Required

Requires maxFee, and gasLimit but incompatible with feeLevel or gasPrice. Use the Estimate Fee methods for fee estimates.

type
string
Allowed valuesabsolute
option 2:
config
object
Required
gasLimit
string
Required

The maximum gas units for the transaction, required if feeLevel is not provided. Use the Estimate Fee methods for this limit's estimation.

gasPrice
string
Required

For EIP-1559 supported blockchains, it's the max gas price per gas unit (see gasLimit), in gwei. Requires gasLimit and incompatible with feeLevel, priorityFee, or maxFee. Use the Estimate Fee methods for fee estimates.

type
string
Allowed valuesgas
option 3:
config
object
Required
feeLevel
string
Required

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 valuesHIGHLOWMEDIUM
type
string
Allowed valueslevel
name
string
Required

The contract's name.

refId
string

The reference ID for the operation, to ensure idempotency.

walletId
string
Required

Unique identifier of the wallet that will deploy the contract.

idempotencyKey
string

The optional idempotency key. An idempotency key is a unique identifier used to identify and handle duplicate requests in order to ensure idempotent behavior, where multiple identical requests have the same effect as a single request.

We will generate one if you do not provide it.

Responses
Example
1const response = await client.deployContract({
2  name: 'First Contract',
3  description: 'My first hello world contract',
4  blockchain: 'ETH-SEPOLIA',
5  walletId: '004735f6-d9fc-44f8-933c-672cdf3d240d',
6  abiJson: '[\n\t{\n\t\t\'inputs\': [],\n\t\t\'stateMutability\': \'nonpayable\',\n\t\t\'type\': \'constructor\'\n\t},\n\t...',
7  bytecode: '0x60806040523480156200001157600080fd5b50604051806040...',
8  constructorParameters: ['TICK',10000],
9  fee: {
10    type: 'level',
11    config: {
12      feeLevel: 'HIGH',
13    },
14  },
15})
16console.log(response.data)
ResponseChoose an example
1{
2  "data": {
3    "contractId": "676f83a8-81a1-4dd5-b738-e2509b8f5460",
4    "transactionId": "36790743-b78d-4061-9558-1af9a9c837bd"
5  }
6}
Did this page help you?
© 2023-2025 Circle Technology Services, LLC. All rights reserved.