> ## Documentation Index
> Fetch the complete documentation index at: https://developers.circle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy a contract

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



## OpenAPI

````yaml openapi/smart-contract-platform.yaml post /v1/w3s/contracts/deploy
openapi: 3.0.3
info:
  description: This is the Circle Contracts API documentation.
  title: Circle Contracts
  version: '1.0'
servers:
  - url: https://api.circle.com
security:
  - BearerAuth: []
tags:
  - name: Templates
  - name: View / Update
  - name: Interact
  - name: Deploy / Import
  - name: Event Monitors
paths:
  /v1/w3s/contracts/deploy:
    post:
      tags:
        - Deploy / Import
      summary: Deploy a contract
      description: >-
        Deploy a smart contract on a specified blockchain using the contract's
        ABI and bytecode. The deployment will originate from one of your Circle
        Wallets.
      operationId: deployContract
      parameters:
        - $ref: '#/components/parameters/XRequestId'
      requestBody:
        $ref: '#/components/requestBodies/ContractDeployment'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDeployment'
          description: Idempotent request. Contract deployment request already submitted.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDeployment'
          description: New contract is deployed.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Error response for the request.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
      security:
        - BearerAuth: []
components:
  parameters:
    XRequestId:
      name: X-Request-Id
      in: header
      description: >
        Developer-provided identifier for this request, used for tracing
        requests in Wallets API logs and the Developer Console, and when
        communicating with Circle Support.

        **Must be a UUID to appear in logs.** Non-UUID values are accepted by
        the API but are ignored by logging and tracing systems.
      schema:
        $ref: '#/components/schemas/XRequestId'
  requestBodies:
    ContractDeployment:
      content:
        application/json:
          schema:
            title: ContractDeploymentRequest
            type: object
            required:
              - abiJson
              - blockchain
              - bytecode
              - entitySecretCiphertext
              - idempotencyKey
              - name
              - walletId
            properties:
              idempotencyKey:
                $ref: '#/components/schemas/IdempotencyKey'
              name:
                $ref: '#/components/schemas/ContractName'
              description:
                $ref: '#/components/schemas/ContractDescription'
              walletId:
                $ref: '#/components/schemas/WalletId'
              abiJson:
                $ref: '#/components/schemas/AbiJson'
              bytecode:
                $ref: '#/components/schemas/Bytecode'
              entitySecretCiphertext:
                $ref: '#/components/schemas/EntitySecretCiphertext'
              blockchain:
                $ref: '#/components/schemas/Blockchain'
              constructorParameters:
                $ref: '#/components/schemas/ConstructorParameters'
              feeLevel:
                $ref: '#/components/schemas/FeeLevel'
              gasLimit:
                $ref: '#/components/schemas/GasLimit'
              gasPrice:
                $ref: '#/components/schemas/GasPrice'
              maxFee:
                $ref: '#/components/schemas/MaxFee'
              priorityFee:
                $ref: '#/components/schemas/PriorityFee'
              refId:
                $ref: '#/components/schemas/TransactionReferenceId'
          examples:
            Wallet ID:
              value:
                idempotencyKey: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
                name: First Contract
                description: My first hello world contract
                walletId: 004735f6-d9fc-44f8-933c-672cdf3d240d
                blockchain: ETH
                abiJson: "[\n\t{\n\t\t\"inputs\": [],\n\t\t\"stateMutability\": \"nonpayable\",\n\t\t\"type\": \"constructor\"\n\t},\n\t..."
                bytecode: 0x60806040523480156200001157600080fd5b50604051806040...
                constructorParameters:
                  - TICK
                  - 10000
                feeLevel: MEDIUM
                entitySecretCiphertext: >-
                  DjIdkhAWMvKDQKx70jH4tJE00EPAKUgT34++bnpfuK6BU2FqfuGR7Y9nZp4tStJYEdDAIw5yNNGoX3jtj8uWsC4ee31Y+ltPgciYNRjcmEuHy4+qWySlt5ao2ZfgyxBdmRLqcS3nwT0EwgSugijzCjWOmhge2eB/JOZYW2RjSJBJvfTS5uWghbebtpzPca0x+0IAYUIQdanWU7aog2vk0BWmGSEiDw7dRlcan6m8t2BbiVMCffQ/LF76PyXyqVUhnPk4JHPQ/Iee4vLk7M79d2zerzA2KBLQ5xcpVoUqr31YhbrV5OIcIDaOuG09aQ67b6L/zDzCpvb2YdGLdou3YllitrSktE9Ocxmbrlq2iQM1zcsrg3FN5HIY3QuzcQCUWW1k+46hvtGi/xMgFPHrM1kJV8Dlj93+VYQ4EWoIUukQGrERd9SxWjmCh3guii793Ndfe7KZb7QF6Cm+8Q4aYVbP9zZLGtZn50jmm7J2VOyO0fxAlcha2KcUIZU8WqZppvCIKAGlSuMrfGZly/P9i1NjN3kYv1CE13f/FuBh0aLIb5IXG/oeHHv6IZVOOWwvET7XhyOzeeS6zZXWL6Xuxap+ctdMT+ik7DK2rfzIi2NtkzMKuJ/TWRHdfwTMv7qBP7IhiWgPDICPTJSQk+MTFycg4rECbI/Bc2LIclpyrlo=
      description: Deploy contract request
      required: true
  schemas:
    ContractDeployment:
      title: ContractDeploymentResponse
      type: object
      required:
        - data
      properties:
        data:
          type: object
          required:
            - contractId
            - transactionId
          properties:
            contractId:
              type: string
              description: Unique identifier of the created smart contract.
              example: 676f83a8-81a1-4dd5-b738-e2509b8f5460
            transactionId:
              type: string
              description: Unique identifier of the deployment transaction.
              example: 36790743-b78d-4061-9558-1af9a9c837bd
    Error:
      title: Error
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          description: Code that corresponds to the error.
        message:
          type: string
          description: Message that describes the error.
    XRequestId:
      type: string
      format: uuid
      description: >-
        A unique identifier, which can be helpful for identifying a request when
        communicating with Circle support.
      example: 2adba88e-9d63-44bc-b975-9b6ae3440dde
    IdempotencyKey:
      type: string
      description: >-
        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](https://www.uuidgenerator.net). If the same key is
        reused, it will be treated as the same request and the original response
        will be returned.
      example: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
      format: uuid
    ContractName:
      type: string
      description: The name for a contract. Must be alphanumeric [a-zA-Z0-9].
      example: First Contract
    ContractDescription:
      type: string
      description: The description for a contract.
      example: My first hello world contract
    WalletId:
      title: WalletId
      type: string
      format: uuid
      description: |
        Unique system generated identifier of the wallet.
        For contract deploys this wallet ID will be used as the source.
      example: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
    AbiJson:
      type: string
      description: The contract's ABI in a JSON stringified format.
      example: >-
        [{"inputs": [],"stateMutability": "nonpayable","type":
        "constructor"},...
    Bytecode:
      type: string
      description: Bytecode of the contract being deployed.
      minLength: 1
      writeOnly: true
      example: 0x60806040523480156200001157600080fd5b50604051806040...
    EntitySecretCiphertext:
      type: string
      description: >
        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.
      format: byte
      example: >-
        M8OAwbJ8rMsPd8+NT4xRDBDJSNqUKAvJeWPyuwZSlVXgRucogAlBxjvjIw4nsKeJ4hejjlpmyaaJrusHm6zsvy4BLuL1an3dYn3wORjYf3sU4QN9Rdk9OJxZvE5hDNPq7okucvb1eElxPVREZvr4ew7sh4ktmwDrwWFUYwKoly4fEzxYI9zvVpCY9xPSgkA5m3u1/P2vMYZ0QFtn8lRZxCuTyc4wRLpT9TOaK46CEXCakmAYaYWnLkl18QXOSY6FhCbGm+zQ2Uu4cUPU/bqjIyQIB80ut3drInDzysQLE/FJjcJW9+q+E75LKGKnrp2zCg/Xv3TEvru9a2A0vd7InZ9kNuxnPPFc1JSO7BT2TPP89YcLO0OmtRiGoXPlYzXuNIfUsVQ5/FW9FPp4qp+iMPrAidsjQrskHPxhW92GeezLpOSkUl7lAWQoioYED979mqGfzNIZTF5Ob6fJifboiwhOab6sAKnxmvWjgFnW/bZ5a8xkzgPc4RHpIejot1Q7fpT+67eA+DVxvUqakJI6t3iEaZTNITCSU2Cfj1oyCQfrZGf9tauW49rO1zYHKoV4z9ylymOWtCUk641iyxwFCNSW47CDsc0M8iI4J6JqsNMpQuR9sdWVhROi5yn9UR7ac7pizB3dFmc0/qjtTRoYStaaSEYg3L5woALv5kAA2j4=
    Blockchain:
      type: string
      description: >
        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.
      enum:
        - ETH
        - ETH-SEPOLIA
        - MATIC
        - MATIC-AMOY
        - ARB
        - ARB-SEPOLIA
        - UNI
        - UNI-SEPOLIA
        - BASE
        - BASE-SEPOLIA
        - OP
        - OP-SEPOLIA
        - AVAX
        - AVAX-FUJI
        - ARC-TESTNET
        - MONAD
        - MONAD-TESTNET
      example: MATIC-AMOY
    ConstructorParameters:
      title: ConstructorParameters
      type: array
      description: >-
        A list of arguments to pass to the contract's constructor function. Must
        be an empty array if there are no constructor parameters.
      items:
        $ref: '#/components/schemas/AnyValue'
      example:
        - TICK
        - 10000
    FeeLevel:
      type: string
      enum:
        - LOW
        - MEDIUM
        - HIGH
      example: MEDIUM
      description: >
        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-reference/w3s/developer-controlled-wallets/create-transfer-estimate-fee)
        API.
    GasLimit:
      type: string
      description: >
        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-reference/w3s/developer-controlled-wallets/create-transfer-estimate-fee)
        API.

        An insufficient gas limit may cause the transaction to fail on-chain.
        Use this field with care when manually providing values.

        GasLimit override (only supported for EOA wallets): Using `gasLimit`
        together with `feeLevel`, the provided `gasLimit` will override the
        estimation's gasLimit.
      example: '21000'
    GasPrice:
      type: string
      description: >
        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-reference/w3s/developer-controlled-wallets/create-transfer-estimate-fee)
        API.

        The wallet service enforces a dynamic minimum `gasPrice` based on
        current network conditions. Requests specifying a `gasPrice` below this
        minimum will be rejected
    MaxFee:
      type: string
      example: '5.935224468'
      description: >
        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-reference/w3s/developer-controlled-wallets/create-transfer-estimate-fee)
        API.
    PriorityFee:
      type: string
      example: '1.022783914'
      description: >
        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-reference/w3s/developer-controlled-wallets/create-transfer-estimate-fee)
        API.

        The wallet service enforces a dynamic minimum `priorityFee` based on
        current network conditions. Requests specifying a `priorityFee` below
        this minimum will be rejected
    TransactionReferenceId:
      type: string
      example: grouptransaction123
      description: Optional reference or description used to identify the transaction.
    AnyValue:
      description: Can be any value - string, number, boolean, array or object.
  headers:
    XRequestId:
      description: >
        Developer-provided header parameter or Circle-generated universally
        unique identifier (UUID v4). Useful for identifying a specific request
        when communicating with Circle Support.
      schema:
        $ref: '#/components/schemas/XRequestId'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: PREFIX:ID:SECRET
      description: >-
        Circle's API Keys are formatted in the following structure
        "PREFIX:ID:SECRET". All three parts are required to make a successful
        request.

````