Skip to main content
POST
/
v1
/
w3s
/
contracts
/
deploy
/
estimateFee
curl --request POST \
--url https://api.circle.com/v1/w3s/contracts/deploy/estimateFee \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"walletId": "004735f6-d9fc-44f8-933c-672cdf3d240d",
"bytecode": "0x60806040523480156200001157600080fd5b50604051806040...",
"constructorSignature": "constructor(string, uint256)",
"constructorParameters": [
"TICK",
10000
]
}'
{
  "data": {
    "high": {
      "gasLimit": "21000",
      "gasPrice": "<string>",
      "maxFee": "5.935224468",
      "priorityFee": "1.022783914",
      "baseFee": "1.022783914",
      "networkFee": "0.0001246397138",
      "networkFeeRaw": "0.0001246397138"
    },
    "low": {
      "gasLimit": "21000",
      "gasPrice": "<string>",
      "maxFee": "5.935224468",
      "priorityFee": "1.022783914",
      "baseFee": "1.022783914",
      "networkFee": "0.0001246397138",
      "networkFeeRaw": "0.0001246397138"
    },
    "medium": {
      "gasLimit": "21000",
      "gasPrice": "<string>",
      "maxFee": "5.935224468",
      "priorityFee": "1.022783914",
      "baseFee": "1.022783914",
      "networkFee": "0.0001246397138",
      "networkFeeRaw": "0.0001246397138"
    }
  }
}

Authorizations

Authorization
string
header
required

Circle's API Keys are formatted in the following structure "PREFIX:ID:SECRET". All three parts are requred to make a successful request.

Headers

X-Request-Id
string

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

Example:

"2adba88e-9d63-44bc-b975-9b6ae3440dde"

Body

application/json

Estimate a transaction fee for deploying a smart contract

bytecode
string
required

Bytecode of the contract being deployed.

Minimum length: 1
Example:

"0x60806040523480156200001157600080fd5b50604051806040..."

abiJson
string

The contract's ABI in a JSON stringified format.

Example:

"[{\"inputs\": [],\"stateMutability\": \"nonpayable\",\"type\": \"constructor\"},..."

blockchain
enum<string>

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.

Available options:
ETH,
ETH-SEPOLIA,
MATIC,
MATIC-AMOY,
ARB,
ARB-SEPOLIA,
UNI,
UNI-SEPOLIA,
BASE,
BASE-SEPOLIA,
OP,
OP-SEPOLIA
Example:

"MATIC-AMOY"

constructorSignature
string

Signature of the constructor if the contract has one. constructor() by default.

Required string length: 1 - 1000
Example:

"constructor(string ticker, uint256 totalSupply)"

constructorParameters
any[]

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

Can be any value - string, number, boolean, array or object.

Example:
["TICK", 10000]
sourceAddress
string

Source address of the transaction. Required along with blockchain if walletId is not provided. The sourceAddress and walletId fields are mutually exclusive.

Example:

"0x1bf9ad0cc2ad298c69a2995aa806ee832788218c"

walletId
string<uuid>

Unique system generated identifier of the wallet. Required when sourceAddress and blockchain are not provided. Mutually exclusive with sourceAddress and blockchain. For contract deploys this wallet ID will be used as the source.

Example:

"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"

Response

Estimate is successful.

data
object
required
I