# Table of Contents - [Ping - Circle Docs](#ping-circle-docs) - [Estimate fee for a contract template deployment - Circle Docs](#estimate-fee-for-a-contract-template-deployment-circle-docs) - [Estimate a contract deployment - Circle Docs](#estimate-a-contract-deployment-circle-docs) - [Get a contract - Circle Docs](#get-a-contract-circle-docs) - [Deploy a contract from a template - Circle Docs](#deploy-a-contract-from-a-template-circle-docs) - [Contracts - Circle Docs](#contracts-circle-docs) - [Delete Event Monitor - Circle Docs](#delete-event-monitor-circle-docs) - [Create Event Monitor - Circle Docs](#create-event-monitor-circle-docs) - [Create a notification subscription - Circle Docs](#create-a-notification-subscription-circle-docs) - [Get all notification subscriptions - Circle Docs](#get-all-notification-subscriptions-circle-docs) - [Delete a notification subscription - Circle Docs](#delete-a-notification-subscription-circle-docs) - [Retrieve a notification subscription - Circle Docs](#retrieve-a-notification-subscription-circle-docs) - [Deploy a contract - Circle Docs](#deploy-a-contract-circle-docs) - [Update a notification subscription - Circle Docs](#update-a-notification-subscription-circle-docs) - [Execute a query function on a contract - Circle Docs](#execute-a-query-function-on-a-contract-circle-docs) - [Get a notification signature public key - Circle Docs](#get-a-notification-signature-public-key-circle-docs) - [List contracts - Circle Docs](#list-contracts-circle-docs) - [Import a contract - Circle Docs](#import-a-contract-circle-docs) - [Get Event Monitors - Circle Docs](#get-event-monitors-circle-docs) - [Update an Event Monitor - Circle Docs](#update-an-event-monitor-circle-docs) - [Update a contract - Circle Docs](#update-a-contract-circle-docs) - [Get Event Logs - Circle Docs](#get-event-logs-circle-docs) - [Airdrop Template - Circle Docs](#airdrop-template-circle-docs) - [Quickstart: Event Monitoring for Smart Contracts - Circle Docs](#quickstart-event-monitoring-for-smart-contracts-circle-docs) - [Getting Started with the Contracts Node.js SDK - Circle Docs](#getting-started-with-the-contracts-node-js-sdk-circle-docs) - [Token Template - Circle Docs](#token-template-circle-docs) - [NFT Template - Circle Docs](#nft-template-circle-docs) - [Quickstart: Deploy an ERC-1155 Contract Template - Circle Docs](#quickstart-deploy-an-erc-1155-contract-template-circle-docs) - [Contracts Templates - Circle Docs](#contracts-templates-circle-docs) - [Multi-Token Template - Circle Docs](#multi-token-template-circle-docs) - [Circle Contracts Supported Blockchains - Circle Docs](#circle-contracts-supported-blockchains-circle-docs) - [Getting Started with the Contracts Python SDK - Circle Docs](#getting-started-with-the-contracts-python-sdk-circle-docs) - [Quickstart: Deploy a Smart Contract using Bytecode - Circle Docs](#quickstart-deploy-a-smart-contract-using-bytecode-circle-docs) - [Quickstart: Interact With a Smart Contract - Circle Docs](#quickstart-interact-with-a-smart-contract-circle-docs) --- # Ping - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/common/ping#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Health Ping [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * [GET\ \ Ping](https://developers.circle.com/api-reference/contracts/common/ping) * Webhook Subscriptions ##### Contracts * Templates * View / Update * Interact * Deploy / Import * Event Monitors Ping cURL Copy curl --request GET \ --url https://api.circle.com/ping 200 Copy { "message": "pong" } GET / ping Try it Ping cURL Copy curl --request GET \ --url https://api.circle.com/ping 200 Copy { "message": "pong" } #### Response 200 - application/json Successful ping. [​](https://developers.circle.com/api-reference/contracts/common/ping#response-message) message string required Response to a ping. Example: `"pong"` Was this page helpful? YesNo [Get all notification subscriptions\ \ Next](https://developers.circle.com/api-reference/contracts/common/get-subscriptions) ⌘I --- # Estimate fee for a contract template deployment - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-template-deploy#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Templates Estimate fee for a contract template deployment [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions ##### Contracts * Templates * [POST\ \ Estimate fee for a contract template deployment](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-template-deploy) * [POST\ \ Deploy a contract from a template](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template) * View / Update * Interact * Deploy / Import * Event Monitors Estimate fee for a contract template deployment cURL Copy curl --request POST \ --url https://api.circle.com/v1/w3s/templates/{id}/deploy/estimateFee \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "blockchain": "MATIC-AMOY", "sourceAddress": "0x1bf9ad0cc2ad298c69a2995aa806ee832788218c", "templateParameters": {}, "walletId": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" } ' 200 400 Copy { "data": { "high": { "gasLimit": "21000", "gasPrice": "", "maxFee": "5.935224468", "priorityFee": "1.022783914", "baseFee": "1.022783914", "networkFee": "0.0001246397138", "networkFeeRaw": "0.0001246397138", "l1Fee": "0.000000000000140021" }, "low": { "gasLimit": "21000", "gasPrice": "", "maxFee": "5.935224468", "priorityFee": "1.022783914", "baseFee": "1.022783914", "networkFee": "0.0001246397138", "networkFeeRaw": "0.0001246397138", "l1Fee": "0.000000000000140021" }, "medium": { "gasLimit": "21000", "gasPrice": "", "maxFee": "5.935224468", "priorityFee": "1.022783914", "baseFee": "1.022783914", "networkFee": "0.0001246397138", "networkFeeRaw": "0.0001246397138", "l1Fee": "0.000000000000140021" } } } POST / v1 / w3s / templates / {id} / deploy / estimateFee Try it Estimate fee for a contract template deployment cURL Copy curl --request POST \ --url https://api.circle.com/v1/w3s/templates/{id}/deploy/estimateFee \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "blockchain": "MATIC-AMOY", "sourceAddress": "0x1bf9ad0cc2ad298c69a2995aa806ee832788218c", "templateParameters": {}, "walletId": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" } ' 200 400 Copy { "data": { "high": { "gasLimit": "21000", "gasPrice": "", "maxFee": "5.935224468", "priorityFee": "1.022783914", "baseFee": "1.022783914", "networkFee": "0.0001246397138", "networkFeeRaw": "0.0001246397138", "l1Fee": "0.000000000000140021" }, "low": { "gasLimit": "21000", "gasPrice": "", "maxFee": "5.935224468", "priorityFee": "1.022783914", "baseFee": "1.022783914", "networkFee": "0.0001246397138", "networkFeeRaw": "0.0001246397138", "l1Fee": "0.000000000000140021" }, "medium": { "gasLimit": "21000", "gasPrice": "", "maxFee": "5.935224468", "priorityFee": "1.022783914", "baseFee": "1.022783914", "networkFee": "0.0001246397138", "networkFeeRaw": "0.0001246397138", "l1Fee": "0.000000000000140021" } } } #### Authorizations [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-template-deploy#authorization-authorization) 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 [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-template-deploy#parameter-x-request-id) X-Request-Id string Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support. Example: `"2adba88e-9d63-44bc-b975-9b6ae3440dde"` #### Path Parameters [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-template-deploy#parameter-id) id string required The universally unique identifier of the resource. Example: `"b3d9d2d5-4c12-4946-a09d-953e82fae2b0"` #### Body application/json Request object for estimating the transaction fees for deploying a contract from a template. [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-template-deploy#body-blockchain) blockchain enum 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. Available options: `ETH`, `ETH-SEPOLIA`, `MATIC`, `MATIC-AMOY`, `ARB`, `ARB-SEPOLIA`, `UNI`, `UNI-SEPOLIA`, `BASE`, `BASE-SEPOLIA`, `OP`, `OP-SEPOLIA` Example: `"MATIC-AMOY"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-template-deploy#body-source-address) 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"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-template-deploy#body-template-parameters) templateParameters object JSON object that contains the template deployment parameters used to initialize the contract(s) on-chain. Show child attributes [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-template-deploy#body-wallet-id) walletId string 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"` #### Response 200 application/json Response object with estimated transaction fee values. [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-template-deploy#response-data) data object required Show child attributes Was this page helpful? YesNo [Get a notification signature public key\ \ Previous](https://developers.circle.com/api-reference/contracts/common/get-notification-signature) [Deploy a contract from a template\ \ Next](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template) ⌘I --- # Estimate a contract deployment - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-deploy#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Deploy / Import Estimate a contract deployment [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions ##### Contracts * Templates * View / Update * Interact * Deploy / Import * [POST\ \ Import a contract](https://developers.circle.com/api-reference/contracts/smart-contract-platform/import-contract) * [POST\ \ Estimate a contract deployment](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-deploy) * [POST\ \ Deploy a contract](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract) * Event Monitors cURL Wallet ID Copy curl --request POST \ --url https://api.circle.com/v1/w3s/contracts/deploy/estimateFee \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "walletId": "004735f6-d9fc-44f8-933c-672cdf3d240d", "bytecode": "0x60806040523480156200001157600080fd5b50604051806040...", "constructorSignature": "constructor(string, uint256)", "constructorParameters": [\ "TICK",\ 10000\ ] } ' 200 400 Copy { "data": { "high": { "gasLimit": "21000", "gasPrice": "", "maxFee": "5.935224468", "priorityFee": "1.022783914", "baseFee": "1.022783914", "networkFee": "0.0001246397138", "networkFeeRaw": "0.0001246397138", "l1Fee": "0.000000000000140021" }, "low": { "gasLimit": "21000", "gasPrice": "", "maxFee": "5.935224468", "priorityFee": "1.022783914", "baseFee": "1.022783914", "networkFee": "0.0001246397138", "networkFeeRaw": "0.0001246397138", "l1Fee": "0.000000000000140021" }, "medium": { "gasLimit": "21000", "gasPrice": "", "maxFee": "5.935224468", "priorityFee": "1.022783914", "baseFee": "1.022783914", "networkFee": "0.0001246397138", "networkFeeRaw": "0.0001246397138", "l1Fee": "0.000000000000140021" } } } POST / v1 / w3s / contracts / deploy / estimateFee Try it cURL Wallet ID Copy curl --request POST \ --url https://api.circle.com/v1/w3s/contracts/deploy/estimateFee \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "walletId": "004735f6-d9fc-44f8-933c-672cdf3d240d", "bytecode": "0x60806040523480156200001157600080fd5b50604051806040...", "constructorSignature": "constructor(string, uint256)", "constructorParameters": [\ "TICK",\ 10000\ ] } ' 200 400 Copy { "data": { "high": { "gasLimit": "21000", "gasPrice": "", "maxFee": "5.935224468", "priorityFee": "1.022783914", "baseFee": "1.022783914", "networkFee": "0.0001246397138", "networkFeeRaw": "0.0001246397138", "l1Fee": "0.000000000000140021" }, "low": { "gasLimit": "21000", "gasPrice": "", "maxFee": "5.935224468", "priorityFee": "1.022783914", "baseFee": "1.022783914", "networkFee": "0.0001246397138", "networkFeeRaw": "0.0001246397138", "l1Fee": "0.000000000000140021" }, "medium": { "gasLimit": "21000", "gasPrice": "", "maxFee": "5.935224468", "priorityFee": "1.022783914", "baseFee": "1.022783914", "networkFee": "0.0001246397138", "networkFeeRaw": "0.0001246397138", "l1Fee": "0.000000000000140021" } } } #### Authorizations [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-deploy#authorization-authorization) 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 [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-deploy#parameter-x-request-id) X-Request-Id string Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support. Example: `"2adba88e-9d63-44bc-b975-9b6ae3440dde"` #### Body application/json Estimate a transaction fee for deploying a smart contract [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-deploy#body-bytecode) bytecode string required Bytecode of the contract being deployed. Minimum string length: `1` Example: `"0x60806040523480156200001157600080fd5b50604051806040..."` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-deploy#body-abi-json) abiJson string The contract's ABI in a JSON stringified format. Example: `"[{\"inputs\": [],\"stateMutability\": \"nonpayable\",\"type\": \"constructor\"},..."`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-deploy#body-blockchain)\ \ blockchain\ \ enum\ \ 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"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-deploy#body-constructor-signature)\ \ 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)"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-deploy#body-constructor-parameters)\ \ 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]\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-deploy#body-source-address)\ \ 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"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-deploy#body-wallet-id)\ \ walletId\ \ string\ \ 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"`\ \ #### Response\ \ 200\ \ application/json\ \ Estimate is successful.\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-deploy#response-data)\ \ data\ \ object\ \ required\ \ Show child attributes\ \ Was this page helpful?\ \ YesNo\ \ [Import a contract\ \ Previous](https://developers.circle.com/api-reference/contracts/smart-contract-platform/import-contract)\ [Deploy a contract\ \ Next](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract)\ \ ⌘I --- # Get a contract - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-contract#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation View / Update Get a contract [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions ##### Contracts * Templates * View / Update * [GET\ \ List contracts](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts) * [GET\ \ Get a contract](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-contract) * [PATCH\ \ Update a contract](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-contract) * Interact * Deploy / Import * Event Monitors Get a contract cURL Copy curl --request GET \ --url https://api.circle.com/v1/w3s/contracts/{id} \ --header 'Authorization: Bearer ' 200 400 Copy { "data": { "contract": { "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5", "archived": false, "blockchain": "MATIC-AMOY", "contractInputType": "IMPORT", "name": "First Contract", "status": "PENDING", "verificationStatus": "UNVERIFIED", "updateDate": "2023-01-01T12:04:05Z", "createDate": "2023-01-01T12:04:05Z", "sourceCode": [\ {\ "fileContent": "pragma solidity ^0.4.24;\n\n/**\n * @title SafeMath\n * @dev Math operations with safety checks...",\ "fileName": "openzeppelin-solidity/contracts/math/SafeMath.sol"\ }\ ], "functions": [\ {\ "type": "function",\ "name": "approve",\ "stateMutability": "nonpayable",\ "inputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ],\ "outputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ]\ }\ ], "events": [\ {\ "type": "event",\ "name": "Approval",\ "anonymous": false,\ "inputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ]\ }\ ], "deployerWalletID": "f39e3dbd-84af-4d3d-b5ac-98fbe047ce6a", "deploymentTransactionId": "00ca46f3-c31b-4e3a-92a9-068d4ff26a63", "txHash": "0x4a25cc5e661d8504b59c5f38ba93f010e8518966f00e2ceda7955c4b8621357d", "abiJson": "[{\"inputs\": [],\"stateMutability\": \"nonpayable\",\"type\": \"constructor\"},...",\ "contractAddress": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb",\ "deployerAddress": "0x1bf9ad0cc2ad298c69a2995aa806ee832788218c",\ "deployerUserID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\ "deploymentErrorReason": "",\ "deploymentErrorDetails": "",\ "description": "My first hello world contract",\ "metadataLink": "https://ipfs.io/ipfs/Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu",\ "implementationContract": {}\ }\ }\ }\ \ GET\ \ /\ \ v1\ \ /\ \ w3s\ \ /\ \ contracts\ \ /\ \ {id}\ \ Try it\ \ Get a contract\ \ cURL\ \ Copy\ \ curl --request GET \\ --url https://api.circle.com/v1/w3s/contracts/{id} \\ --header 'Authorization: Bearer '\ \ 200\ \ 400\ \ Copy\ \ {\ "data": {\ "contract": {\ "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",\ "archived": false,\ "blockchain": "MATIC-AMOY",\ "contractInputType": "IMPORT",\ "name": "First Contract",\ "status": "PENDING",\ "verificationStatus": "UNVERIFIED",\ "updateDate": "2023-01-01T12:04:05Z",\ "createDate": "2023-01-01T12:04:05Z",\ "sourceCode": [\ {\ "fileContent": "pragma solidity ^0.4.24;\n\n/**\n * @title SafeMath\n * @dev Math operations with safety checks...",\ "fileName": "openzeppelin-solidity/contracts/math/SafeMath.sol"\ }\ ],\ "functions": [\ {\ "type": "function",\ "name": "approve",\ "stateMutability": "nonpayable",\ "inputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ],\ "outputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ]\ }\ ],\ "events": [\ {\ "type": "event",\ "name": "Approval",\ "anonymous": false,\ "inputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ]\ }\ ],\ "deployerWalletID": "f39e3dbd-84af-4d3d-b5ac-98fbe047ce6a",\ "deploymentTransactionId": "00ca46f3-c31b-4e3a-92a9-068d4ff26a63",\ "txHash": "0x4a25cc5e661d8504b59c5f38ba93f010e8518966f00e2ceda7955c4b8621357d",\ "abiJson": "[{\"inputs\": [],\"stateMutability\": \"nonpayable\",\"type\": \"constructor\"},...",\ "contractAddress": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb",\ "deployerAddress": "0x1bf9ad0cc2ad298c69a2995aa806ee832788218c",\ "deployerUserID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\ "deploymentErrorReason": "",\ "deploymentErrorDetails": "",\ "description": "My first hello world contract",\ "metadataLink": "https://ipfs.io/ipfs/Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu",\ "implementationContract": {}\ }\ }\ }\ \ #### Authorizations\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-contract#authorization-authorization)\ \ 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\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-contract#parameter-x-request-id)\ \ X-Request-Id\ \ string\ \ Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support.\ \ Example:\ \ `"2adba88e-9d63-44bc-b975-9b6ae3440dde"`\ \ #### Path Parameters\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-contract#parameter-id)\ \ id\ \ string\ \ required\ \ The universally unique identifier of the resource.\ \ Example:\ \ `"b3d9d2d5-4c12-4946-a09d-953e82fae2b0"`\ \ #### Response\ \ 200\ \ application/json\ \ Contract retrieved successfully.\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-contract#response-data)\ \ data\ \ object\ \ required\ \ Show child attributes\ \ Was this page helpful?\ \ YesNo\ \ [List contracts\ \ Previous](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts)\ [Update a contract\ \ Next](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-contract)\ \ ⌘I --- # Deploy a contract from a template - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Templates Deploy a contract from a template [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions ##### Contracts * Templates * [POST\ \ Estimate fee for a contract template deployment](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-template-deploy) * [POST\ \ Deploy a contract from a template](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template) * View / Update * Interact * Deploy / Import * Event Monitors Deploy a contract from a template cURL Copy curl --request POST \ --url https://api.circle.com/v1/w3s/templates/{id}/deploy \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "idempotencyKey": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", "blockchain": "MATIC-AMOY", "walletId": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5", "name": "My Template Contract", "entitySecretCiphertext": "M8OAwbJ8rMsPd8+NT4xRDBDJSNqUKAvJeWPyuwZSlVXgRucogAlBxjvjIw4nsKeJ4hejjlpmyaaJrusHm6zsvy4BLuL1an3dYn3wORjYf3sU4QN9Rdk9OJxZvE5hDNPq7okucvb1eElxPVREZvr4ew7sh4ktmwDrwWFUYwKoly4fEzxYI9zvVpCY9xPSgkA5m3u1/P2vMYZ0QFtn8lRZxCuTyc4wRLpT9TOaK46CEXCakmAYaYWnLkl18QXOSY6FhCbGm+zQ2Uu4cUPU/bqjIyQIB80ut3drInDzysQLE/FJjcJW9+q+E75LKGKnrp2zCg/Xv3TEvru9a2A0vd7InZ9kNuxnPPFc1JSO7BT2TPP89YcLO0OmtRiGoXPlYzXuNIfUsVQ5/FW9FPp4qp+iMPrAidsjQrskHPxhW92GeezLpOSkUl7lAWQoioYED979mqGfzNIZTF5Ob6fJifboiwhOab6sAKnxmvWjgFnW/bZ5a8xkzgPc4RHpIejot1Q7fpT+67eA+DVxvUqakJI6t3iEaZTNITCSU2Cfj1oyCQfrZGf9tauW49rO1zYHKoV4z9ylymOWtCUk641iyxwFCNSW47CDsc0M8iI4J6JqsNMpQuR9sdWVhROi5yn9UR7ac7pizB3dFmc0/qjtTRoYStaaSEYg3L5woALv5kAA2j4=", "description": "My first template contract deployment!", "templateParameters": {}, "feeLevel": "MEDIUM", "gasLimit": "21000", "gasPrice": "", "maxFee": "5.935224468", "priorityFee": "1.022783914", "refId": "d620d523-b5ab-4541-94b0-efe4f4c825c8" } ' 200 201 400 Copy { "data": { "contractIds": [\ "3c90c3cc-0d44-4b50-8888-8dd25736052a"\ ], "transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a" } } POST / v1 / w3s / templates / {id} / deploy Try it Deploy a contract from a template cURL Copy curl --request POST \ --url https://api.circle.com/v1/w3s/templates/{id}/deploy \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "idempotencyKey": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", "blockchain": "MATIC-AMOY", "walletId": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5", "name": "My Template Contract", "entitySecretCiphertext": "M8OAwbJ8rMsPd8+NT4xRDBDJSNqUKAvJeWPyuwZSlVXgRucogAlBxjvjIw4nsKeJ4hejjlpmyaaJrusHm6zsvy4BLuL1an3dYn3wORjYf3sU4QN9Rdk9OJxZvE5hDNPq7okucvb1eElxPVREZvr4ew7sh4ktmwDrwWFUYwKoly4fEzxYI9zvVpCY9xPSgkA5m3u1/P2vMYZ0QFtn8lRZxCuTyc4wRLpT9TOaK46CEXCakmAYaYWnLkl18QXOSY6FhCbGm+zQ2Uu4cUPU/bqjIyQIB80ut3drInDzysQLE/FJjcJW9+q+E75LKGKnrp2zCg/Xv3TEvru9a2A0vd7InZ9kNuxnPPFc1JSO7BT2TPP89YcLO0OmtRiGoXPlYzXuNIfUsVQ5/FW9FPp4qp+iMPrAidsjQrskHPxhW92GeezLpOSkUl7lAWQoioYED979mqGfzNIZTF5Ob6fJifboiwhOab6sAKnxmvWjgFnW/bZ5a8xkzgPc4RHpIejot1Q7fpT+67eA+DVxvUqakJI6t3iEaZTNITCSU2Cfj1oyCQfrZGf9tauW49rO1zYHKoV4z9ylymOWtCUk641iyxwFCNSW47CDsc0M8iI4J6JqsNMpQuR9sdWVhROi5yn9UR7ac7pizB3dFmc0/qjtTRoYStaaSEYg3L5woALv5kAA2j4=", "description": "My first template contract deployment!", "templateParameters": {}, "feeLevel": "MEDIUM", "gasLimit": "21000", "gasPrice": "", "maxFee": "5.935224468", "priorityFee": "1.022783914", "refId": "d620d523-b5ab-4541-94b0-efe4f4c825c8" } ' 200 201 400 Copy { "data": { "contractIds": [\ "3c90c3cc-0d44-4b50-8888-8dd25736052a"\ ], "transactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a" } } #### Authorizations [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#authorization-authorization) 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 [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#parameter-x-request-id) X-Request-Id string Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support. Example: `"2adba88e-9d63-44bc-b975-9b6ae3440dde"` #### Path Parameters [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#parameter-id) id string required The universally unique identifier of the resource. Example: `"b3d9d2d5-4c12-4946-a09d-953e82fae2b0"` #### Body application/json Deploy contract by template request. [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#body-idempotency-key) idempotencyKey string required 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"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#body-blockchain) blockchain enum 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. Available options: `ETH`, `ETH-SEPOLIA`, `MATIC`, `MATIC-AMOY`, `ARB`, `ARB-SEPOLIA`, `UNI`, `UNI-SEPOLIA`, `BASE`, `BASE-SEPOLIA`, `OP`, `OP-SEPOLIA` Example: `"MATIC-AMOY"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#body-wallet-id) walletId string required System-generated unique identifier of the resource. Example: `"c4d1da72-111e-4d52-bdbf-2e74a2d803d5"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#body-name) name string required Name of the contract in your Circle console. Required string length: `1 - 100` Example: `"My Template Contract"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#body-entity-secret-ciphertext) entitySecretCiphertext string required 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. Example: `"M8OAwbJ8rMsPd8+NT4xRDBDJSNqUKAvJeWPyuwZSlVXgRucogAlBxjvjIw4nsKeJ4hejjlpmyaaJrusHm6zsvy4BLuL1an3dYn3wORjYf3sU4QN9Rdk9OJxZvE5hDNPq7okucvb1eElxPVREZvr4ew7sh4ktmwDrwWFUYwKoly4fEzxYI9zvVpCY9xPSgkA5m3u1/P2vMYZ0QFtn8lRZxCuTyc4wRLpT9TOaK46CEXCakmAYaYWnLkl18QXOSY6FhCbGm+zQ2Uu4cUPU/bqjIyQIB80ut3drInDzysQLE/FJjcJW9+q+E75LKGKnrp2zCg/Xv3TEvru9a2A0vd7InZ9kNuxnPPFc1JSO7BT2TPP89YcLO0OmtRiGoXPlYzXuNIfUsVQ5/FW9FPp4qp+iMPrAidsjQrskHPxhW92GeezLpOSkUl7lAWQoioYED979mqGfzNIZTF5Ob6fJifboiwhOab6sAKnxmvWjgFnW/bZ5a8xkzgPc4RHpIejot1Q7fpT+67eA+DVxvUqakJI6t3iEaZTNITCSU2Cfj1oyCQfrZGf9tauW49rO1zYHKoV4z9ylymOWtCUk641iyxwFCNSW47CDsc0M8iI4J6JqsNMpQuR9sdWVhROi5yn9UR7ac7pizB3dFmc0/qjtTRoYStaaSEYg3L5woALv5kAA2j4="` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#body-description) description string Description of the contract. Example: `"My first template contract deployment!"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#body-template-parameters) templateParameters object JSON object that contains the template deployment parameters used to initialize the contract(s) on-chain. Show child attributes [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#body-fee-level) feeLevel enum 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`](https://developers.circle.com/api-reference/w3s/developer-controlled-wallets/create-transfer-estimate-fee) API. Available options: `LOW`, `MEDIUM`, `HIGH` Example: `"MEDIUM"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#body-gas-limit) gasLimit 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`](https://developers.circle.com/api-reference/w3s/developer-controlled-wallets/create-transfer-estimate-fee) 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. Example: `"21000"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#body-gas-price) gasPrice 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`](https://developers.circle.com/api-reference/w3s/developer-controlled-wallets/create-transfer-estimate-fee) API. [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#body-max-fee) maxFee 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`](https://developers.circle.com/api-reference/w3s/developer-controlled-wallets/create-transfer-estimate-fee) API. Example: `"5.935224468"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#body-priority-fee) priorityFee 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`](https://developers.circle.com/api-reference/w3s/developer-controlled-wallets/create-transfer-estimate-fee) API. Example: `"1.022783914"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#body-ref-id) refId string RefID is a custom label field. Example: `"d620d523-b5ab-4541-94b0-efe4f4c825c8"` #### Response 200 application/json Contract already created in previous request. [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template#response-data) data object required Show child attributes Was this page helpful? YesNo [Estimate fee for a contract template deployment\ \ Previous](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-template-deploy) [List contracts\ \ Next](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts) ⌘I --- # Contracts - Circle Docs [Skip to main content](https://developers.circle.com/contracts#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Contracts Contracts [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools * [Overview](https://developers.circle.com/build-onchain) ##### Wallets * [Circle Wallets Overview](https://developers.circle.com/wallets) * Wallets Products * Concepts * Quickstarts * Tutorials * References ##### Contracts * [Circle Contracts Overview](https://developers.circle.com/contracts) * Concepts * Quickstarts * References ##### Paymaster * [Paymaster Overview](https://developers.circle.com/paymaster) * Quickstarts * References ##### Developer Services * [Supported Blockchains](https://developers.circle.com/w3s/supported-blockchains-and-currencies) * [Blockchain Confirmations](https://developers.circle.com/w3s/blockchain-confirmations) * [Chain ID for Signing Transactions](https://developers.circle.com/w3s/sign-tx-chain-id) * [API Keys](https://developers.circle.com/w3s/keys) * [Testnet vs. Mainnet](https://developers.circle.com/w3s/sandbox-vs-production) * [Testnet Faucets](https://developers.circle.com/w3s/developer-console-faucet) * [Circle Developer Account](https://developers.circle.com/w3s/circle-developer-account) * [Developer Account Logs](https://developers.circle.com/w3s/developer-account-logs) * [Manage Team Members](https://developers.circle.com/w3s/manage-team-members) * [Postman API Suite](https://developers.circle.com/w3s/postman) * [Idempotent Requests](https://developers.circle.com/w3s/idempotent-requests) * [Compliance Requirements](https://developers.circle.com/w3s/compliance-requirements) * [HTTP Errors](https://developers.circle.com/w3s/synchronous-errors) * [Transaction States and Errors](https://developers.circle.com/w3s/asynchronous-states-and-statuses) * [Glossary](https://developers.circle.com/w3s/programmable-wallets-primitives) On this page * [Explore smart contracts](https://developers.circle.com/contracts#explore-smart-contracts) * [Deploy smart contracts](https://developers.circle.com/contracts#deploy-smart-contracts) * [Deploy a custom contract](https://developers.circle.com/contracts#deploy-a-custom-contract) * [Deploy contracts with templates](https://developers.circle.com/contracts#deploy-contracts-with-templates) * [Manage smart contracts](https://developers.circle.com/contracts#manage-smart-contracts) * [Interact with smart contracts](https://developers.circle.com/contracts#interact-with-smart-contracts) * [Event Monitoring](https://developers.circle.com/contracts#event-monitoring) Circle Contracts empowers developers to utilize smart contracts within their applications. Contracts facilitates the creation, deployment, and execution of smart contracts through an intuitive Developer Console or APIs, ensuring flexibility and ease of integration. The goal is to simplify the process of leveraging smart contracts for real-world use cases in applications. Some examples of what developers can do using Contracts: 1. **Deploying Custom Contracts:** Bring your custom contracts to life by efficiently deploying them onto the blockchain, expanding the functionality and capabilities of your application. 2. **Deploying NFT Contracts:** Easily deploy NFT contracts and programmatically mint unique tokens for end-users, enabling the creation of digital assets and collectibles. 3. **Creating On-Chain Loyalty Programs:** Establish on-chain loyalty programs within your applications, allowing users to earn and redeem rewards seamlessly. 4. **Interacting with DeFi Projects:** Effortlessly integrate with popular DeFi projects like Uniswap, enabling users to interact with decentralized exchanges and other financial services with just a few clicks. 5. **Integrating Circle Contracts:** Seamlessly incorporate Circle contracts, such as [CCTP](https://developers.circle.com/cctp/evm-smart-contracts) ’s, into your application, providing secure and efficient transfer functionalities. 6. **Monitor Your Smart Contracts:** Set up push notifications for any events occurring in your smart contracts. **No-code & API support** Contracts can be accessed in two ways by developers: 1. **Console:** You can explore, interact and manage smart contracts without writing any code. This is ideal for non-technical users, or any low frequency use. The console supports exploring contracts (view functions, events, transactions), deploying contracts (via templates) and managing the contract (any read/write function on the contract). 2. **SDK/API:** You can also receive the benefits of Contracts programmatically! Combining with developer-controlled wallets and Gas Station, you can deploy, interact and manage smart contracts at scale via simple APIs - in a gasless fashion! The APIs that we provide include deploying contracts (via bytecode or templates), read or write contract executions. [​](https://developers.circle.com/contracts#explore-smart-contracts) Explore smart contracts ----------------------------------------------------------------------------------------------- The Developer Services console allows developers to view the details of any smart contract. Developers can import a smart contract by adding its address and blockchain. Once imported, developers can explore the contract, view the ABI functions, read the source code, see all transactions, subscribe to events, or execute function calls. [​](https://developers.circle.com/contracts#deploy-smart-contracts) Deploy smart contracts --------------------------------------------------------------------------------------------- Developers can deploy smart contracts using Circle Contracts by writing their contracts or using pre-vetted templates provided by Circle. To deploy a contract, developers need to create a Developer-controlled wallet using Circle Wallets and use it to deploy the contract across any supported chains. Deployment can be done through the console in a no-code way or programmatically using APIs. ### [​](https://developers.circle.com/contracts#deploy-a-custom-contract) Deploy a custom contract If you have already written a smart contract on an IDE, you can deploy it by providing the compiled bytecode and ABI. For console deployment, create a console wallet (a smart contract wallet) and use it to deploy the contract on the desired chain. Include the source code, ABI, and bytecode for API deployment in the request parameters. ### [​](https://developers.circle.com/contracts#deploy-contracts-with-templates) Deploy contracts with templates For developers unfamiliar with smart contract engineering, Templates provide code snippets to deploy contracts without writing any solidity code. These templates, curated by the Circle team and audited by third-party auditors, cover popular onchain use cases. Fill in the required properties and deploy the contract. Templates can be deployed through the console or APIs. Some templates that we support include: * Token (ERC-20) contract, by Thirdweb * NFT (ERC-721) contract, by Thirdweb * Multi-Token (ERC-1155) contract, by Thirdweb * Airdrop contract, by Thirdweb [​](https://developers.circle.com/contracts#manage-smart-contracts) Manage smart contracts --------------------------------------------------------------------------------------------- Once deployed, you can use the console to manage your smart contracts. This includes viewing analytics, calling contract admin functions (e.g. changing ownership, updating configs) or subscribing to events. The console provides an easy way to update and manage contracts post-deployment. Developers can access analytics such as transactions and events for contracts deployed using Contracts via APIs. [​](https://developers.circle.com/contracts#interact-with-smart-contracts) Interact with smart contracts ----------------------------------------------------------------------------------------------------------- Interacting with smart contracts allows you to integrate existing onchain contracts into your applications. Import the contract and explore its various functions. You can add parameters and generate API resources to interact with the contract in a straightforward manner. [​](https://developers.circle.com/contracts#event-monitoring) Event Monitoring --------------------------------------------------------------------------------- Event Monitoring allows developers to track onchain events emitted by their smart contracts in real time. By setting up event monitors, you can receive instant notifications whenever specified events occur. This capability enables developers to respond programmatically to important actions within their applications, making it easier to implement automation and enhance user experiences. Was this page helpful? YesNo [Wallet Upgrades\ \ Previous](https://developers.circle.com/wallets/wallet-upgrades) [Contracts Templates\ \ Next](https://developers.circle.com/contracts/scp-templates-overview) ⌘I --- # Delete Event Monitor - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/smart-contract-platform/delete-event-monitor#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Event Monitors Delete Event Monitor [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions ##### Contracts * Templates * View / Update * Interact * Deploy / Import * Event Monitors * [GET\ \ Get Event Monitors](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors) * [POST\ \ Create Event Monitor](https://developers.circle.com/api-reference/contracts/smart-contract-platform/create-event-monitor) * [PUT\ \ Update an Event Monitor](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-event-monitor) * [DEL\ \ Delete Event Monitor](https://developers.circle.com/api-reference/contracts/smart-contract-platform/delete-event-monitor) * [GET\ \ Get Event Logs](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-event-logs) Delete Event Monitor cURL Copy curl --request DELETE \ --url https://api.circle.com/v1/w3s/contracts/monitors/{id} \ --header 'Authorization: Bearer ' 400 404 Copy { "code": 123, "message": "" } DELETE / v1 / w3s / contracts / monitors / {id} Try it Delete Event Monitor cURL Copy curl --request DELETE \ --url https://api.circle.com/v1/w3s/contracts/monitors/{id} \ --header 'Authorization: Bearer ' 400 404 Copy { "code": 123, "message": "" } #### Authorizations [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/delete-event-monitor#authorization-authorization) 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 [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/delete-event-monitor#parameter-x-request-id) X-Request-Id string Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support. Example: `"2adba88e-9d63-44bc-b975-9b6ae3440dde"` #### Path Parameters [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/delete-event-monitor#parameter-id) id string required Event Monitor ID. #### Response 200 Event monitor deleted successfully. Was this page helpful? YesNo [Update an Event Monitor\ \ Previous](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-event-monitor) [Get Event Logs\ \ Next](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-event-logs) ⌘I --- # Create Event Monitor - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/smart-contract-platform/create-event-monitor#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Event Monitors Create Event Monitor [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions ##### Contracts * Templates * View / Update * Interact * Deploy / Import * Event Monitors * [GET\ \ Get Event Monitors](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors) * [POST\ \ Create Event Monitor](https://developers.circle.com/api-reference/contracts/smart-contract-platform/create-event-monitor) * [PUT\ \ Update an Event Monitor](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-event-monitor) * [DEL\ \ Delete Event Monitor](https://developers.circle.com/api-reference/contracts/smart-contract-platform/delete-event-monitor) * [GET\ \ Get Event Logs](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-event-logs) Create Event Monitor cURL Copy curl --request POST \ --url https://api.circle.com/v1/w3s/contracts/monitors \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "blockchain": "ETH", "contractAddress": "0x6bc50ff08414717f000431558c0b585332c2a53d", "eventSignature": "Transfer(address,address,uint256)", "idempotencyKey": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" } ' 200 201 400 Copy { "data": { "eventMonitor": { "id": "e3c998a5-bdf1-4f3e-812f-24da238c0fff", "blockchain": "MATIC-AMOY", "contractAddress": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb", "eventSignature": "Transfer(address indexed from, address indexed to, uint256 value)", "eventSignatureHash": "0xd3d3dd4b1fd3e53f94deb24e763485b4c925345c5abfa9ad529c67aa55a3b784", "isEnabled": true } } } POST / v1 / w3s / contracts / monitors Try it Create Event Monitor cURL Copy curl --request POST \ --url https://api.circle.com/v1/w3s/contracts/monitors \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "blockchain": "ETH", "contractAddress": "0x6bc50ff08414717f000431558c0b585332c2a53d", "eventSignature": "Transfer(address,address,uint256)", "idempotencyKey": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" } ' 200 201 400 Copy { "data": { "eventMonitor": { "id": "e3c998a5-bdf1-4f3e-812f-24da238c0fff", "blockchain": "MATIC-AMOY", "contractAddress": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb", "eventSignature": "Transfer(address indexed from, address indexed to, uint256 value)", "eventSignatureHash": "0xd3d3dd4b1fd3e53f94deb24e763485b4c925345c5abfa9ad529c67aa55a3b784", "isEnabled": true } } } #### Authorizations [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/create-event-monitor#authorization-authorization) 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 [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/create-event-monitor#parameter-x-request-id) X-Request-Id string Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support. Example: `"2adba88e-9d63-44bc-b975-9b6ae3440dde"` #### Body application/json Create Event Monitor Request [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/create-event-monitor#body-blockchain) blockchain enum 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. Available options: `ETH`, `ETH-SEPOLIA`, `MATIC`, `MATIC-AMOY`, `ARB`, `ARB-SEPOLIA`, `UNI`, `UNI-SEPOLIA`, `BASE`, `BASE-SEPOLIA`, `OP`, `OP-SEPOLIA` Example: `"MATIC-AMOY"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/create-event-monitor#body-contract-address) contractAddress string required The on-chain address of this contract. Example: `"0x1e124d7384cd34448ea5907bd0052a79355ab5eb"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/create-event-monitor#body-event-signature) eventSignature string required The specific event to which you want to subscribeven. Please ensure no spaces are included. [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/create-event-monitor#body-idempotency-key) idempotencyKey string required 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"` #### Response 200 application/json Event monitor already exists. [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/create-event-monitor#response-data) data object required Show child attributes Was this page helpful? YesNo [Get Event Monitors\ \ Previous](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors) [Update an Event Monitor\ \ Next](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-event-monitor) ⌘I --- # Create a notification subscription - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/common/create-subscription#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Webhook Subscriptions Create a notification subscription [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions * [GET\ \ Get all notification subscriptions](https://developers.circle.com/api-reference/contracts/common/get-subscriptions) * [POST\ \ Create a notification subscription](https://developers.circle.com/api-reference/contracts/common/create-subscription) * [GET\ \ Retrieve a notification subscription](https://developers.circle.com/api-reference/contracts/common/get-subscription) * [PATCH\ \ Update a notification subscription](https://developers.circle.com/api-reference/contracts/common/update-subscription) * [DEL\ \ Delete a notification subscription](https://developers.circle.com/api-reference/contracts/common/delete-subscription) * [GET\ \ Get a notification signature public key](https://developers.circle.com/api-reference/contracts/common/get-notification-signature) ##### Contracts * Templates * View / Update * Interact * Deploy / Import * Event Monitors Create a notification subscription cURL Copy curl --request POST \ --url https://api.circle.com/v2/notifications/subscriptions \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "endpoint": "https://example.org/handler/for/notifications", "notificationTypes": [\ "*"\ ] } ' 200 400 401 Copy { "data": { "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5", "name": "Transactions Webhook", "endpoint": "https://example.org/handler/for/notifications", "enabled": true, "createDate": "2023-01-01T12:04:05Z", "updateDate": "2023-01-01T12:04:05Z", "notificationTypes": [\ "*"\ ], "restricted": false } } POST / v2 / notifications / subscriptions Try it Create a notification subscription cURL Copy curl --request POST \ --url https://api.circle.com/v2/notifications/subscriptions \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "endpoint": "https://example.org/handler/for/notifications", "notificationTypes": [\ "*"\ ] } ' 200 400 401 Copy { "data": { "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5", "name": "Transactions Webhook", "endpoint": "https://example.org/handler/for/notifications", "enabled": true, "createDate": "2023-01-01T12:04:05Z", "updateDate": "2023-01-01T12:04:05Z", "notificationTypes": [\ "*"\ ], "restricted": false } } #### Authorizations [​](https://developers.circle.com/api-reference/contracts/common/create-subscription#authorization-authorization) 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 [​](https://developers.circle.com/api-reference/contracts/common/create-subscription#parameter-x-request-id) X-Request-Id string Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support. Example: `"2adba88e-9d63-44bc-b975-9b6ae3440dde"` #### Body application/json Schema for the request payload to create a new subscription. Required parameters to create a new subscription. [​](https://developers.circle.com/api-reference/contracts/common/create-subscription#body-endpoint) endpoint string required URL of the endpoint to subscribe to notifications. Must be publicly accessible, use HTTPS, and respond with a 2XX status to a POST request. Example: `"https://example.org/handler/for/notifications"` [​](https://developers.circle.com/api-reference/contracts/common/create-subscription#body-notification-types) notificationTypes enum\[\] The notification types to subscribe to. If not provided, the webhook will be unrestricted, and a notification is sent for every notification type. If the wildcard (`*`) or any combination of the wildcard and a set of notification types is provided, the webhook will also be unrestricted. If a set of notification types are provided, the webhook will be restricted. The restricted status of the webhook is returned in the response object. Each category of notification types also has a wildcard, which will restrict to all notification types from that category. Available options: `*`, `transactions.*`, `transactions.inbound`, `transactions.outbound`, `challenges.*`, `challenges.accelerateTransaction`, `challenges.cancelTransaction`, `challenges.changePin`, `challenges.contractExecution`, `challenges.createTransaction`, `challenges.createWallet`, `challenges.initialize`, `challenges.restorePin`, `challenges.setPin`, `challenges.setSecurityQuestions`, `contracts.*`, `contracts.eventLog`, `modularWallet.*`, `modularWallet.userOperation`, `modularWallet.inboundTransfer`, `modularWallet.outboundTransfer`, `travelRule.*`, `travelRule.statusUpdate`, `travelRule.deny`, `travelRule.approve`, `rampSession.*`, `rampSession.completed`, `rampSession.depositReceived`, `rampSession.expired`, `rampSession.failed`, `rampSession.kycApproved`, `rampSession.kycRejected`, `rampSession.kycSubmitted` Example: ["*"] #### Response 200 application/json Successfully created a notification subscription. [​](https://developers.circle.com/api-reference/contracts/common/create-subscription#response-data) data Subscription · object Contains information about a webhook notification subscription. Show child attributes Was this page helpful? YesNo [Get all notification subscriptions\ \ Previous](https://developers.circle.com/api-reference/contracts/common/get-subscriptions) [Retrieve a notification subscription\ \ Next](https://developers.circle.com/api-reference/contracts/common/get-subscription) ⌘I --- # Get all notification subscriptions - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/common/get-subscriptions#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Webhook Subscriptions Get all notification subscriptions [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions * [GET\ \ Get all notification subscriptions](https://developers.circle.com/api-reference/contracts/common/get-subscriptions) * [POST\ \ Create a notification subscription](https://developers.circle.com/api-reference/contracts/common/create-subscription) * [GET\ \ Retrieve a notification subscription](https://developers.circle.com/api-reference/contracts/common/get-subscription) * [PATCH\ \ Update a notification subscription](https://developers.circle.com/api-reference/contracts/common/update-subscription) * [DEL\ \ Delete a notification subscription](https://developers.circle.com/api-reference/contracts/common/delete-subscription) * [GET\ \ Get a notification signature public key](https://developers.circle.com/api-reference/contracts/common/get-notification-signature) ##### Contracts * Templates * View / Update * Interact * Deploy / Import * Event Monitors Get all notification subscriptions cURL Copy curl --request GET \ --url https://api.circle.com/v2/notifications/subscriptions \ --header 'Authorization: Bearer ' 200 401 Copy { "data": [\ {\ "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",\ "name": "Transactions Webhook",\ "endpoint": "https://example.org/handler/for/notifications",\ "enabled": true,\ "createDate": "2023-01-01T12:04:05Z",\ "updateDate": "2023-01-01T12:04:05Z",\ "notificationTypes": [\ "*"\ ],\ "restricted": false\ }\ ] } GET / v2 / notifications / subscriptions Try it Get all notification subscriptions cURL Copy curl --request GET \ --url https://api.circle.com/v2/notifications/subscriptions \ --header 'Authorization: Bearer ' 200 401 Copy { "data": [\ {\ "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",\ "name": "Transactions Webhook",\ "endpoint": "https://example.org/handler/for/notifications",\ "enabled": true,\ "createDate": "2023-01-01T12:04:05Z",\ "updateDate": "2023-01-01T12:04:05Z",\ "notificationTypes": [\ "*"\ ],\ "restricted": false\ }\ ] } #### Authorizations [​](https://developers.circle.com/api-reference/contracts/common/get-subscriptions#authorization-authorization) 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. #### Response 200 application/json Successfully retrieved notification subscriptions. [​](https://developers.circle.com/api-reference/contracts/common/get-subscriptions#response-data) data Subscription · object\[\] Show child attributes Was this page helpful? YesNo [Ping\ \ Previous](https://developers.circle.com/api-reference/contracts/common/ping) [Create a notification subscription\ \ Next](https://developers.circle.com/api-reference/contracts/common/create-subscription) ⌘I --- # Delete a notification subscription - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/common/delete-subscription#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Webhook Subscriptions Delete a notification subscription [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions * [GET\ \ Get all notification subscriptions](https://developers.circle.com/api-reference/contracts/common/get-subscriptions) * [POST\ \ Create a notification subscription](https://developers.circle.com/api-reference/contracts/common/create-subscription) * [GET\ \ Retrieve a notification subscription](https://developers.circle.com/api-reference/contracts/common/get-subscription) * [PATCH\ \ Update a notification subscription](https://developers.circle.com/api-reference/contracts/common/update-subscription) * [DEL\ \ Delete a notification subscription](https://developers.circle.com/api-reference/contracts/common/delete-subscription) * [GET\ \ Get a notification signature public key](https://developers.circle.com/api-reference/contracts/common/get-notification-signature) ##### Contracts * Templates * View / Update * Interact * Deploy / Import * Event Monitors Delete a notification subscription cURL Copy curl --request DELETE \ --url https://api.circle.com/v2/notifications/subscriptions/{id} \ --header 'Authorization: Bearer ' 401 404 Copy { "code": 401, "message": "Malformed authorization." } DELETE / v2 / notifications / subscriptions / {id} Try it Delete a notification subscription cURL Copy curl --request DELETE \ --url https://api.circle.com/v2/notifications/subscriptions/{id} \ --header 'Authorization: Bearer ' 401 404 Copy { "code": 401, "message": "Malformed authorization." } #### Authorizations [​](https://developers.circle.com/api-reference/contracts/common/delete-subscription#authorization-authorization) 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 [​](https://developers.circle.com/api-reference/contracts/common/delete-subscription#parameter-x-request-id) X-Request-Id string Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support. Example: `"2adba88e-9d63-44bc-b975-9b6ae3440dde"` #### Path Parameters [​](https://developers.circle.com/api-reference/contracts/common/delete-subscription#parameter-id) id string required The universally unique identifier of the resource. Example: `"b3d9d2d5-4c12-4946-a09d-953e82fae2b0"` #### Response 204 Successfully deleted subscription. Note: Response body is returned empty. Was this page helpful? YesNo [Update a notification subscription\ \ Previous](https://developers.circle.com/api-reference/contracts/common/update-subscription) [Get a notification signature public key\ \ Next](https://developers.circle.com/api-reference/contracts/common/get-notification-signature) ⌘I --- # Retrieve a notification subscription - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/common/get-subscription#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Webhook Subscriptions Retrieve a notification subscription [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions * [GET\ \ Get all notification subscriptions](https://developers.circle.com/api-reference/contracts/common/get-subscriptions) * [POST\ \ Create a notification subscription](https://developers.circle.com/api-reference/contracts/common/create-subscription) * [GET\ \ Retrieve a notification subscription](https://developers.circle.com/api-reference/contracts/common/get-subscription) * [PATCH\ \ Update a notification subscription](https://developers.circle.com/api-reference/contracts/common/update-subscription) * [DEL\ \ Delete a notification subscription](https://developers.circle.com/api-reference/contracts/common/delete-subscription) * [GET\ \ Get a notification signature public key](https://developers.circle.com/api-reference/contracts/common/get-notification-signature) ##### Contracts * Templates * View / Update * Interact * Deploy / Import * Event Monitors Retrieve a notification subscription cURL Copy curl --request GET \ --url https://api.circle.com/v2/notifications/subscriptions/{id} \ --header 'Authorization: Bearer ' 200 401 404 Copy { "data": { "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5", "name": "Transactions Webhook", "endpoint": "https://example.org/handler/for/notifications", "enabled": true, "createDate": "2023-01-01T12:04:05Z", "updateDate": "2023-01-01T12:04:05Z", "notificationTypes": [\ "*"\ ], "restricted": false } } GET / v2 / notifications / subscriptions / {id} Try it Retrieve a notification subscription cURL Copy curl --request GET \ --url https://api.circle.com/v2/notifications/subscriptions/{id} \ --header 'Authorization: Bearer ' 200 401 404 Copy { "data": { "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5", "name": "Transactions Webhook", "endpoint": "https://example.org/handler/for/notifications", "enabled": true, "createDate": "2023-01-01T12:04:05Z", "updateDate": "2023-01-01T12:04:05Z", "notificationTypes": [\ "*"\ ], "restricted": false } } #### Authorizations [​](https://developers.circle.com/api-reference/contracts/common/get-subscription#authorization-authorization) 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 [​](https://developers.circle.com/api-reference/contracts/common/get-subscription#parameter-x-request-id) X-Request-Id string Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support. Example: `"2adba88e-9d63-44bc-b975-9b6ae3440dde"` #### Path Parameters [​](https://developers.circle.com/api-reference/contracts/common/get-subscription#parameter-id) id string required The universally unique identifier of the resource. Example: `"b3d9d2d5-4c12-4946-a09d-953e82fae2b0"` #### Response 200 application/json Successfully retrieved subscription. [​](https://developers.circle.com/api-reference/contracts/common/get-subscription#response-data) data Subscription · object Contains information about a webhook notification subscription. Show child attributes Was this page helpful? YesNo [Create a notification subscription\ \ Previous](https://developers.circle.com/api-reference/contracts/common/create-subscription) [Update a notification subscription\ \ Next](https://developers.circle.com/api-reference/contracts/common/update-subscription) ⌘I --- # Deploy a contract - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Deploy / Import Deploy a contract [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions ##### Contracts * Templates * View / Update * Interact * Deploy / Import * [POST\ \ Import a contract](https://developers.circle.com/api-reference/contracts/smart-contract-platform/import-contract) * [POST\ \ Estimate a contract deployment](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-deploy) * [POST\ \ Deploy a contract](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract) * Event Monitors Deploy a contract cURL Copy curl --request POST \ --url https://api.circle.com/v1/w3s/contracts/deploy \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "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="\ }\ '\ \ 200\ \ 201\ \ 400\ \ Copy\ \ {\ "data": {\ "contractId": "676f83a8-81a1-4dd5-b738-e2509b8f5460",\ "transactionId": "36790743-b78d-4061-9558-1af9a9c837bd"\ }\ }\ \ POST\ \ /\ \ v1\ \ /\ \ w3s\ \ /\ \ contracts\ \ /\ \ deploy\ \ Try it\ \ Deploy a contract\ \ cURL\ \ Copy\ \ curl --request POST \\ --url https://api.circle.com/v1/w3s/contracts/deploy \\ --header 'Authorization: Bearer ' \\ --header 'Content-Type: application/json' \\ --data '\ {\ "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="\ }\ '\ \ 200\ \ 201\ \ 400\ \ Copy\ \ {\ "data": {\ "contractId": "676f83a8-81a1-4dd5-b738-e2509b8f5460",\ "transactionId": "36790743-b78d-4061-9558-1af9a9c837bd"\ }\ }\ \ #### Authorizations\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#authorization-authorization)\ \ 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\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#parameter-x-request-id)\ \ X-Request-Id\ \ string\ \ Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support.\ \ Example:\ \ `"2adba88e-9d63-44bc-b975-9b6ae3440dde"`\ \ #### Body\ \ application/json\ \ Deploy contract request\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#body-idempotency-key)\ \ idempotencyKey\ \ string\ \ required\ \ 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"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#body-name)\ \ name\ \ string\ \ required\ \ The name for a contract. Must be alphanumeric \[a-zA-Z0-9\].\ \ Example:\ \ `"First Contract"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#body-wallet-id)\ \ walletId\ \ string\ \ required\ \ 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"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#body-abi-json)\ \ abiJson\ \ string\ \ required\ \ The contract's ABI in a JSON stringified format.\ \ Example:\ \ `"[{\"inputs\": [],\"stateMutability\": \"nonpayable\",\"type\": \"constructor\"},..."`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#body-bytecode)\ \ bytecode\ \ string\ \ required\ \ Bytecode of the contract being deployed.\ \ Minimum string length: `1`\ \ Example:\ \ `"0x60806040523480156200001157600080fd5b50604051806040..."`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#body-entity-secret-ciphertext)\ \ entitySecretCiphertext\ \ string\ \ required\ \ 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.\ \ Example:\ \ `"M8OAwbJ8rMsPd8+NT4xRDBDJSNqUKAvJeWPyuwZSlVXgRucogAlBxjvjIw4nsKeJ4hejjlpmyaaJrusHm6zsvy4BLuL1an3dYn3wORjYf3sU4QN9Rdk9OJxZvE5hDNPq7okucvb1eElxPVREZvr4ew7sh4ktmwDrwWFUYwKoly4fEzxYI9zvVpCY9xPSgkA5m3u1/P2vMYZ0QFtn8lRZxCuTyc4wRLpT9TOaK46CEXCakmAYaYWnLkl18QXOSY6FhCbGm+zQ2Uu4cUPU/bqjIyQIB80ut3drInDzysQLE/FJjcJW9+q+E75LKGKnrp2zCg/Xv3TEvru9a2A0vd7InZ9kNuxnPPFc1JSO7BT2TPP89YcLO0OmtRiGoXPlYzXuNIfUsVQ5/FW9FPp4qp+iMPrAidsjQrskHPxhW92GeezLpOSkUl7lAWQoioYED979mqGfzNIZTF5Ob6fJifboiwhOab6sAKnxmvWjgFnW/bZ5a8xkzgPc4RHpIejot1Q7fpT+67eA+DVxvUqakJI6t3iEaZTNITCSU2Cfj1oyCQfrZGf9tauW49rO1zYHKoV4z9ylymOWtCUk641iyxwFCNSW47CDsc0M8iI4J6JqsNMpQuR9sdWVhROi5yn9UR7ac7pizB3dFmc0/qjtTRoYStaaSEYg3L5woALv5kAA2j4="`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#body-blockchain)\ \ blockchain\ \ enum\ \ 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.\ \ Available options:\ \ `ETH`,\ \ `ETH-SEPOLIA`,\ \ `MATIC`,\ \ `MATIC-AMOY`,\ \ `ARB`,\ \ `ARB-SEPOLIA`,\ \ `UNI`,\ \ `UNI-SEPOLIA`,\ \ `BASE`,\ \ `BASE-SEPOLIA`,\ \ `OP`,\ \ `OP-SEPOLIA`\ \ Example:\ \ `"MATIC-AMOY"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#body-description)\ \ description\ \ string\ \ The description for a contract.\ \ Example:\ \ `"My first hello world contract"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#body-constructor-parameters)\ \ 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]\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#body-fee-level)\ \ feeLevel\ \ enum\ \ 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`](https://developers.circle.com/api-reference/w3s/developer-controlled-wallets/create-transfer-estimate-fee)\ API.\ \ Available options:\ \ `LOW`,\ \ `MEDIUM`,\ \ `HIGH`\ \ Example:\ \ `"MEDIUM"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#body-gas-limit)\ \ gasLimit\ \ 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`](https://developers.circle.com/api-reference/w3s/developer-controlled-wallets/create-transfer-estimate-fee)\ 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.\ \ Example:\ \ `"21000"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#body-gas-price)\ \ gasPrice\ \ 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`](https://developers.circle.com/api-reference/w3s/developer-controlled-wallets/create-transfer-estimate-fee)\ API.\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#body-max-fee)\ \ maxFee\ \ 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`](https://developers.circle.com/api-reference/w3s/developer-controlled-wallets/create-transfer-estimate-fee)\ API.\ \ Example:\ \ `"5.935224468"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#body-priority-fee)\ \ priorityFee\ \ 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`](https://developers.circle.com/api-reference/w3s/developer-controlled-wallets/create-transfer-estimate-fee)\ API.\ \ Example:\ \ `"1.022783914"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#body-ref-id)\ \ refId\ \ string\ \ Optional reference or description used to identify the transaction.\ \ Example:\ \ `"grouptransaction123"`\ \ #### Response\ \ 200\ \ application/json\ \ Idempotent request. Contract deployment request already submitted.\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract#response-data)\ \ data\ \ object\ \ required\ \ Show child attributes\ \ Was this page helpful?\ \ YesNo\ \ [Estimate a contract deployment\ \ Previous](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-deploy)\ [Get Event Monitors\ \ Next](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors)\ \ ⌘I --- # Update a notification subscription - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/common/update-subscription#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Webhook Subscriptions Update a notification subscription [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions * [GET\ \ Get all notification subscriptions](https://developers.circle.com/api-reference/contracts/common/get-subscriptions) * [POST\ \ Create a notification subscription](https://developers.circle.com/api-reference/contracts/common/create-subscription) * [GET\ \ Retrieve a notification subscription](https://developers.circle.com/api-reference/contracts/common/get-subscription) * [PATCH\ \ Update a notification subscription](https://developers.circle.com/api-reference/contracts/common/update-subscription) * [DEL\ \ Delete a notification subscription](https://developers.circle.com/api-reference/contracts/common/delete-subscription) * [GET\ \ Get a notification signature public key](https://developers.circle.com/api-reference/contracts/common/get-notification-signature) ##### Contracts * Templates * View / Update * Interact * Deploy / Import * Event Monitors Update a notification subscription cURL Copy curl --request PATCH \ --url https://api.circle.com/v2/notifications/subscriptions/{id} \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "name": "Transactions Webhook", "enabled": true } ' 200 400 401 404 Copy { "data": { "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5", "name": "Transactions Webhook", "endpoint": "https://example.org/handler/for/notifications", "enabled": true, "createDate": "2023-01-01T12:04:05Z", "updateDate": "2023-01-01T12:04:05Z", "notificationTypes": [\ "*"\ ], "restricted": false } } PATCH / v2 / notifications / subscriptions / {id} Try it Update a notification subscription cURL Copy curl --request PATCH \ --url https://api.circle.com/v2/notifications/subscriptions/{id} \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "name": "Transactions Webhook", "enabled": true } ' 200 400 401 404 Copy { "data": { "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5", "name": "Transactions Webhook", "endpoint": "https://example.org/handler/for/notifications", "enabled": true, "createDate": "2023-01-01T12:04:05Z", "updateDate": "2023-01-01T12:04:05Z", "notificationTypes": [\ "*"\ ], "restricted": false } } #### Authorizations [​](https://developers.circle.com/api-reference/contracts/common/update-subscription#authorization-authorization) 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 [​](https://developers.circle.com/api-reference/contracts/common/update-subscription#parameter-x-request-id) X-Request-Id string Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support. Example: `"2adba88e-9d63-44bc-b975-9b6ae3440dde"` #### Path Parameters [​](https://developers.circle.com/api-reference/contracts/common/update-subscription#parameter-id) id string required The universally unique identifier of the resource. Example: `"b3d9d2d5-4c12-4946-a09d-953e82fae2b0"` #### Body application/json Schema for the request payload to update a new subscription. [​](https://developers.circle.com/api-reference/contracts/common/update-subscription#body-name) name string required Name of the subscription. Example: `"Transactions Webhook"` [​](https://developers.circle.com/api-reference/contracts/common/update-subscription#body-enabled) enabled boolean required Whether the subscription is enabled. `true` indicates the subscription is active. Example: `true` #### Response 200 application/json Successfully updated notification subscription. [​](https://developers.circle.com/api-reference/contracts/common/update-subscription#response-data) data Subscription · object Contains information about a webhook notification subscription. Show child attributes Was this page helpful? YesNo [Retrieve a notification subscription\ \ Previous](https://developers.circle.com/api-reference/contracts/common/get-subscription) [Delete a notification subscription\ \ Next](https://developers.circle.com/api-reference/contracts/common/delete-subscription) ⌘I --- # Execute a query function on a contract - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/smart-contract-platform/query-contract#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Interact Execute a query function on a contract [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions ##### Contracts * Templates * View / Update * Interact * [POST\ \ Execute a query function on a contract](https://developers.circle.com/api-reference/contracts/smart-contract-platform/query-contract) * Deploy / Import * Event Monitors Execute a query function on a contract cURL Copy curl --request POST \ --url https://api.circle.com/v1/w3s/contracts/query \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "address": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb", "blockchain": "MATIC-AMOY", "abiFunctionSignature": "burn(uint256)", "abiParameters": [\ "100",\ "1"\ ], "abiJson": "[{\"inputs\": [],\"stateMutability\": \"nonpayable\",\"type\": \"constructor\"},...",\ "callData": "",\ "fromAddress": ""\ }\ '\ \ 200\ \ 400\ \ Copy\ \ {\ "data": {\ "outputValues": [\ ""\ ],\ "outputData": ""\ }\ }\ \ POST\ \ /\ \ v1\ \ /\ \ w3s\ \ /\ \ contracts\ \ /\ \ query\ \ Try it\ \ Execute a query function on a contract\ \ cURL\ \ Copy\ \ curl --request POST \\ --url https://api.circle.com/v1/w3s/contracts/query \\ --header 'Authorization: Bearer ' \\ --header 'Content-Type: application/json' \\ --data '\ {\ "address": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb",\ "blockchain": "MATIC-AMOY",\ "abiFunctionSignature": "burn(uint256)",\ "abiParameters": [\ "100",\ "1"\ ],\ "abiJson": "[{\"inputs\": [],\"stateMutability\": \"nonpayable\",\"type\": \"constructor\"},...",\ "callData": "",\ "fromAddress": ""\ }\ '\ \ 200\ \ 400\ \ Copy\ \ {\ "data": {\ "outputValues": [\ ""\ ],\ "outputData": ""\ }\ }\ \ #### Authorizations\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/query-contract#authorization-authorization)\ \ 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\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/query-contract#parameter-x-request-id)\ \ X-Request-Id\ \ string\ \ Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support.\ \ Example:\ \ `"2adba88e-9d63-44bc-b975-9b6ae3440dde"`\ \ #### Body\ \ application/json\ \ Read contract state by executing a read ABI function.\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/query-contract#body-address)\ \ address\ \ string\ \ required\ \ Address of the contract to be queried.\ \ Example:\ \ `"0x1e124d7384cd34448ea5907bd0052a79355ab5eb"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/query-contract#body-blockchain)\ \ blockchain\ \ enum\ \ 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.\ \ Available options:\ \ `ETH`,\ \ `ETH-SEPOLIA`,\ \ `MATIC`,\ \ `MATIC-AMOY`,\ \ `ARB`,\ \ `ARB-SEPOLIA`,\ \ `UNI`,\ \ `UNI-SEPOLIA`,\ \ `BASE`,\ \ `BASE-SEPOLIA`,\ \ `OP`,\ \ `OP-SEPOLIA`\ \ Example:\ \ `"MATIC-AMOY"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/query-contract#body-abi-function-signature)\ \ abiFunctionSignature\ \ string\ \ The contract ABI function signature or `callData` field is required for interacting with the smart contract. The ABI function signature cannot be used simultaneously with `callData`. e.g. burn(uint256)\ \ Example:\ \ `"burn(uint256)"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/query-contract#body-abi-parameters)\ \ abiParameters\ \ (string | integer | boolean | any\[\])\[\]\ \ The contract ABI function signature parameters for executing the contract interaction. Supported parameter types include string, integer, boolean, and array. These parameters should be used exclusively with the abiFunctionSignature and cannot be used with `callData`.\ \ Example:\ \ ["100", "1"]\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/query-contract#body-abi-json)\ \ abiJson\ \ string\ \ The contract's ABI in a JSON stringified format.\ \ Example:\ \ `"[{\"inputs\": [],\"stateMutability\": \"nonpayable\",\"type\": \"constructor\"},..."`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/query-contract#body-call-data)\ \ callData\ \ string\ \ CallData is input data that encodes method and parameters.\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/query-contract#body-from-address)\ \ fromAddress\ \ string\ \ FromAddress is the address that will populate msg.sender in the contract call.\ \ #### Response\ \ 200\ \ application/json\ \ Contract read successfully.\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/query-contract#response-data)\ \ data\ \ object\ \ required\ \ Show child attributes\ \ Was this page helpful?\ \ YesNo\ \ [Update a contract\ \ Previous](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-contract)\ [Import a contract\ \ Next](https://developers.circle.com/api-reference/contracts/smart-contract-platform/import-contract)\ \ ⌘I --- # Get a notification signature public key - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/common/get-notification-signature#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Webhook Subscriptions Get a notification signature public key [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions * [GET\ \ Get all notification subscriptions](https://developers.circle.com/api-reference/contracts/common/get-subscriptions) * [POST\ \ Create a notification subscription](https://developers.circle.com/api-reference/contracts/common/create-subscription) * [GET\ \ Retrieve a notification subscription](https://developers.circle.com/api-reference/contracts/common/get-subscription) * [PATCH\ \ Update a notification subscription](https://developers.circle.com/api-reference/contracts/common/update-subscription) * [DEL\ \ Delete a notification subscription](https://developers.circle.com/api-reference/contracts/common/delete-subscription) * [GET\ \ Get a notification signature public key](https://developers.circle.com/api-reference/contracts/common/get-notification-signature) ##### Contracts * Templates * View / Update * Interact * Deploy / Import * Event Monitors Get a notification signature public key cURL Copy curl --request GET \ --url https://api.circle.com/v2/notifications/publicKey/{id} \ --header 'Authorization: Bearer ' 200 400 Copy { "data": { "id": "09379bc1-4871-45ad-8b8b-8027795df70d", "algorithm": "ECDSA_SHA_256", "publicKey": "QFkwewylAoZIzj0CBQYIKoZIzj0DAQcDQgAEEext6d7AimvYFDAKBwsUsGXrhqmRHNPYum7V/BwfvJLmJeSMe2V0b9eWKPuFxAEH8HCY/MSZdBI+q/E6IdPnSg==", "createDate": "2023-06-01T18:18:06.931526Z" } } GET / v2 / notifications / publicKey / {id} Try it Get a notification signature public key cURL Copy curl --request GET \ --url https://api.circle.com/v2/notifications/publicKey/{id} \ --header 'Authorization: Bearer ' 200 400 Copy { "data": { "id": "09379bc1-4871-45ad-8b8b-8027795df70d", "algorithm": "ECDSA_SHA_256", "publicKey": "QFkwewylAoZIzj0CBQYIKoZIzj0DAQcDQgAEEext6d7AimvYFDAKBwsUsGXrhqmRHNPYum7V/BwfvJLmJeSMe2V0b9eWKPuFxAEH8HCY/MSZdBI+q/E6IdPnSg==", "createDate": "2023-06-01T18:18:06.931526Z" } } #### Authorizations [​](https://developers.circle.com/api-reference/contracts/common/get-notification-signature#authorization-authorization) 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 [​](https://developers.circle.com/api-reference/contracts/common/get-notification-signature#parameter-x-request-id) X-Request-Id string Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support. Example: `"2adba88e-9d63-44bc-b975-9b6ae3440dde"` #### Path Parameters [​](https://developers.circle.com/api-reference/contracts/common/get-notification-signature#parameter-id) id string required The universally unique identifier of the resource. Example: `"b3d9d2d5-4c12-4946-a09d-953e82fae2b0"` #### Response 200 application/json Successfully retrieved a digital notification signature. [​](https://developers.circle.com/api-reference/contracts/common/get-notification-signature#response-data) data object Show child attributes Was this page helpful? YesNo [Delete a notification subscription\ \ Previous](https://developers.circle.com/api-reference/contracts/common/delete-subscription) [Estimate fee for a contract template deployment\ \ Next](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-template-deploy) ⌘I --- # List contracts - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation View / Update List contracts [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions ##### Contracts * Templates * View / Update * [GET\ \ List contracts](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts) * [GET\ \ Get a contract](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-contract) * [PATCH\ \ Update a contract](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-contract) * Interact * Deploy / Import * Event Monitors List contracts cURL Copy curl --request GET \ --url https://api.circle.com/v1/w3s/contracts \ --header 'Authorization: Bearer ' 200 400 Copy { "data": { "contracts": [\ {\ "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",\ "archived": false,\ "blockchain": "MATIC-AMOY",\ "contractInputType": "IMPORT",\ "name": "First Contract",\ "status": "PENDING",\ "verificationStatus": "UNVERIFIED",\ "updateDate": "2023-01-01T12:04:05Z",\ "createDate": "2023-01-01T12:04:05Z",\ "sourceCode": [\ {\ "fileContent": "pragma solidity ^0.4.24;\n\n/**\n * @title SafeMath\n * @dev Math operations with safety checks...",\ "fileName": "openzeppelin-solidity/contracts/math/SafeMath.sol"\ }\ ],\ "functions": [\ {\ "type": "function",\ "name": "approve",\ "stateMutability": "nonpayable",\ "inputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ],\ "outputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ]\ }\ ],\ "events": [\ {\ "type": "event",\ "name": "Approval",\ "anonymous": false,\ "inputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ]\ }\ ],\ "deployerWalletID": "f39e3dbd-84af-4d3d-b5ac-98fbe047ce6a",\ "deploymentTransactionId": "00ca46f3-c31b-4e3a-92a9-068d4ff26a63",\ "txHash": "0x4a25cc5e661d8504b59c5f38ba93f010e8518966f00e2ceda7955c4b8621357d",\ "abiJson": "[{\"inputs\": [],\"stateMutability\": \"nonpayable\",\"type\": \"constructor\"},...",\ "contractAddress": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb",\ "deployerAddress": "0x1bf9ad0cc2ad298c69a2995aa806ee832788218c",\ "deployerUserID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\ "deploymentErrorReason": "",\ "deploymentErrorDetails": "",\ "description": "My first hello world contract",\ "metadataLink": "https://ipfs.io/ipfs/Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu",\ "implementationContract": {}\ }\ ]\ }\ }\ \ GET\ \ /\ \ v1\ \ /\ \ w3s\ \ /\ \ contracts\ \ Try it\ \ List contracts\ \ cURL\ \ Copy\ \ curl --request GET \\ --url https://api.circle.com/v1/w3s/contracts \\ --header 'Authorization: Bearer '\ \ 200\ \ 400\ \ Copy\ \ {\ "data": {\ "contracts": [\ {\ "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",\ "archived": false,\ "blockchain": "MATIC-AMOY",\ "contractInputType": "IMPORT",\ "name": "First Contract",\ "status": "PENDING",\ "verificationStatus": "UNVERIFIED",\ "updateDate": "2023-01-01T12:04:05Z",\ "createDate": "2023-01-01T12:04:05Z",\ "sourceCode": [\ {\ "fileContent": "pragma solidity ^0.4.24;\n\n/**\n * @title SafeMath\n * @dev Math operations with safety checks...",\ "fileName": "openzeppelin-solidity/contracts/math/SafeMath.sol"\ }\ ],\ "functions": [\ {\ "type": "function",\ "name": "approve",\ "stateMutability": "nonpayable",\ "inputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ],\ "outputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ]\ }\ ],\ "events": [\ {\ "type": "event",\ "name": "Approval",\ "anonymous": false,\ "inputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ]\ }\ ],\ "deployerWalletID": "f39e3dbd-84af-4d3d-b5ac-98fbe047ce6a",\ "deploymentTransactionId": "00ca46f3-c31b-4e3a-92a9-068d4ff26a63",\ "txHash": "0x4a25cc5e661d8504b59c5f38ba93f010e8518966f00e2ceda7955c4b8621357d",\ "abiJson": "[{\"inputs\": [],\"stateMutability\": \"nonpayable\",\"type\": \"constructor\"},...",\ "contractAddress": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb",\ "deployerAddress": "0x1bf9ad0cc2ad298c69a2995aa806ee832788218c",\ "deployerUserID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\ "deploymentErrorReason": "",\ "deploymentErrorDetails": "",\ "description": "My first hello world contract",\ "metadataLink": "https://ipfs.io/ipfs/Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu",\ "implementationContract": {}\ }\ ]\ }\ }\ \ #### Authorizations\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts#authorization-authorization)\ \ 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\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts#parameter-x-request-id)\ \ X-Request-Id\ \ string\ \ Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support.\ \ Example:\ \ `"2adba88e-9d63-44bc-b975-9b6ae3440dde"`\ \ #### Query Parameters\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts#parameter-blockchain)\ \ blockchain\ \ enum\ \ Filter by blockchain. 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"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts#parameter-contract-input-type)\ \ contractInputType\ \ enum\ \ Filter contracts by input type. The input type for the contract.\ \ Available options:\ \ `IMPORT`,\ \ `BYTECODE`,\ \ `TEMPLATE`,\ \ `AUTO_IMPORT`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts#parameter-deployer-address)\ \ deployerAddress\ \ string\ \ Filter contracts by deployer address. The address that created this contract, if deployed.\ \ Example:\ \ `"0x1bf9ad0cc2ad298c69a2995aa806ee832788218c"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts#parameter-name)\ \ name\ \ string\ \ Filter contracts by name.\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts#parameter-status)\ \ status\ \ enum\ \ Filter contracts by status. The status of the contract.\ \ Available options:\ \ `PENDING`,\ \ `FAILED`,\ \ `COMPLETE`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts#parameter-from)\ \ from\ \ string\ \ Queries items created since the specified date-time (inclusive) in ISO 8601 format.\ \ Example:\ \ `"2023-01-01T12:04:05Z"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts#parameter-to)\ \ to\ \ string\ \ Queries items created before the specified date-time (inclusive) in ISO 8601 format.\ \ Example:\ \ `"2023-01-01T12:04:05Z"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts#parameter-page-before)\ \ pageBefore\ \ string\ \ A collection ID value used for pagination.\ \ It marks the exclusive end of a page. When provided, the collection resource will return the next n items before the id, with n being specified by pageSize.\ \ The items will be returned in the natural order of the collection.\ \ The resource will return the first page if neither pageAfter nor pageBefore are specified.\ \ SHOULD NOT be used in conjunction with pageAfter.\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts#parameter-page-after)\ \ pageAfter\ \ string\ \ A collection ID value used for pagination.\ \ It marks the exclusive begin of a page. When provided, the collection resource will return the next n items after the id, with n being specified by pageSize.\ \ The items will be returned in the natural order of the collection.\ \ The resource will return the first page if neither pageAfter nor pageBefore are specified.\ \ SHOULD NOT be used in conjunction with pageBefore.\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts#parameter-page-size)\ \ pageSize\ \ integer\ \ default:10\ \ Limits the number of items to be returned.\ \ Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used.\ \ If avoided, the collection will determine the page size itself.\ \ Required range: `1 <= x <= 50`\ \ #### Response\ \ 200\ \ application/json\ \ Contract list retrieved.\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts#response-data)\ \ data\ \ object\ \ required\ \ Show child attributes\ \ Was this page helpful?\ \ YesNo\ \ [Deploy a contract from a template\ \ Previous](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template)\ [Get a contract\ \ Next](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-contract)\ \ ⌘I --- # Import a contract - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/smart-contract-platform/import-contract#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Deploy / Import Import a contract [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions ##### Contracts * Templates * View / Update * Interact * Deploy / Import * [POST\ \ Import a contract](https://developers.circle.com/api-reference/contracts/smart-contract-platform/import-contract) * [POST\ \ Estimate a contract deployment](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-deploy) * [POST\ \ Deploy a contract](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract) * Event Monitors Import a contract cURL Copy curl --request POST \ --url https://api.circle.com/v1/w3s/contracts/import \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "idempotencyKey": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", "name": "First Contract", "address": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb", "blockchain": "MATIC-AMOY", "description": "My first hello world contract" } ' 200 201 400 Copy { "data": { "contract": { "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5", "archived": false, "blockchain": "MATIC-AMOY", "contractInputType": "IMPORT", "name": "First Contract", "status": "PENDING", "verificationStatus": "UNVERIFIED", "updateDate": "2023-01-01T12:04:05Z", "createDate": "2023-01-01T12:04:05Z", "sourceCode": [\ {\ "fileContent": "pragma solidity ^0.4.24;\n\n/**\n * @title SafeMath\n * @dev Math operations with safety checks...",\ "fileName": "openzeppelin-solidity/contracts/math/SafeMath.sol"\ }\ ], "functions": [\ {\ "type": "function",\ "name": "approve",\ "stateMutability": "nonpayable",\ "inputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ],\ "outputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ]\ }\ ], "events": [\ {\ "type": "event",\ "name": "Approval",\ "anonymous": false,\ "inputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ]\ }\ ], "deployerWalletID": "f39e3dbd-84af-4d3d-b5ac-98fbe047ce6a", "deploymentTransactionId": "00ca46f3-c31b-4e3a-92a9-068d4ff26a63", "txHash": "0x4a25cc5e661d8504b59c5f38ba93f010e8518966f00e2ceda7955c4b8621357d", "abiJson": "[{\"inputs\": [],\"stateMutability\": \"nonpayable\",\"type\": \"constructor\"},...",\ "contractAddress": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb",\ "deployerAddress": "0x1bf9ad0cc2ad298c69a2995aa806ee832788218c",\ "deployerUserID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\ "deploymentErrorReason": "",\ "deploymentErrorDetails": "",\ "description": "My first hello world contract",\ "metadataLink": "https://ipfs.io/ipfs/Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu",\ "implementationContract": {}\ }\ }\ }\ \ POST\ \ /\ \ v1\ \ /\ \ w3s\ \ /\ \ contracts\ \ /\ \ import\ \ Try it\ \ Import a contract\ \ cURL\ \ Copy\ \ curl --request POST \\ --url https://api.circle.com/v1/w3s/contracts/import \\ --header 'Authorization: Bearer ' \\ --header 'Content-Type: application/json' \\ --data '\ {\ "idempotencyKey": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",\ "name": "First Contract",\ "address": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb",\ "blockchain": "MATIC-AMOY",\ "description": "My first hello world contract"\ }\ '\ \ 200\ \ 201\ \ 400\ \ Copy\ \ {\ "data": {\ "contract": {\ "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",\ "archived": false,\ "blockchain": "MATIC-AMOY",\ "contractInputType": "IMPORT",\ "name": "First Contract",\ "status": "PENDING",\ "verificationStatus": "UNVERIFIED",\ "updateDate": "2023-01-01T12:04:05Z",\ "createDate": "2023-01-01T12:04:05Z",\ "sourceCode": [\ {\ "fileContent": "pragma solidity ^0.4.24;\n\n/**\n * @title SafeMath\n * @dev Math operations with safety checks...",\ "fileName": "openzeppelin-solidity/contracts/math/SafeMath.sol"\ }\ ],\ "functions": [\ {\ "type": "function",\ "name": "approve",\ "stateMutability": "nonpayable",\ "inputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ],\ "outputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ]\ }\ ],\ "events": [\ {\ "type": "event",\ "name": "Approval",\ "anonymous": false,\ "inputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ]\ }\ ],\ "deployerWalletID": "f39e3dbd-84af-4d3d-b5ac-98fbe047ce6a",\ "deploymentTransactionId": "00ca46f3-c31b-4e3a-92a9-068d4ff26a63",\ "txHash": "0x4a25cc5e661d8504b59c5f38ba93f010e8518966f00e2ceda7955c4b8621357d",\ "abiJson": "[{\"inputs\": [],\"stateMutability\": \"nonpayable\",\"type\": \"constructor\"},...",\ "contractAddress": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb",\ "deployerAddress": "0x1bf9ad0cc2ad298c69a2995aa806ee832788218c",\ "deployerUserID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\ "deploymentErrorReason": "",\ "deploymentErrorDetails": "",\ "description": "My first hello world contract",\ "metadataLink": "https://ipfs.io/ipfs/Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu",\ "implementationContract": {}\ }\ }\ }\ \ #### Authorizations\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/import-contract#authorization-authorization)\ \ 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\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/import-contract#parameter-x-request-id)\ \ X-Request-Id\ \ string\ \ Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support.\ \ Example:\ \ `"2adba88e-9d63-44bc-b975-9b6ae3440dde"`\ \ #### Body\ \ application/json\ \ Import contract request\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/import-contract#body-idempotency-key)\ \ idempotencyKey\ \ string\ \ required\ \ 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"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/import-contract#body-name)\ \ name\ \ string\ \ required\ \ The name for a contract. Must be alphanumeric \[a-zA-Z0-9\].\ \ Example:\ \ `"First Contract"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/import-contract#body-address)\ \ address\ \ string\ \ required\ \ The on-chain address of this contract.\ \ Example:\ \ `"0x1e124d7384cd34448ea5907bd0052a79355ab5eb"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/import-contract#body-blockchain)\ \ blockchain\ \ enum\ \ 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.\ \ Available options:\ \ `ETH`,\ \ `ETH-SEPOLIA`,\ \ `MATIC`,\ \ `MATIC-AMOY`,\ \ `ARB`,\ \ `ARB-SEPOLIA`,\ \ `UNI`,\ \ `UNI-SEPOLIA`,\ \ `BASE`,\ \ `BASE-SEPOLIA`,\ \ `OP`,\ \ `OP-SEPOLIA`\ \ Example:\ \ `"MATIC-AMOY"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/import-contract#body-description)\ \ description\ \ string\ \ The description for a contract.\ \ Example:\ \ `"My first hello world contract"`\ \ #### Response\ \ 200\ \ application/json\ \ Idempotent request. Contract was already imported.\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/import-contract#response-data)\ \ data\ \ object\ \ required\ \ Show child attributes\ \ Was this page helpful?\ \ YesNo\ \ [Execute a query function on a contract\ \ Previous](https://developers.circle.com/api-reference/contracts/smart-contract-platform/query-contract)\ [Estimate a contract deployment\ \ Next](https://developers.circle.com/api-reference/contracts/smart-contract-platform/estimate-contract-deploy)\ \ ⌘I --- # Get Event Monitors - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Event Monitors Get Event Monitors [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions ##### Contracts * Templates * View / Update * Interact * Deploy / Import * Event Monitors * [GET\ \ Get Event Monitors](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors) * [POST\ \ Create Event Monitor](https://developers.circle.com/api-reference/contracts/smart-contract-platform/create-event-monitor) * [PUT\ \ Update an Event Monitor](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-event-monitor) * [DEL\ \ Delete Event Monitor](https://developers.circle.com/api-reference/contracts/smart-contract-platform/delete-event-monitor) * [GET\ \ Get Event Logs](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-event-logs) Get Event Monitors cURL Copy curl --request GET \ --url https://api.circle.com/v1/w3s/contracts/monitors \ --header 'Authorization: Bearer ' 200 400 Copy { "data": { "eventMonitors": [\ {\ "id": "e3c998a5-bdf1-4f3e-812f-24da238c0fff",\ "blockchain": "ETH",\ "contractAddress": "0x6bc50ff08414717f000431558c0b585332c2a53d",\ "eventSignature": "Transfer(address indexed from, address indexed to, uint256 value)",\ "eventSignatureHash": "0xd3d3dd4b1fd3e53f94deb24e763485b4c925345c5abfa9ad529c67aa55a3b784",\ "isEnabled": true,\ "createDate": "2023-01-01T12:00:00Z",\ "updateDate": "2023-01-10T15:30:00Z"\ }\ ] } } GET / v1 / w3s / contracts / monitors Try it Get Event Monitors cURL Copy curl --request GET \ --url https://api.circle.com/v1/w3s/contracts/monitors \ --header 'Authorization: Bearer ' 200 400 Copy { "data": { "eventMonitors": [\ {\ "id": "e3c998a5-bdf1-4f3e-812f-24da238c0fff",\ "blockchain": "ETH",\ "contractAddress": "0x6bc50ff08414717f000431558c0b585332c2a53d",\ "eventSignature": "Transfer(address indexed from, address indexed to, uint256 value)",\ "eventSignatureHash": "0xd3d3dd4b1fd3e53f94deb24e763485b4c925345c5abfa9ad529c67aa55a3b784",\ "isEnabled": true,\ "createDate": "2023-01-01T12:00:00Z",\ "updateDate": "2023-01-10T15:30:00Z"\ }\ ] } } #### Authorizations [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors#authorization-authorization) 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 [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors#parameter-x-request-id) X-Request-Id string Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support. Example: `"2adba88e-9d63-44bc-b975-9b6ae3440dde"` #### Query Parameters [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors#parameter-contract-address) contractAddress string Filter contracts by address. [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors#parameter-blockchain) blockchain enum Filter by blockchain. 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"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors#parameter-event-signature) eventSignature string Filter monitors by event signature. [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors#parameter-from) from string Queries items created since the specified date-time (inclusive) in ISO 8601 format. Example: `"2023-01-01T12:04:05Z"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors#parameter-to) to string Queries items created before the specified date-time (inclusive) in ISO 8601 format. Example: `"2023-01-01T12:04:05Z"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors#parameter-page-before) pageBefore string A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next n items before the id, with n being specified by pageSize. The items will be returned in the natural order of the collection. The resource will return the first page if neither pageAfter nor pageBefore are specified. SHOULD NOT be used in conjunction with pageAfter. [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors#parameter-page-after) pageAfter string A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next n items after the id, with n being specified by pageSize. The items will be returned in the natural order of the collection. The resource will return the first page if neither pageAfter nor pageBefore are specified. SHOULD NOT be used in conjunction with pageBefore. [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors#parameter-page-size) pageSize integer default:10 Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself. Required range: `1 <= x <= 50` #### Response 200 application/json List of event monitors retrieved successfully. [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors#response-data) data object required Show child attributes Was this page helpful? YesNo [Deploy a contract\ \ Previous](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract) [Create Event Monitor\ \ Next](https://developers.circle.com/api-reference/contracts/smart-contract-platform/create-event-monitor) ⌘I --- # Update an Event Monitor - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-event-monitor#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Event Monitors Update an Event Monitor [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions ##### Contracts * Templates * View / Update * Interact * Deploy / Import * Event Monitors * [GET\ \ Get Event Monitors](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors) * [POST\ \ Create Event Monitor](https://developers.circle.com/api-reference/contracts/smart-contract-platform/create-event-monitor) * [PUT\ \ Update an Event Monitor](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-event-monitor) * [DEL\ \ Delete Event Monitor](https://developers.circle.com/api-reference/contracts/smart-contract-platform/delete-event-monitor) * [GET\ \ Get Event Logs](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-event-logs) Update an Event Monitor cURL Copy curl --request PUT \ --url https://api.circle.com/v1/w3s/contracts/monitors/{id} \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "isEnabled": false } ' 200 400 404 Copy { "data": { "eventMonitor": { "id": "e3c998a5-bdf1-4f3e-812f-24da238c0fff", "blockchain": "MATIC-AMOY", "contractAddress": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb", "eventSignature": "Transfer(address indexed from, address indexed to, uint256 value)", "eventSignatureHash": "0xd3d3dd4b1fd3e53f94deb24e763485b4c925345c5abfa9ad529c67aa55a3b784", "isEnabled": true } } } PUT / v1 / w3s / contracts / monitors / {id} Try it Update an Event Monitor cURL Copy curl --request PUT \ --url https://api.circle.com/v1/w3s/contracts/monitors/{id} \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "isEnabled": false } ' 200 400 404 Copy { "data": { "eventMonitor": { "id": "e3c998a5-bdf1-4f3e-812f-24da238c0fff", "blockchain": "MATIC-AMOY", "contractAddress": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb", "eventSignature": "Transfer(address indexed from, address indexed to, uint256 value)", "eventSignatureHash": "0xd3d3dd4b1fd3e53f94deb24e763485b4c925345c5abfa9ad529c67aa55a3b784", "isEnabled": true } } } #### Authorizations [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-event-monitor#authorization-authorization) 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 [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-event-monitor#parameter-x-request-id) X-Request-Id string Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support. Example: `"2adba88e-9d63-44bc-b975-9b6ae3440dde"` #### Path Parameters [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-event-monitor#parameter-id) id string required Event Monitor ID. #### Body application/json Update Event Monitor Request [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-event-monitor#body-is-enabled) isEnabled boolean required Indicates whether the event monitor should be active (true) or inactive (false). #### Response 200 application/json Event monitor updated successfully. [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-event-monitor#response-data) data object required Show child attributes Was this page helpful? YesNo [Create Event Monitor\ \ Previous](https://developers.circle.com/api-reference/contracts/smart-contract-platform/create-event-monitor) [Delete Event Monitor\ \ Next](https://developers.circle.com/api-reference/contracts/smart-contract-platform/delete-event-monitor) ⌘I --- # Update a contract - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-contract#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation View / Update Update a contract [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions ##### Contracts * Templates * View / Update * [GET\ \ List contracts](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-contracts) * [GET\ \ Get a contract](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-contract) * [PATCH\ \ Update a contract](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-contract) * Interact * Deploy / Import * Event Monitors Update a contract cURL Copy curl --request PATCH \ --url https://api.circle.com/v1/w3s/contracts/{id} \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "name": "First Contract", "description": "My first hello world contract", "archived": false } ' 200 400 Copy { "data": { "contract": { "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5", "archived": false, "blockchain": "MATIC-AMOY", "contractInputType": "IMPORT", "name": "First Contract", "status": "PENDING", "verificationStatus": "UNVERIFIED", "updateDate": "2023-01-01T12:04:05Z", "createDate": "2023-01-01T12:04:05Z", "sourceCode": [\ {\ "fileContent": "pragma solidity ^0.4.24;\n\n/**\n * @title SafeMath\n * @dev Math operations with safety checks...",\ "fileName": "openzeppelin-solidity/contracts/math/SafeMath.sol"\ }\ ], "functions": [\ {\ "type": "function",\ "name": "approve",\ "stateMutability": "nonpayable",\ "inputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ],\ "outputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ]\ }\ ], "events": [\ {\ "type": "event",\ "name": "Approval",\ "anonymous": false,\ "inputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ]\ }\ ], "deployerWalletID": "f39e3dbd-84af-4d3d-b5ac-98fbe047ce6a", "deploymentTransactionId": "00ca46f3-c31b-4e3a-92a9-068d4ff26a63", "txHash": "0x4a25cc5e661d8504b59c5f38ba93f010e8518966f00e2ceda7955c4b8621357d", "abiJson": "[{\"inputs\": [],\"stateMutability\": \"nonpayable\",\"type\": \"constructor\"},...",\ "contractAddress": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb",\ "deployerAddress": "0x1bf9ad0cc2ad298c69a2995aa806ee832788218c",\ "deployerUserID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\ "deploymentErrorReason": "",\ "deploymentErrorDetails": "",\ "description": "My first hello world contract",\ "metadataLink": "https://ipfs.io/ipfs/Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu",\ "implementationContract": {}\ }\ }\ }\ \ PATCH\ \ /\ \ v1\ \ /\ \ w3s\ \ /\ \ contracts\ \ /\ \ {id}\ \ Try it\ \ Update a contract\ \ cURL\ \ Copy\ \ curl --request PATCH \\ --url https://api.circle.com/v1/w3s/contracts/{id} \\ --header 'Authorization: Bearer ' \\ --header 'Content-Type: application/json' \\ --data '\ {\ "name": "First Contract",\ "description": "My first hello world contract",\ "archived": false\ }\ '\ \ 200\ \ 400\ \ Copy\ \ {\ "data": {\ "contract": {\ "id": "c4d1da72-111e-4d52-bdbf-2e74a2d803d5",\ "archived": false,\ "blockchain": "MATIC-AMOY",\ "contractInputType": "IMPORT",\ "name": "First Contract",\ "status": "PENDING",\ "verificationStatus": "UNVERIFIED",\ "updateDate": "2023-01-01T12:04:05Z",\ "createDate": "2023-01-01T12:04:05Z",\ "sourceCode": [\ {\ "fileContent": "pragma solidity ^0.4.24;\n\n/**\n * @title SafeMath\n * @dev Math operations with safety checks...",\ "fileName": "openzeppelin-solidity/contracts/math/SafeMath.sol"\ }\ ],\ "functions": [\ {\ "type": "function",\ "name": "approve",\ "stateMutability": "nonpayable",\ "inputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ],\ "outputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ]\ }\ ],\ "events": [\ {\ "type": "event",\ "name": "Approval",\ "anonymous": false,\ "inputs": [\ {\ "components": [\ ""\ ],\ "indexed": true,\ "name": "to",\ "type": "address",\ "flattenedType": ""\ }\ ]\ }\ ],\ "deployerWalletID": "f39e3dbd-84af-4d3d-b5ac-98fbe047ce6a",\ "deploymentTransactionId": "00ca46f3-c31b-4e3a-92a9-068d4ff26a63",\ "txHash": "0x4a25cc5e661d8504b59c5f38ba93f010e8518966f00e2ceda7955c4b8621357d",\ "abiJson": "[{\"inputs\": [],\"stateMutability\": \"nonpayable\",\"type\": \"constructor\"},...",\ "contractAddress": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb",\ "deployerAddress": "0x1bf9ad0cc2ad298c69a2995aa806ee832788218c",\ "deployerUserID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\ "deploymentErrorReason": "",\ "deploymentErrorDetails": "",\ "description": "My first hello world contract",\ "metadataLink": "https://ipfs.io/ipfs/Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu",\ "implementationContract": {}\ }\ }\ }\ \ #### Authorizations\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-contract#authorization-authorization)\ \ 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\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-contract#parameter-x-request-id)\ \ X-Request-Id\ \ string\ \ Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support.\ \ Example:\ \ `"2adba88e-9d63-44bc-b975-9b6ae3440dde"`\ \ #### Path Parameters\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-contract#parameter-id)\ \ id\ \ string\ \ required\ \ The universally unique identifier of the resource.\ \ Example:\ \ `"b3d9d2d5-4c12-4946-a09d-953e82fae2b0"`\ \ #### Body\ \ application/json\ \ Update contract properties request\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-contract#body-name)\ \ name\ \ string\ \ The name for a contract. Must be alphanumeric \[a-zA-Z0-9\].\ \ Example:\ \ `"First Contract"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-contract#body-description)\ \ description\ \ string\ \ The description for a contract.\ \ Example:\ \ `"My first hello world contract"`\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-contract#body-archived)\ \ archived\ \ boolean\ \ The archive state of the contract. If true, the contract will not be visible in your dashboard.\ \ Example:\ \ `false`\ \ #### Response\ \ 200\ \ application/json\ \ Contract is updated.\ \ [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-contract#response-data)\ \ data\ \ object\ \ required\ \ Show child attributes\ \ Was this page helpful?\ \ YesNo\ \ [Get a contract\ \ Previous](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-contract)\ [Execute a query function on a contract\ \ Next](https://developers.circle.com/api-reference/contracts/smart-contract-platform/query-contract)\ \ ⌘I --- # Get Event Logs - Circle Docs [Skip to main content](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-event-logs#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Event Monitors Get Event Logs [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools Contracts ##### API Overview * Health * Webhook Subscriptions ##### Contracts * Templates * View / Update * Interact * Deploy / Import * Event Monitors * [GET\ \ Get Event Monitors](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors) * [POST\ \ Create Event Monitor](https://developers.circle.com/api-reference/contracts/smart-contract-platform/create-event-monitor) * [PUT\ \ Update an Event Monitor](https://developers.circle.com/api-reference/contracts/smart-contract-platform/update-event-monitor) * [DEL\ \ Delete Event Monitor](https://developers.circle.com/api-reference/contracts/smart-contract-platform/delete-event-monitor) * [GET\ \ Get Event Logs](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-event-logs) Get Event Logs cURL Copy curl --request GET \ --url https://api.circle.com/v1/w3s/contracts/events \ --header 'Authorization: Bearer ' 200 400 Copy { "data": { "eventLogs": [\ {\ "blockHash": "0xabc123def4567890",\ "blockHeight": 123456,\ "blockchain": "ETH",\ "contractAddress": "0x6bc50ff08414717f000431558c0b585332c2a53d",\ "data": "0xabcdef1234567890",\ "eventSignature": "Transfer(address,address,uint256)",\ "eventSignatureHash": "0xd3d3dd4b1fd3e53f94deb24e763485b4c925345c5abfa9ad529c67aa55a3b784",\ "firstConfirmDate": "2023-01-01T12:00:00Z",\ "id": "b56ee4eb-7f48-4ce6-ba55-b71d63a082d4",\ "logIndex": "1",\ "topics": [\ "0xd3d3dd4b1fd3e53f94deb24e763485b4c925345c5abfa9ad529c67aa55a3b784"\ ],\ "txHash": "0xe787956fa895b9debe3c43ec5db01938cf6dc4933e7470cdda7cbe492f530d17",\ "userOpHash": "0x4ceda08efcbed700caf0d47ddd5ecc9b86fca94b9aa4e349bc16837a643fb498"\ }\ ] } } GET / v1 / w3s / contracts / events Try it Get Event Logs cURL Copy curl --request GET \ --url https://api.circle.com/v1/w3s/contracts/events \ --header 'Authorization: Bearer ' 200 400 Copy { "data": { "eventLogs": [\ {\ "blockHash": "0xabc123def4567890",\ "blockHeight": 123456,\ "blockchain": "ETH",\ "contractAddress": "0x6bc50ff08414717f000431558c0b585332c2a53d",\ "data": "0xabcdef1234567890",\ "eventSignature": "Transfer(address,address,uint256)",\ "eventSignatureHash": "0xd3d3dd4b1fd3e53f94deb24e763485b4c925345c5abfa9ad529c67aa55a3b784",\ "firstConfirmDate": "2023-01-01T12:00:00Z",\ "id": "b56ee4eb-7f48-4ce6-ba55-b71d63a082d4",\ "logIndex": "1",\ "topics": [\ "0xd3d3dd4b1fd3e53f94deb24e763485b4c925345c5abfa9ad529c67aa55a3b784"\ ],\ "txHash": "0xe787956fa895b9debe3c43ec5db01938cf6dc4933e7470cdda7cbe492f530d17",\ "userOpHash": "0x4ceda08efcbed700caf0d47ddd5ecc9b86fca94b9aa4e349bc16837a643fb498"\ }\ ] } } #### Authorizations [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-event-logs#authorization-authorization) 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 [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-event-logs#parameter-x-request-id) X-Request-Id string Developer-provided parameter used to identify this request. Useful when communicating with Circle Support. A unique identifier, which can be helpful for identifying a request when communicating with Circle support. Example: `"2adba88e-9d63-44bc-b975-9b6ae3440dde"` #### Query Parameters [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-event-logs#parameter-contract-address) contractAddress string Filter contracts by address. [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-event-logs#parameter-blockchain) blockchain enum Filter by blockchain. 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"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-event-logs#parameter-from) from string Queries items created since the specified date-time (inclusive) in ISO 8601 format. Example: `"2023-01-01T12:04:05Z"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-event-logs#parameter-to) to string Queries items created before the specified date-time (inclusive) in ISO 8601 format. Example: `"2023-01-01T12:04:05Z"` [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-event-logs#parameter-page-before) pageBefore string A collection ID value used for pagination. It marks the exclusive end of a page. When provided, the collection resource will return the next n items before the id, with n being specified by pageSize. The items will be returned in the natural order of the collection. The resource will return the first page if neither pageAfter nor pageBefore are specified. SHOULD NOT be used in conjunction with pageAfter. [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-event-logs#parameter-page-after) pageAfter string A collection ID value used for pagination. It marks the exclusive begin of a page. When provided, the collection resource will return the next n items after the id, with n being specified by pageSize. The items will be returned in the natural order of the collection. The resource will return the first page if neither pageAfter nor pageBefore are specified. SHOULD NOT be used in conjunction with pageBefore. [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-event-logs#parameter-page-size) pageSize integer default:10 Limits the number of items to be returned. Some collections have a strict upper bound that will disregard this value. In case the specified value is higher than the allowed limit, the collection limit will be used. If avoided, the collection will determine the page size itself. Required range: `1 <= x <= 50` #### Response 200 application/json List of event logs retrieved successfully. [​](https://developers.circle.com/api-reference/contracts/smart-contract-platform/list-event-logs#response-data) data object required Show child attributes Was this page helpful? YesNo [Delete Event Monitor\ \ Previous](https://developers.circle.com/api-reference/contracts/smart-contract-platform/delete-event-monitor) ⌘I --- # Airdrop Template - Circle Docs [Skip to main content](https://developers.circle.com/contracts/airdrop#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation References Airdrop Template [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools * [Overview](https://developers.circle.com/build-onchain) ##### Wallets * [Circle Wallets Overview](https://developers.circle.com/wallets) * Wallets Products * Concepts * Quickstarts * Tutorials * References ##### Contracts * [Circle Contracts Overview](https://developers.circle.com/contracts) * Concepts * Quickstarts * References * [Supported Blockchains](https://developers.circle.com/contracts/supported-blockchains) * [Airdrop Template](https://developers.circle.com/contracts/airdrop) * [Token Template](https://developers.circle.com/contracts/erc-20-token) * [Multi-Token Template](https://developers.circle.com/contracts/erc-1155-multi-token) * [NFT Template](https://developers.circle.com/contracts/erc-721-nft) ##### Paymaster * [Paymaster Overview](https://developers.circle.com/paymaster) * Quickstarts * References ##### Developer Services * [Supported Blockchains](https://developers.circle.com/w3s/supported-blockchains-and-currencies) * [Blockchain Confirmations](https://developers.circle.com/w3s/blockchain-confirmations) * [Chain ID for Signing Transactions](https://developers.circle.com/w3s/sign-tx-chain-id) * [API Keys](https://developers.circle.com/w3s/keys) * [Testnet vs. Mainnet](https://developers.circle.com/w3s/sandbox-vs-production) * [Testnet Faucets](https://developers.circle.com/w3s/developer-console-faucet) * [Circle Developer Account](https://developers.circle.com/w3s/circle-developer-account) * [Developer Account Logs](https://developers.circle.com/w3s/developer-account-logs) * [Manage Team Members](https://developers.circle.com/w3s/manage-team-members) * [Postman API Suite](https://developers.circle.com/w3s/postman) * [Idempotent Requests](https://developers.circle.com/w3s/idempotent-requests) * [Compliance Requirements](https://developers.circle.com/w3s/compliance-requirements) * [HTTP Errors](https://developers.circle.com/w3s/synchronous-errors) * [Transaction States and Errors](https://developers.circle.com/w3s/asynchronous-states-and-statuses) * [Glossary](https://developers.circle.com/w3s/programmable-wallets-primitives) On this page * [Deployment parameters](https://developers.circle.com/contracts/airdrop#deployment-parameters) * [Template deployment parameters](https://developers.circle.com/contracts/airdrop#template-deployment-parameters) * [Common functions](https://developers.circle.com/contracts/airdrop#common-functions) * [setOwner \[write\]](https://developers.circle.com/contracts/airdrop#setowner-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/airdrop#parameters) * [Failure scenarios](https://developers.circle.com/contracts/airdrop#failure-scenarios) * [airdropERC1155 \[write\]](https://developers.circle.com/contracts/airdrop#airdroperc1155-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/airdrop#parameters-2) * [Failure scenarios](https://developers.circle.com/contracts/airdrop#failure-scenarios-2) * [Example](https://developers.circle.com/contracts/airdrop#example) * [airdropERC721 \[write\]](https://developers.circle.com/contracts/airdrop#airdroperc721-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/airdrop#parameters-3) * [Failure scenarios](https://developers.circle.com/contracts/airdrop#failure-scenarios-3) * [Example](https://developers.circle.com/contracts/airdrop#example-2) * [airdropERC20 \[write\]](https://developers.circle.com/contracts/airdrop#airdroperc20-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/airdrop#parameters-4) * [Failure scenarios](https://developers.circle.com/contracts/airdrop#failure-scenarios-4) * [Example](https://developers.circle.com/contracts/airdrop#example-3) * [owner \[read\]](https://developers.circle.com/contracts/airdrop#owner-%5Bread%5D) * [Example](https://developers.circle.com/contracts/airdrop#example-4) The Airdrop template is an audited, ready-to-deploy, airdrop smart contract for ERC-20, ERC-721, ERC-1155, or native tokens. The airdrop is performed by “pushing tokens,” which happens when the contract owner transfers tokens to the receivers’ addresses. Receivers do not need to take any action and do not incur a gas fee. The following are common use cases for the Airdrop template: * **Bulk token distribution**: Automatically distribute tokens to users in bulk. For example, project teams or token issuers can reward their community members, early adopters, and participants in specific campaigns by distributing tokens directly to their blockchain addresses. * **Marketing and promotion**: Increase awareness and engagement with a project or token. When a project distributes tokens to a large number of users, this attracts attention and incentivizes users to explore and participate in the project’s ecosystem. * **Community building and engagement**: Foster a strong and active community around a project. Distribute tokens to community members to incentivize them to stay engaged, participate in discussions, provide feedback, and contribute to the overall growth and success of the project. We recommend setting a maximum of 500 recipients per airdrop transaction. More than 500 recipients can cause the blockchain fees to spike or the transaction to fail. [​](https://developers.circle.com/contracts/airdrop#deployment-parameters) Deployment parameters --------------------------------------------------------------------------------------------------- The Airdrop template creates a customized airdrop smart contract to distribute ERC-20, ERC-721, ERC-1155, or native tokens to multiple users. To create a contract using this template, provide the following parameter values when deploying a smart contract template. To deploy a template, send a `POST` request to the `/templates/{id}/deploy` endpoint. **Template ID**: 13e322f2-18dc-4f57-8eed-4bddfc50f85e ### [​](https://developers.circle.com/contracts/airdrop#template-deployment-parameters) Template deployment parameters | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `defaultAdmin` | Add | X | Address of the default admin. This address can execute permissable functions on the contract.

**Important:** You lose administrative access to the contract if this is not set to an address you control. | | `contractURI` | String | | URL for the marketplace metadata of your contract. | [​](https://developers.circle.com/contracts/airdrop#common-functions) Common functions ----------------------------------------------------------------------------------------- This section lists the most commonly used functions on the Airdrop template, their respective parameters, and potential failure scenarios. These functions include: * [setOwner \[write\]](https://developers.circle.com/contracts/airdrop#setowner-write) * [airdropERC1155 \[write\]](https://developers.circle.com/contracts/airdrop#airdroperc1155-write) * [airdropERC721 \[write\]](https://developers.circle.com/contracts/airdrop#airdroperc721-write) * [airdropERC20 \[write\]](https://developers.circle.com/contracts/airdrop#airdroperc20-write) * [owner \[read\]](https://developers.circle.com/contracts/airdrop#owner-read) [​](https://developers.circle.com/contracts/airdrop#setowner-[write]) setOwner \[write\] ------------------------------------------------------------------------------------------- The `setOwner` function sets the owner of the smart contract or transfers ownership from the existing owner to a new owner. ### [​](https://developers.circle.com/contracts/airdrop#parameters) Parameters The name of the parameter is not used in the request body. | Parameter | Type | Description | | --- | --- | --- | | \__newOwner_ | address | Address of the new owner. | ### [​](https://developers.circle.com/contracts/airdrop#failure-scenarios) Failure scenarios * The `setOwner` function fails if it is called by a non-admin. [​](https://developers.circle.com/contracts/airdrop#airdroperc1155-[write]) airdropERC1155 \[write\] ------------------------------------------------------------------------------------------------------- The `airdropERC1155` function allows the owner of this address to send ERC-1155 tokens to a list of recipients. ### [​](https://developers.circle.com/contracts/airdrop#parameters-2) Parameters The names of the parameters are not used in the request body. | Parameter | Type | Description | | --- | --- | --- | | \__newOwner_ | address | Address of the new owner. | | \__contents_ | tuple:

\- address
\- uint256
\- uint256 | Array of recipient information:

\- Address that is to receive the airdrop
\- ID of the token within the ERC-1155 contract to be distributed
\- Amount of the token within the ERC-1155 contract to be distributed | ### [​](https://developers.circle.com/contracts/airdrop#failure-scenarios-2) Failure scenarios The `airdropERC1155` function fails if: * It is called by a non-admin * It contains incorrect token information, such as an invalid token ID * The Airdrop contract is not approved for what’s being transferred, which means it is not authorized to transfer assets on the airdropper’s behalf * Airdropping to a contract without a receive function ### [​](https://developers.circle.com/contracts/airdrop#example) Example The following sample code shows the new owner address and contents when sending a `POST` request to the `/developer/transactions/contractExecution` endpoint: JSON Report incorrect code Copy "abiParameters": [\ "0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF",\ [\ ["0x4CCeBa2d7D2B4fdcE4304d3e09a1fea9fbEb1528", 0, 10],\ ["0xf4e2B0fcbd0DC4b326d8A52B718A7bb43BdBd072", 0, 10],\ ]\ ] [​](https://developers.circle.com/contracts/airdrop#airdroperc721-[write]) airdropERC721 \[write\] ----------------------------------------------------------------------------------------------------- The `airdropERC721` function allows the owner of this address to send ERC-20 tokens to a list of recipients. ### [​](https://developers.circle.com/contracts/airdrop#parameters-3) Parameters The names of the parameters are not used in the request body. | Parameter | Type | Description | | --- | --- | --- | | \__tokenAddress_ | address | Address of the new owner. | | \__contents_ | tuple:

\- address
\- uint256 | Array of recipient information:

\- Address that is to receive the airdrop
\- Amount of the token within the ERC-721 contract to be distributed | ### [​](https://developers.circle.com/contracts/airdrop#failure-scenarios-3) Failure scenarios The `airdropERC721` function fails if: * It is called by a non-admin * It contains incorrect token information, such as an invalid token ID * The Airdrop contract is not approved for what’s being transferred, which means it is not authorized to transfer assets on the airdropper’s behalf * Airdropping to a contract without a receive function ### [​](https://developers.circle.com/contracts/airdrop#example-2) Example The following sample code shows the token address and contents when sending a `POST` request to the `/developer/transactions/contractExecution` endpoint: JSON Report incorrect code Copy "abiParameters": [\ "0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF",\ [\ ["0x4CCeBa2d7D2B4fdcE4304d3e09a1fea9fbEb1528", 0],\ ["0xf4e2B0fcbd0DC4b326d8A52B718A7bb43BdBd072", 1],\ ]\ ] [​](https://developers.circle.com/contracts/airdrop#airdroperc20-[write]) airdropERC20 \[write\] --------------------------------------------------------------------------------------------------- The `airdropERC20` function allows the owner of this address to send NFTs to a list of recipients. ### [​](https://developers.circle.com/contracts/airdrop#parameters-4) Parameters The names of the parameters are not used in the request body. | Parameter | Type | Description | | --- | --- | --- | | \__tokenAddress_ | address | Address of the token. | | \__contents_ | tuple:

\- address
\- uint256 | Array of recipient information:

\- Address that is to receive the airdrop
\- Quantity of tokens to be transferred | ### [​](https://developers.circle.com/contracts/airdrop#failure-scenarios-4) Failure scenarios The `airdropERC20` function fails if: * It is called by a non-admin * The Airdrop contract is not approved for what’s being transferred, which means it is not authorized to transfer assets on the airdropper’s behalf * Airdropping to a contract without a receive function ### [​](https://developers.circle.com/contracts/airdrop#example-3) Example The following sample code shows the token address and contents when sending a `POST` request to the `/developer/transactions/contractExecution` endpoint: JSON Report incorrect code Copy "abiParameters": [\ "0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF",\ "0xd41c057fd1c78805AAC12B0A94a405c0461A6FBb",\ [\ [\ "0x4CCeBa2d7D2B4fdcE4304d3e09a1fea9fbEb1528",\ 100\ ]\ ]\ ] [​](https://developers.circle.com/contracts/airdrop#owner-[read]) owner \[read\] ----------------------------------------------------------------------------------- The `owner` function retrieves the address of the current owner. ### [​](https://developers.circle.com/contracts/airdrop#example-4) Example The following sample code shows the `owner` function when sending a `POST` request to the `/contracts/query` endpoint: JSON Report incorrect code Copy "abiFunctionSignature": "owner()" Was this page helpful? YesNo [Circle Contracts Supported Blockchains\ \ Previous](https://developers.circle.com/contracts/supported-blockchains) [Token Template\ \ Next](https://developers.circle.com/contracts/erc-20-token) ⌘I --- # Quickstart: Event Monitoring for Smart Contracts - Circle Docs [Skip to main content](https://developers.circle.com/contracts/scp-event-monitoring#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Quickstarts Quickstart: Event Monitoring for Smart Contracts [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools * [Overview](https://developers.circle.com/build-onchain) ##### Wallets * [Circle Wallets Overview](https://developers.circle.com/wallets) * Wallets Products * Concepts * Quickstarts * Tutorials * References ##### Contracts * [Circle Contracts Overview](https://developers.circle.com/contracts) * Concepts * Quickstarts * [Deploy a Smart Contract using Bytecode](https://developers.circle.com/contracts/scp-deploy-smart-contract) * [Deploy an ERC-1155 Contract Template](https://developers.circle.com/contracts/deploy-smart-contract-template) * [Interact With a Smart Contract](https://developers.circle.com/contracts/scp-interact-smart-contract) * [Event Monitoring for Smart Contracts](https://developers.circle.com/contracts/scp-event-monitoring) * References ##### Paymaster * [Paymaster Overview](https://developers.circle.com/paymaster) * Quickstarts * References ##### Developer Services * [Supported Blockchains](https://developers.circle.com/w3s/supported-blockchains-and-currencies) * [Blockchain Confirmations](https://developers.circle.com/w3s/blockchain-confirmations) * [Chain ID for Signing Transactions](https://developers.circle.com/w3s/sign-tx-chain-id) * [API Keys](https://developers.circle.com/w3s/keys) * [Testnet vs. Mainnet](https://developers.circle.com/w3s/sandbox-vs-production) * [Testnet Faucets](https://developers.circle.com/w3s/developer-console-faucet) * [Circle Developer Account](https://developers.circle.com/w3s/circle-developer-account) * [Developer Account Logs](https://developers.circle.com/w3s/developer-account-logs) * [Manage Team Members](https://developers.circle.com/w3s/manage-team-members) * [Postman API Suite](https://developers.circle.com/w3s/postman) * [Idempotent Requests](https://developers.circle.com/w3s/idempotent-requests) * [Compliance Requirements](https://developers.circle.com/w3s/compliance-requirements) * [HTTP Errors](https://developers.circle.com/w3s/synchronous-errors) * [Transaction States and Errors](https://developers.circle.com/w3s/asynchronous-states-and-statuses) * [Glossary](https://developers.circle.com/w3s/programmable-wallets-primitives) On this page * [Prerequisites](https://developers.circle.com/contracts/scp-event-monitoring#prerequisites) * [Step 1. Configure Your Webhook for Notifications](https://developers.circle.com/contracts/scp-event-monitoring#step-1-configure-your-webhook-for-notifications) * [Customized Webhook Notifications](https://developers.circle.com/contracts/scp-event-monitoring#customized-webhook-notifications) * [The Event Log Notification](https://developers.circle.com/contracts/scp-event-monitoring#the-event-log-notification) * [Step 2. Import Your Smart Contract](https://developers.circle.com/contracts/scp-event-monitoring#step-2-import-your-smart-contract) * [Step 3. Create an Event Monitor](https://developers.circle.com/contracts/scp-event-monitoring#step-3-create-an-event-monitor) * [Finding and Using the Event Signature](https://developers.circle.com/contracts/scp-event-monitoring#finding-and-using-the-event-signature) * [Step 4. Fetch Event History](https://developers.circle.com/contracts/scp-event-monitoring#step-4-fetch-event-history) In this guide you’ll set up real-time push notifications for specific Events that occur in your smart contracts. You can then use those events to trigger important functionality in your application. [​](https://developers.circle.com/contracts/scp-event-monitoring#prerequisites) Prerequisites ------------------------------------------------------------------------------------------------ Before you begin: * Create a [Circle Developer Account](https://developers.circle.com/w3s/circle-developer-account) and API key Perform the steps below: 1. [Step 1. Configure Your Webhook for Notifications](https://developers.circle.com/contracts/scp-event-monitoring#step-1-configure-your-webhook-for-notifications) 2. [Step 2. Import Your Smart Contract](https://developers.circle.com/contracts/scp-event-monitoring#step-2-import-your-smart-contract) 3. [Step 3. Create an Event Monitor](https://developers.circle.com/contracts/scp-event-monitoring#step-3-create-an-event-monitor) 4. [Step 4. Fetch Event History](https://developers.circle.com/contracts/scp-event-monitoring#step-4-fetch-event-history) ### [​](https://developers.circle.com/contracts/scp-event-monitoring#step-1-configure-your-webhook-for-notifications) Step 1. Configure Your Webhook for Notifications To receive notifications from Circle, you must expose a publicly accessible subscriber endpoint on your side. This endpoint should handle POST requests over HTTPS. For more information on setting up a webhook, refer to the [Webhooks Quickstart](https://developers.circle.com/wallets/webhook-notifications) , and optionally watch the following video about Webhook Configurations. Video Tutorial: Webhook Configuration [​](https://developers.circle.com/contracts/scp-event-monitoring#customized-webhook-notifications) Customized Webhook Notifications -------------------------------------------------------------------------------------------------------------------------------------- Customized webhook notifications enable you to listen to a restricted set of notifications. To create a webhook for smart contract events only select Limit to specific events when creating your webhook in the Developer Console, then choose contracts.EventLog. [​](https://developers.circle.com/contracts/scp-event-monitoring#the-event-log-notification) The Event Log Notification -------------------------------------------------------------------------------------------------------------------------- When a monitored event occurs, the webhook will receive a notification via POST with the body formatted as follows: Notification JSON Report incorrect code Copy { // A unique identifier for the subscription that received the notification. "subscriptionId": "c881d120-7692-4ae6-bab0-acfa8c9596c1", // A unique identifier for the notification itself. "notificationId": "aff457c5-2649-4cdb-a51e-84b33fdfebc9", // The type of notification; indicates an event log from a smart contract. "notificationType": "contracts.eventLog", // An object that contains details about the event log notification. "notification": { // The address of the smart contract that emitted the event. "contractAddress": "0x6bc50ff08414717f000431558c0b585332c2a53d", // The specific blockchain network where the event occurred. "blockchain": "ARB-SEPOLIA", // A hash to identify the on-chain transaction that caused the event. "txHash": "0xdc8c0ac07ca02f87754e931b729d9426a5bd7f6b062fbb40e58c8a7942992a7a", // A hash representing the user operation that triggered the event, if applicable. "userOpHash": "0xbaae33f07aa4877f5a2e9f2a90c5cc5c5006281043696ebaa7f887914058ead0", // The name and parameter types of the emitted event. "eventName": "Transfer(address,address,uint256)", // An array containing indexed parameters of the event. Each entry is a hashed representation of the parameter. "topics": [\ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",\ "0x0000000000000000000000000000000000000000000000000000000000000000",\ "0x0000000000000000000000009d7fb3144729fff819fc1aa812d0a261ed8c8676"\ ], // The raw data associated with the event, consisting of non-indexed parameters as a concatenated hexadecimal string. "data": "0x00000000000000000000000000000000000000000000000000005af3107a3fff" }, // The UTC timestamp of when the notification was generated, formatted to ISO 8601. "timestamp": "2024-10-21T18:44:07.614649603Z", // Indicates the version of the notification format. "version": 2 } ### [​](https://developers.circle.com/contracts/scp-event-monitoring#step-2-import-your-smart-contract) Step 2. Import Your Smart Contract Before creating an event monitor, import your smart contract into the Contracts system. This ensures the Contracts platform is aware of your contract and can manage event monitors effectively: javascript Report incorrect code Copy const importResponse = await circleContractSdk.importContract({ // The address of the smart contract to be imported. address: "0x6bc50ff08414717f000431558c0b585332c2a53d", // The blockchain from which the contract is being imported. blockchain: "ARB-SEPOLIA", // A unique key provided to ensure idempotency of the request. It prevents duplicate imports for the same contract if a retry occurs. idempotencyKey: "50d64a5e-6b2e-47ea-aa14-13feab9376e9", // A human-readable name for the contract being imported. name: "MyToken", // A brief description of the smart contract. description: "My ERC-20 Token Contract", }); If you attempt to create an event monitor on an un-imported smart contract, you will receive the following error message: JSON Report incorrect code Copy { "code": 175001, "message": "contract not found" } For more information on importing a contract, see the Import a contract API endpoint. [​](https://developers.circle.com/contracts/scp-event-monitoring#step-3-create-an-event-monitor) Step 3. Create an Event Monitor ----------------------------------------------------------------------------------------------------------------------------------- Event Monitors listen for configured events on the blockchain and trigger notifications to your webhook endpoint when those events occur. Circle will also save all emitted events under that monitor, allowing you to retrieve historical data later. For more details, see Step 4. Fetch Event History. ### [​](https://developers.circle.com/contracts/scp-event-monitoring#finding-and-using-the-event-signature) Finding and Using the Event Signature An event signature uniquely identifies an event within a smart contract and is derived from the event’s name and parameter types using the keccak-256 hashing function. For readability, event monitors are created using the human-readable event signature, not the hash. For example, the Transfer event in the ERC-20 interface is defined as: JavaScript Report incorrect code Copy event Transfer(address indexed from, address indexed to, uint256 value); The human-readable event signature is formatted as: ‘Transfer(address,address,uint256)’. **Note:** Spaces are not allowed in the event string signature. Create an event monitor with the following code: JavaScript Report incorrect code Copy const monitorResponse = await circleContractSdk.createEventMonitor({ // The specific blockchain network where the event monitor will be created. blockchain: "ARB-SEPOLIA", // The address of the smart contract for which the event monitor is being created. contractAddress: "0x6bc50ff08414717f000431558c0b585332c2a53d", // The signature of the event to monitor, defining the event type and parameters being tracked. eventSignature: "Transfer(address,address,uint256)", // A unique key provided to ensure idempotency of the request, preventing duplicate event monitors from being created. idempotencyKey: "f80fcf44-bbb1-4336-870a-f1802ad98e0f", }); The response will include details about the event monitor: JSON Report incorrect code Copy { "data": { "eventMonitor": { // A unique identifier for the event monitor. "id": "01929bc2-aab3-76a2-b3fc-c99fc94b9218", // The address of the smart contract being monitored. "contractAddress": "0x6bc50ff08414717f000431558c0b585332c2a53d", // The specific blockchain where the event monitor is set up. "blockchain": "ARB-SEPOLIA", // The signature of the event being monitored, indicating the type and parameters. "eventSignature": "Transfer(address,address,uint256)", // The hash of the event signature used for efficient identification. "eventSignatureHash": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", // A boolean indicating whether the event monitor is currently enabled. "isEnabled": true, // The date and time when the event monitor was created, in ISO 8601 format. "createDate": "2024-10-17T18:34:39.1558Z", // The date and time when the event monitor was last updated, in ISO 8601 format. "updateDate": "2024-10-17T18:34:39.1558Z" } } } If the event signature you are creating a monitor for does not exist, you will receive the following error message: JSON Report incorrect code Copy { "code": 175303, "message": "The specified event signature does not exist" } **Note:** Please ensure the event signature exists if you are using an unverified contract as Circle cannot verify event existence for unverified contracts. After creating an event monitor, you can view, disable, and delete your monitors. For more information, see the [Event Monitoring APIs](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors) . ### [​](https://developers.circle.com/contracts/scp-event-monitoring#step-4-fetch-event-history) Step 4. Fetch Event History To retrieve historical events that match your monitors, utilize the event history feature. This functionality is essential for doing analytics, auditing, or reconstructing the application state based on past events: JavaScript Report incorrect code Copy const eventHistoryResponse = await circleContractSdk.getEventHistory({ // The address of the smart contract for which event history is being fetched. contractAddress: "0x6bc50ff08414717f000431558c0b585332c2a53d", // The specific blockchain network where the contract is deployed. blockchain: "ARB-SEPOLIA", // The signature of the event to fetch historical occurrences. eventSignature: "Transfer(address,address,uint256)", }); The data returned will mirror the information in your Webhook Logs in the [Circle Console](https://console.circle.com/) : JSON Report incorrect code Copy { "data": { "eventLogs": [\ {\ // A unique identifier for the event log.\ "id": "0192b064-c71d-7642-8882-aadc8f5df01a",\ // The blockchain network where the event occurred.\ "blockchain": "ARB-SEPOLIA",\ // The transaction hash associated with the event log.\ "txHash": "0xdc8c0ac07ca02f87754e931b729d9426a5bd7f6b062fbb40e58c8a7942992a7a",\ // The index of the log entry within the transaction.\ "logIndex": "1",\ // The hash of the block containing the transaction.\ "blockHash": "0x842dfd3c9339008d311c78154368f0f11f91801d5f40d7306745576aa9c246f7",\ // The height of the block in which the event occurred.\ "blockHeight": 90526683,\ // The address of the smart contract that emitted the event.\ "contractAddress": "0x6bc50ff08414717f000431558c0b585332c2a53d",\ // The signature of the event that was emitted.\ "eventSignature": "Transfer(address,address,uint256)",\ // The hash of the event signature for efficient identification.\ "eventSignatureHash": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",\ // An array of topics indexed within the event log for filtering.\ "topics": [\ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",\ "0x0000000000000000000000000000000000000000000000000000000000000000",\ "0x0000000000000000000000009d7fb3144729fff819fc1aa812d0a261ed8c8676"\ ],\ // Raw data associated with the event, representing non-indexed parameters.\ "data": "0x00000000000000000000000000000000000000000000000000005af3107a3fff",\ \ // A hash representing the user operation that triggered the event, when applicable.\ "userOpHash": "0xbaae33f07aa4877f5a2e9f2a90c5cc5c5006281043696ebaa7f887914058ead0",\ // The date and time when the first confirmation of the event occurred.\ "firstConfirmDate": "2024-10-21T18:44:04Z"\ }\ ] } } **Note:**Event history for a monitor will always be available; however, the resource will stop being populated once the monitor is deleted. For more information, see the [Event Monitoring APIs](https://developers.circle.com/api-reference/contracts/smart-contract-platform/get-event-monitors) and join our [Discord - Build on Circle](https://discord.com/invite/buildoncircle) channel. Was this page helpful? YesNo [Quickstart: Interact With a Smart Contract\ \ Previous](https://developers.circle.com/contracts/scp-interact-smart-contract) [Circle Contracts Supported Blockchains\ \ Next](https://developers.circle.com/contracts/supported-blockchains) ⌘I --- # Getting Started with the Contracts Node.js SDK - Circle Docs [Skip to main content](https://developers.circle.com/sdks/contracts-nodejs-sdk#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Contracts Getting Started with the Contracts Node.js SDK [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools * [SDKs](https://developers.circle.com/sdks) * [Server-side SDK Pydantic v2 Upgrade](https://developers.circle.com/sdks/pydantic-v2-upgrade) ##### Developer-Controlled Wallets * [Node.js SDK](https://developers.circle.com/sdks/developer-controlled-wallets-nodejs-sdk) * [Python SDK](https://developers.circle.com/sdks/developer-controlled-wallets-python-sdk) ##### User-Controlled Wallets * [Node.js SDK](https://developers.circle.com/sdks/user-controlled-wallets-nodejs-sdk) * [Python SDK](https://developers.circle.com/sdks/user-controlled-wallets-python-sdk) ##### Contracts * [Node.js SDK](https://developers.circle.com/sdks/contracts-nodejs-sdk) * [Python SDK](https://developers.circle.com/sdks/contracts-python-sdk) On this page * [Prerequisites](https://developers.circle.com/sdks/contracts-nodejs-sdk#prerequisites) * [Install the SDK](https://developers.circle.com/sdks/contracts-nodejs-sdk#install-the-sdk) * [Contracts client](https://developers.circle.com/sdks/contracts-nodejs-sdk#contracts-client) * [Import the client](https://developers.circle.com/sdks/contracts-nodejs-sdk#import-the-client) * [Deploy a smart contract](https://developers.circle.com/sdks/contracts-nodejs-sdk#deploy-a-smart-contract) * [Client configuration options](https://developers.circle.com/sdks/contracts-nodejs-sdk#client-configuration-options) Use the Node.js SDK to interact with Contracts APIs, which allow you interact with smart contracts on the blockchain using the Developer Services platform. This page provides short examples of how to install and use the Contracts SDK. For complete examples, see the [Sample Projects](https://developers.circle.com/sample-projects) page. For more information see the [Contracts documentation](https://developers.circle.com/contracts) . [​](https://developers.circle.com/sdks/contracts-nodejs-sdk#prerequisites) Prerequisites ------------------------------------------------------------------------------------------- To successfully use the Contracts SDK, you need the following: * Have [Node.js](https://nodejs.org/) and npm installed. Circle recommends Node 16 or higher. * Have an active [Circle Developer Account](https://console.circle.com/) . * [Generate an API key](https://developers.circle.com/w3s/keys) to use in requests to the Circle API. * [Generate an entity secret](https://developers.circle.com/wallets/dev-controlled/register-entity-secret) to use in requests with the Contracts SDK. [​](https://developers.circle.com/sdks/contracts-nodejs-sdk#install-the-sdk) Install the SDK ----------------------------------------------------------------------------------------------- Use the following commands to install the SDK. You can [view the package information on the npm site](https://www.npmjs.com/package/@circle-fin/smart-contract-platform) . npm yarn Report incorrect code Copy npm install @circle-fin/smart-contract-platform --save [​](https://developers.circle.com/sdks/contracts-nodejs-sdk#contracts-client) Contracts client ------------------------------------------------------------------------------------------------- To start using the SDK, you first need to configure a client. Import the `initiateSmartContractPlatformClient` factory from the SDK, and then initialize the client using your API key and entity secret. ### [​](https://developers.circle.com/sdks/contracts-nodejs-sdk#import-the-client) Import the client The following example shows how to import the client and configure it to use your API key and entity secret: CommonJS ES Module Report incorrect code Copy const { initiateSmartContractPlatformClient, } = require("@circle-fin/smart-contract-platform"); const client = initiateSmartContractPlatformClient({ apiKey: "", entitySecret: "", }); ### [​](https://developers.circle.com/sdks/contracts-nodejs-sdk#deploy-a-smart-contract) Deploy a smart contract The following example shows how to deploy a smart contract using the client: Report incorrect code Copy const response = await client.deployContract({ name: "First Contract", description: "My first hello world contract", walletId: "004735f6-d9fc-44f8-933c-672cdf3d240d", 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",\ });\ console.log(response.data);\ \ \ [​](https://developers.circle.com/sdks/contracts-nodejs-sdk#client-configuration-options)\ \ Client configuration options\ -------------------------------------------------------------------------------------------------------------------------\ \ The client for the Contracts SDK accepts the following configuration parameters:\ \ | **Option** | **Required?** | **Description** |\ | --- | --- | --- |\ | `apiKey` | Yes | The API key used to authenticate requests to the Circle API. |\ | `entitySecret` | Yes | Your configured entity secret. |\ | `storage` | No | Optional custom storage solution for persisting data. If not provided, the SDK uses in-memory storage. |\ \ Was this page helpful?\ \ YesNo\ \ [Getting Started with the User-Controlled Wallets Python SDK\ \ Previous](https://developers.circle.com/sdks/user-controlled-wallets-python-sdk)\ [Getting Started with the Contracts Python SDK\ \ Next](https://developers.circle.com/sdks/contracts-python-sdk)\ \ ⌘I --- # Token Template - Circle Docs [Skip to main content](https://developers.circle.com/contracts/erc-20-token#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation References Token Template [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools * [Overview](https://developers.circle.com/build-onchain) ##### Wallets * [Circle Wallets Overview](https://developers.circle.com/wallets) * Wallets Products * Concepts * Quickstarts * Tutorials * References ##### Contracts * [Circle Contracts Overview](https://developers.circle.com/contracts) * Concepts * Quickstarts * References * [Supported Blockchains](https://developers.circle.com/contracts/supported-blockchains) * [Airdrop Template](https://developers.circle.com/contracts/airdrop) * [Token Template](https://developers.circle.com/contracts/erc-20-token) * [Multi-Token Template](https://developers.circle.com/contracts/erc-1155-multi-token) * [NFT Template](https://developers.circle.com/contracts/erc-721-nft) ##### Paymaster * [Paymaster Overview](https://developers.circle.com/paymaster) * Quickstarts * References ##### Developer Services * [Supported Blockchains](https://developers.circle.com/w3s/supported-blockchains-and-currencies) * [Blockchain Confirmations](https://developers.circle.com/w3s/blockchain-confirmations) * [Chain ID for Signing Transactions](https://developers.circle.com/w3s/sign-tx-chain-id) * [API Keys](https://developers.circle.com/w3s/keys) * [Testnet vs. Mainnet](https://developers.circle.com/w3s/sandbox-vs-production) * [Testnet Faucets](https://developers.circle.com/w3s/developer-console-faucet) * [Circle Developer Account](https://developers.circle.com/w3s/circle-developer-account) * [Developer Account Logs](https://developers.circle.com/w3s/developer-account-logs) * [Manage Team Members](https://developers.circle.com/w3s/manage-team-members) * [Postman API Suite](https://developers.circle.com/w3s/postman) * [Idempotent Requests](https://developers.circle.com/w3s/idempotent-requests) * [Compliance Requirements](https://developers.circle.com/w3s/compliance-requirements) * [HTTP Errors](https://developers.circle.com/w3s/synchronous-errors) * [Transaction States and Errors](https://developers.circle.com/w3s/asynchronous-states-and-statuses) * [Glossary](https://developers.circle.com/w3s/programmable-wallets-primitives) On this page * [Deployment parameters](https://developers.circle.com/contracts/erc-20-token#deployment-parameters) * [Template deployment parameters](https://developers.circle.com/contracts/erc-20-token#template-deployment-parameters) * [Common functions](https://developers.circle.com/contracts/erc-20-token#common-functions) * [approve \[write\]](https://developers.circle.com/contracts/erc-20-token#approve-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/erc-20-token#parameters) * [Failure scenarios](https://developers.circle.com/contracts/erc-20-token#failure-scenarios) * [Notes](https://developers.circle.com/contracts/erc-20-token#notes) * [transfer \[write\]](https://developers.circle.com/contracts/erc-20-token#transfer-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/erc-20-token#parameters-2) * [Failure scenarios](https://developers.circle.com/contracts/erc-20-token#failure-scenarios-2) * [mintTo \[write\]](https://developers.circle.com/contracts/erc-20-token#mintto-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/erc-20-token#parameters-3) * [Failure scenarios](https://developers.circle.com/contracts/erc-20-token#failure-scenarios-3) * [burn \[write\]](https://developers.circle.com/contracts/erc-20-token#burn-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/erc-20-token#parameters-4) * [Failure scenarios](https://developers.circle.com/contracts/erc-20-token#failure-scenarios-4) * [Permissions and roles](https://developers.circle.com/contracts/erc-20-token#permissions-and-roles) * [grantRole \[write\]](https://developers.circle.com/contracts/erc-20-token#grantrole-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/erc-20-token#parameters-5) * [Failure scenarios](https://developers.circle.com/contracts/erc-20-token#failure-scenarios-5) * [revokeRole \[write\]](https://developers.circle.com/contracts/erc-20-token#revokerole-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/erc-20-token#parameters-6) * [Failure scenarios](https://developers.circle.com/contracts/erc-20-token#failure-scenarios-6) * [balanceOf \[read\]](https://developers.circle.com/contracts/erc-20-token#balanceof-%5Bread%5D) * [Parameters](https://developers.circle.com/contracts/erc-20-token#parameters-7) * [allowance \[read\]](https://developers.circle.com/contracts/erc-20-token#allowance-%5Bread%5D) * [Parameters](https://developers.circle.com/contracts/erc-20-token#parameters-8) The Token template is an audited, ready-to-deploy smart contract for an ERC-20 token. The ERC-20 standard is the most popular standard for fungible tokens. The token’s fungibility allows it to be used for a variety of use cases, including: * **Stablecoins:** ERC-20 tokens serve as the foundation for stablecoins like USDC, backed by US dollars. To learn more about the USDC contract, see [0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48](https://etherscan.io/token/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48) on Etherscan. * **Loyalty points:** ERC-20 tokens can represent on-chain loyalty points to incentivize and reward users for their activities within a platform or ecosystem. * **Governance:** ERC-20 tokens can represent governance rights, allowing holders to participate in protocol decisions. Notable examples include tokens utilized by platforms like Uniswap. * **Ownership:** ERC-20 tokens can also represent fractional ownership in real-world assets, such as houses, ounces of gold, or company shares. In this comprehensive guide, you explore the Token template, which provides all the necessary information to deploy and understand the contract’s common functions. [​](https://developers.circle.com/contracts/erc-20-token#deployment-parameters) Deployment parameters -------------------------------------------------------------------------------------------------------- The Token template creates a customized, fully compliant ERC-20 smart contract. To create a contract using this template, provide the following parameter values when deploying a smart contract template using the [`POST: /templates/{id}/deploy`](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template) API. **Template ID:** a1b74add-23e0-4712-88d1-6b3009e85a86 ### [​](https://developers.circle.com/contracts/erc-20-token#template-deployment-parameters) Template deployment parameters | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `name` | String | X | Name of the contract - stored as a property of the contract on-chain. | | `symbol` | String | | Symbol of the token - stored on-chain. The symbol is usually 3 or 4 characters in length. | | `defaultAdmin` | String | X | The address of the default admin. This address can execute permissioned functions on the contract.
**Important:** You will lose administrative access to the contract if this is not set to an address you control. | | `primarySaleRecipient` | String | X | The recipient address for first-time sales. | | `platformFeeRecipient` | String | | The recipient address for all sales fees. If you deploy a template on someone else’s behalf, you can set this to your own address. | | `platformFeePercent` | Float | | The percentage of sales that go to the platform fee recipient. For example, set it as 0.1 if you want 10% of sales fees to go to the  `platformFeeRecipient`. | | `contractUri` | String | | The URL for the marketplace metadata of your contract. This is used on marketplaces like OpenSea. See [Contract-level Metadata](https://docs.opensea.io/docs/contract-level-metadata)
for more information. | | `trustedForwarders` | Strings\[\] | | A list of addresses that can forward ERC2771 meta-transactions to this contract. See [ethereum.org](https://eips.ethereum.org/EIPS/eip-2771)
for more information. | Here is an example of the `templateParameters` JSON object within the request body to [deploy a contract from a template](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template) for the ERC-20 Token template. In this example, the `defaultAdmin` and `primarySaleRecipient` parameters are the same address but can be set distinctly based on your use case. JSON Report incorrect code Copy "templateParameters": { "name": "My Token Contract", "defaultAdmin": "0x4F77E56dfA40990349e1078e97AC3Eb479e0dAc6", "primarySaleRecipient": "0x4F77E56dfA40990349e1078e97AC3Eb479e0dAc6" } [​](https://developers.circle.com/contracts/erc-20-token#common-functions) Common functions ---------------------------------------------------------------------------------------------- This section lists the most commonly used functions on the Token template, their respective parameters and potential failure scenarios. These functions include: * [approve \[write\]](https://developers.circle.com/contracts/erc-20-token#approve-write) * [transfer \[write\]](https://developers.circle.com/contracts/erc-20-token#transfer-write) * [mintTo \[write\]](https://developers.circle.com/contracts/erc-20-token#mintto-write) * [burn \[write\]](https://developers.circle.com/contracts/erc-20-token#burn-write) * [grantRole \[write\]](https://developers.circle.com/contracts/erc-20-token#grantrole-write) * [revokeRole \[write\]](https://developers.circle.com/contracts/erc-20-token#revokerole-write) * [balanceOf \[read\]](https://developers.circle.com/contracts/erc-20-token#balanceof-write) * [allowance \[read\]](https://developers.circle.com/contracts/erc-20-token#allowance-write) At this time, not all failure scenarios or error messages received from the blockchain are passed through Circle’s APIs. Instead, you will receive a generic [`ESTIMATION_ERROR`](https://developers.circle.com/w3s/asynchronous-states-and-statuses#transaction-errors) error. If available, the `errorDetails` field will have more information on the cause of failure. [​](https://developers.circle.com/contracts/erc-20-token#approve-[write]) approve \[write\] ---------------------------------------------------------------------------------------------- The `approve` function lets token owners specify a limit on the number of tokens another account address can spend on their behalf. ### [​](https://developers.circle.com/contracts/erc-20-token#parameters) Parameters | Parameter | Type | Description | | --- | --- | --- | | `spender` | address | The owner approves the account address to spend tokens. It could be another smart contract address or an externally owned account address. | | `amount` | unit256 | The number of tokens the owner approves for spending by the specified spender. The amount should be set in the smallest denomination of the ERC-20 token. | ### [​](https://developers.circle.com/contracts/erc-20-token#failure-scenarios) Failure scenarios * The approve function fails if the `spender` is the zero address. _”ERC20: approve to the zero address”_ ### [​](https://developers.circle.com/contracts/erc-20-token#notes) Notes * If `amount` is the maximum uint256 value the allowance is not updated when the `transferFrom` function is called. This is semantically equivalent to an infinite approval. * There is no balance check on the `approve` function so token owners may approve allowances greater than their current balance. Solidity Report incorrect code Copy function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } [​](https://developers.circle.com/contracts/erc-20-token#transfer-[write]) transfer \[write\] ------------------------------------------------------------------------------------------------ Allows the token owner to transfer a specified number of tokens to another account address. ### [​](https://developers.circle.com/contracts/erc-20-token#parameters-2) Parameters | Parameter | Type | Description | | --- | --- | --- | | `to` | address | The address to which the token will be transferred. This can be another user’s address or a smart contract address. | | `amount` | unit256 | The number of tokens to transfer. | ### [​](https://developers.circle.com/contracts/erc-20-token#failure-scenarios-2) Failure scenarios * The `to` address parameter is checked to ensure it is not the zero address `address(0)`. _”ERC20: transfer to the zero address”_ * The `beforeTokenTransfer` hook is called, which checks `TOKEN_TRANSFER` permissions. ”restricted to TRANSFER\_ROLE holders” * The token owner doesn’t have a sufficient balance to transfer the specified token amount. _”ERC20: transfer amount exceeds balance”_ Solidity Report incorrect code Copy function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } [​](https://developers.circle.com/contracts/erc-20-token#mintto-[write]) mintTo \[write\] -------------------------------------------------------------------------------------------- A designated minter can create a specified number of tokens and assign them to a specified account address. ### [​](https://developers.circle.com/contracts/erc-20-token#parameters-3) Parameters | Parameter | Type | Description | | --- | --- | --- | | `to` | address | The address to which the newly minted tokens will be assigned. | | `amount` | unit256 | The number of tokens to be minted and assigned to the specified address. | ### [​](https://developers.circle.com/contracts/erc-20-token#failure-scenarios-3) Failure scenarios * The function checks if the caller has the `MINTER_ROLE`. The function will fail if the caller does not have the minter role. Expect to see the following error: _“not minter.”_ * The function ensures that the account address is not the zero address `address(0)`, as this is an invalid address to mint tokens to. _”ERC20: mint to the zero address”_ * The `beforeTokenTransfer` hook is called, which checks `TOKEN_TRANSFER` permissions. _”restricted to_ TRANSFER_ROLE \_holders”_ Solidity Report incorrect code Copy function mintTo(address to, uint256 amount) public virtual { require(hasRole(MINTER_ROLE, _msgSender()), "not minter."); _mintTo(to, amount); } [​](https://developers.circle.com/contracts/erc-20-token#burn-[write]) burn \[write\] ---------------------------------------------------------------------------------------- Allows a token holder to burn (destroy) a specified number of the token total supply. ### [​](https://developers.circle.com/contracts/erc-20-token#parameters-4) Parameters | Parameter | Type | Description | | --- | --- | --- | | `amount` | unit256 | The number of tokens to be burned. | ### [​](https://developers.circle.com/contracts/erc-20-token#failure-scenarios-4) Failure scenarios * The `_beforeTokenTransfer`  hook is called, which checks `TOKEN_TRANSFER` permissions. _”restricted to TRANSFER\_ROLE holders”_ * The token owner has no sufficient balance to burn the specified token amount. _”ERC20: burn amount exceeds balance”_ Solidity Report incorrect code Copy function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); } ### [​](https://developers.circle.com/contracts/erc-20-token#permissions-and-roles) Permissions and roles Roles are referred to by their `bytes32` identifier. For example: Solidity Report incorrect code Copy bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); Roles can also represent a set of permissions. To restrict access to a function call, use `hasRole`: Solidity Report incorrect code Copy function foo() public { require(hasRole(MY_ROLE, msg.sender)); ... } Roles can be granted and revoked dynamically via the `grantRole` and `revokeRole` functions. Each role has an associated admin role, and only accounts that have a role’s admin role can call `grantRole` and `revokeRole`. By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`. Only accounts with the `DEFAULT_ADMIN_ROLE` can grant or revoke other roles. You can use the `_setRoleAdmin` function to create more complex role relationships. [​](https://developers.circle.com/contracts/erc-20-token#grantrole-[write]) grantRole \[write\] -------------------------------------------------------------------------------------------------- Grants a specified role to an account. Only an account address that has the admin role assigned can call this function. ### [​](https://developers.circle.com/contracts/erc-20-token#parameters-5) Parameters | Parameter | Type | Description | | --- | --- | --- | | `role` | bytes32 | The bytes32 identifier of the role to be granted. | | `account` | address | The address to which the role will be granted. | ### [​](https://developers.circle.com/contracts/erc-20-token#failure-scenarios-5) Failure scenarios * The `onlyRole(getRoleAdmin(role))` modifier ensures that the function caller has the admin role for the specified role. Only addresses with the admin role can grant roles to other accounts. _”AccessControl: account ”, StringsUpgradeable.toHexString(account), ” is missing role ”, StringsUpgradeable.toHexString(uint256(role), 32)_ * The function checks if the account already has the specified role using the `hasRole` function. If the account does not have the role, the function continues. There is no error message. Solidity Report incorrect code Copy function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } [​](https://developers.circle.com/contracts/erc-20-token#revokerole-[write]) revokeRole \[write\] ---------------------------------------------------------------------------------------------------- Revoke the specified role from an account address. Only account addresses with the admin role assigned can call this function. ### [​](https://developers.circle.com/contracts/erc-20-token#parameters-6) Parameters | Parameter | Type | Description | | --- | --- | --- | | `role` | bytes32 | The role to be revoked. | | `account` | address | The address from which the role will be revoked. | ### [​](https://developers.circle.com/contracts/erc-20-token#failure-scenarios-6) Failure scenarios * The `onlyRole(getRoleAdmin(role))` modifier ensures that the function caller has the admin role for the specified role. Only addresses with the admin role can revoke roles from other accounts. _”AccessControl: account ”, StringsUpgradeable.toHexString(account), ” is missing role ”, StringsUpgradeable.toHexString(uint256(role), 32)_ Solidity Report incorrect code Copy function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } [​](https://developers.circle.com/contracts/erc-20-token#balanceof-[read]) balanceOf \[read\] ------------------------------------------------------------------------------------------------ Retrieves the balance of tokens owned by a specific account address. ### [​](https://developers.circle.com/contracts/erc-20-token#parameters-7) Parameters | Parameter | Type | Description | | --- | --- | --- | | `account` | address | The address for which the token balance is being fetched. | Solidity Report incorrect code Copy function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } [​](https://developers.circle.com/contracts/erc-20-token#allowance-[read]) allowance \[read\] ------------------------------------------------------------------------------------------------ Returns the maximum amount the spender is approved to withdraw from the owner’s account. This function retrieves the allowance granted by the owner account address to the spender account address. ### [​](https://developers.circle.com/contracts/erc-20-token#parameters-8) Parameters | Parameter | Type | Description | | --- | --- | --- | | `owner` | address | The address that granted the allowance. | | `spender` | address | The address for which the allowance is being fetched. | Solidity Report incorrect code Copy function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } Was this page helpful? YesNo [Airdrop Template\ \ Previous](https://developers.circle.com/contracts/airdrop) [Multi-Token Template\ \ Next](https://developers.circle.com/contracts/erc-1155-multi-token) ⌘I --- # NFT Template - Circle Docs [Skip to main content](https://developers.circle.com/contracts/erc-721-nft#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation References NFT Template [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools * [Overview](https://developers.circle.com/build-onchain) ##### Wallets * [Circle Wallets Overview](https://developers.circle.com/wallets) * Wallets Products * Concepts * Quickstarts * Tutorials * References ##### Contracts * [Circle Contracts Overview](https://developers.circle.com/contracts) * Concepts * Quickstarts * References * [Supported Blockchains](https://developers.circle.com/contracts/supported-blockchains) * [Airdrop Template](https://developers.circle.com/contracts/airdrop) * [Token Template](https://developers.circle.com/contracts/erc-20-token) * [Multi-Token Template](https://developers.circle.com/contracts/erc-1155-multi-token) * [NFT Template](https://developers.circle.com/contracts/erc-721-nft) ##### Paymaster * [Paymaster Overview](https://developers.circle.com/paymaster) * Quickstarts * References ##### Developer Services * [Supported Blockchains](https://developers.circle.com/w3s/supported-blockchains-and-currencies) * [Blockchain Confirmations](https://developers.circle.com/w3s/blockchain-confirmations) * [Chain ID for Signing Transactions](https://developers.circle.com/w3s/sign-tx-chain-id) * [API Keys](https://developers.circle.com/w3s/keys) * [Testnet vs. Mainnet](https://developers.circle.com/w3s/sandbox-vs-production) * [Testnet Faucets](https://developers.circle.com/w3s/developer-console-faucet) * [Circle Developer Account](https://developers.circle.com/w3s/circle-developer-account) * [Developer Account Logs](https://developers.circle.com/w3s/developer-account-logs) * [Manage Team Members](https://developers.circle.com/w3s/manage-team-members) * [Postman API Suite](https://developers.circle.com/w3s/postman) * [Idempotent Requests](https://developers.circle.com/w3s/idempotent-requests) * [Compliance Requirements](https://developers.circle.com/w3s/compliance-requirements) * [HTTP Errors](https://developers.circle.com/w3s/synchronous-errors) * [Transaction States and Errors](https://developers.circle.com/w3s/asynchronous-states-and-statuses) * [Glossary](https://developers.circle.com/w3s/programmable-wallets-primitives) On this page * [Deployment parameters](https://developers.circle.com/contracts/erc-721-nft#deployment-parameters) * [Template deployment parameters](https://developers.circle.com/contracts/erc-721-nft#template-deployment-parameters) * [Common functions](https://developers.circle.com/contracts/erc-721-nft#common-functions) * [approve \[write\]](https://developers.circle.com/contracts/erc-721-nft#approve-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/erc-721-nft#parameters) * [mintTo \[write\]](https://developers.circle.com/contracts/erc-721-nft#mintto-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/erc-721-nft#parameters-2) * [Returns](https://developers.circle.com/contracts/erc-721-nft#returns) * [Failure scenarios](https://developers.circle.com/contracts/erc-721-nft#failure-scenarios) * [safeTransferFrom \[write\]](https://developers.circle.com/contracts/erc-721-nft#safetransferfrom-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/erc-721-nft#parameters-3) * [Failure scenarios](https://developers.circle.com/contracts/erc-721-nft#failure-scenarios-2) * [setTokenURI \[write\]](https://developers.circle.com/contracts/erc-721-nft#settokenuri-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/erc-721-nft#parameters-4) * [Failure scenarios](https://developers.circle.com/contracts/erc-721-nft#failure-scenarios-3) * [ownerOf \[read\]](https://developers.circle.com/contracts/erc-721-nft#ownerof-%5Bread%5D) * [Parameters](https://developers.circle.com/contracts/erc-721-nft#parameters-5) * [Failure scenarios](https://developers.circle.com/contracts/erc-721-nft#failure-scenarios-4) * [Note](https://developers.circle.com/contracts/erc-721-nft#note) * [balanceOf \[read\]](https://developers.circle.com/contracts/erc-721-nft#balanceof-%5Bread%5D) * [Parameters](https://developers.circle.com/contracts/erc-721-nft#parameters-6) * [Failure scenarios](https://developers.circle.com/contracts/erc-721-nft#failure-scenarios-5) The NFT template is an audited, ready-to-deploy smart contract for creating and managing NFTs. It implements the ERC-721 standard, which is widely used for representing non-fungible tokens (NFTs) on a blockchain. Unlike ERC-20 tokens, which represent fungible and interchangeable assets, ERC-721 NFTs are unique and non-interchangeable, making them suitable for digital collectibles, gaming assets, and many other use cases. The ERC-721 NFT standard has gained significant popularity and has been implemented by numerous projects and platforms. Some key use cases for ERC-721 NFTs include: * **Digital collectibles:** ERC-721 NFTs are extensively used for creating and trading unique digital collectibles. These collectibles can represent various items such as artwork, trading cards, virtual pets, in-game assets, and more. * **Tokenized assets:** ERC-721 NFTs can represent ownership in real-world assets such as real estate, artwork, jewelry, and other physical assets. This enables fractional ownership, providing liquidity and opening up investment opportunities. * **Gaming assets:** ERC-721 NFTs are a perfect fit for representing in-game assets, enabling players to own, trade, and transfer virtual items securely and transparently. This functionality has facilitated the emergence of blockchain-based gaming ecosystems. In this comprehensive guide, you explore the NFT template, which provides all the necessary information to deploy and understand the contract’s common functions. [​](https://developers.circle.com/contracts/erc-721-nft#deployment-parameters) Deployment parameters ------------------------------------------------------------------------------------------------------- The NFT template creates a customized, fully compliant ERC-721 smart contract. To create a contract using this template, provide the following parameter values when deploying a smart contract template using the [`POST: /templates/{id}/deploy`](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template) API. **Template ID:** 76b83278-50e2-4006-8b63-5b1a2a814533 ### [​](https://developers.circle.com/contracts/erc-721-nft#template-deployment-parameters) Template deployment parameters | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `name` | String | X | Name of the contract - stored as a property of the contract on-chain. | | `symbol` | String | | Symbol of the token - stored onchain. The symbol is usually 3 or 4 characters in length. | | `defaultAdmin` | String | X | The address of the default admin. This address can execute permissioned functions on the contract. You will lose administrative access to the contract if this is not set to an address you control. | | `primarySaleRecipient` | String | X | The recipient address for first-time sales. | | `platformFeeRecipient` | String | | The recipient address for all sale fees. You can set this to your address if you are deploying a template on someone else’s behalf. | | `platformFeePercent` | Float | | The percentage of sales that go to the platform fee recipient. For example, set it as 0.1 if you want 10% of sales fees to go to _platformFeeRecipient_. | | `royaltyRecipient` | String | X | The recipient address for all royalties (secondary sales). This allows the contract creator to benefit from further sales of the contract token. | | `royaltyPercent` | Float | X | The percentage of secondary sales that go to the royalty recipient. For example, set it as 0.05 if you want royalties to be 5% of secondary sales value. | | `contractUri` | String | | The URL for the marketplace metadata of your contract. This is used on marketplaces like OpenSea. See [Contract-level Metadata](https://docs.opensea.io/docs/contract-level-metadata)
for more information. | | `trustedForwarders` | String\[\] | | A list of addresses that can forward ERC2771 meta-transactions to this contract. See [ethereum.org](https://eips.ethereum.org/EIPS/eip-2771)
for more information. | Here is an example of the `templateParameters` JSON object within the request body to [deploy a contract from a template](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template) for the ERC-721 NFT template. In this example, the `defaultAdmin`, `primarySaleRecipient`, and `royaltyRecipient` parameters are the same address but can be set distinctly based on your use case. JSON Report incorrect code Copy ... "templateParameters": { "name": "My NFT Contract", "defaultAdmin": "0x4F77E56dfA40990349e1078e97AC3Eb479e0dAc6", "primarySaleRecipient": "0x4F77E56dfA40990349e1078e97AC3Eb479e0dAc6", "royaltyRecipient": "0x4F77E56dfA40990349e1078e97AC3Eb479e0dAc6", "royaltyPercent": 0.05 } [​](https://developers.circle.com/contracts/erc-721-nft#common-functions) Common functions --------------------------------------------------------------------------------------------- This section lists the most commonly used functions on NFT template, their respective parameters and potential failure scenarios. These functions include: * [approve \[write\]](https://developers.circle.com/contracts/erc-721-nft#approve-write) * [mintTo \[write\]](https://developers.circle.com/contracts/erc-721-nft#mintto-write) * [safeTransferFrom \[write\]](https://developers.circle.com/contracts/erc-721-nft#safetransferfrom-write) * [setTokenURI \[write\]](https://developers.circle.com/contracts/erc-721-nft#settokenuri-write) * [ownerOf \[read\]](https://developers.circle.com/contracts/erc-721-nft#ownerof-read) * [balanceOf \[read\]](https://developers.circle.com/contracts/erc-721-nft#balanceof-address-owner-read) At this time, not all failure scenarios or error messages received from the blockchain are passed through Circle’s APIs. Instead, you will receive a generic [`ESTIMATION_ERROR`](https://developers.circle.com/w3s/asynchronous-states-and-statuses#transaction-errors) error. If available, the `errorDetails` field will have more information on the cause of failure. [​](https://developers.circle.com/contracts/erc-721-nft#approve-[write]) approve \[write\] --------------------------------------------------------------------------------------------- The approve function allows the owner of an ERC721 NFT to approve another address to transfer the token on their behalf. ### [​](https://developers.circle.com/contracts/erc-721-nft#parameters) Parameters | Parameter | Type | Description | | --- | --- | --- | | `to` | address | The address approved to transfer the token. | | `tokenId` | unit256 | The identifier of the token being approved for transfer. | **Failure Scenarios:** * If the _to_ address matches the current owner of the token (owner), the function will fail. This check ensures that the approval is not granted to the same owner, preventing unnecessary approvals. _“ERC721: approval to current owner”_ * The function requires that the caller `_msgSender` either be the token’s owner or have been approved for all by the owner. If this condition is not met, the function will fail. This validation prevents unauthorized users from approving transfers on behalf of the token owner. _“ERC721: approve caller is not token owner or approved for all”_ Solidity Report incorrect code Copy function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721Upgradeable.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner or approved for all" ); _approve(to, tokenId); } [​](https://developers.circle.com/contracts/erc-721-nft#mintto-[write]) mintTo \[write\] ------------------------------------------------------------------------------------------- The `mintTo` function is a function that mints a new NFT and assigns it to a specific address. This function can only be called by an address with the `MINTER_ROLE`. ### [​](https://developers.circle.com/contracts/erc-721-nft#parameters-2) Parameters | Parameter | Type | Description | | --- | --- | --- | | `to` | address | The address to which the minted NFT will be assigned. | | `uri` | string | The URI (Uniform Resource Identifier) of the newly minted NFT. | ### [​](https://developers.circle.com/contracts/erc-721-nft#returns) Returns | Parameter | | | | --- | --- | --- | | `tokenIdToMint` | uint256 | The unique identifier of the minted NFT. | ### [​](https://developers.circle.com/contracts/erc-721-nft#failure-scenarios) Failure scenarios * If the caller of the function does not have the `MINTER_ROLE` assigned, the function will fail and throw an exception. _“AccessControl: account ”, StringsUpgradeable.toHexString(account), ” is missing role ”, StringsUpgradeable.toHexString(uint256(role), 32)_ * The function checks if the length of the \_uri string is greater than 0, ensuring that the URI is not empty. _”empty uri.”_ * _The function checks that the to address is not the zero address._ _”ERC721: mint to the zero address”_ * The function checks that the `tokenId` has not already been created. _“ERC721: token already minted”_ Solidity Report incorrect code Copy function mintTo(address _to, string calldata _uri) external onlyRole(MINTER_ROLE) returns (uint256) { // `_mintTo` is re-used. `mintTo` just adds a minter role check. return _mintTo(_to, _uri); } function _mintTo(address _to, string calldata _uri) internal returns (uint256 tokenIdToMint) { tokenIdToMint = nextTokenIdToMint; nextTokenIdToMint += 1; require(bytes(_uri).length > 0, "empty uri."); _setTokenURI(tokenIdToMint, _uri); _safeMint(_to, tokenIdToMint); emit TokensMinted(_to, tokenIdToMint, _uri); } [​](https://developers.circle.com/contracts/erc-721-nft#safetransferfrom-[write]) safeTransferFrom \[write\] --------------------------------------------------------------------------------------------------------------- This function allows the transfer of an ERC721 NFT from the `from` address to the `to` address. It requires that the caller is the token owner or has been approved to transfer the token. ### [​](https://developers.circle.com/contracts/erc-721-nft#parameters-3) Parameters | Parameter | Type | Description | | --- | --- | --- | | `from` | address | The address that owns the token and wants to transfer it. | | `to` | address | The address that will receive ownership of the token. | | `tokenId` | unit256 | The unique identifier of the token being transferred. | ### [​](https://developers.circle.com/contracts/erc-721-nft#failure-scenarios-2) Failure scenarios * The `isApprovedOrOwner` function is called to check if the caller is the token owner or an approved address. This check ensures that the transfer can only be performed by the token owner or an approved address. _”ERC721: caller is not token owner or approved”_ * If the to address is a contract, the `checkOnERC721Received` function is called to check if the to address is a contract that implements the `onERC721Received` function correctly - according to the ERC721 standard. * It checks if the token being transferred `tokenId` parameter is owned by the `from` address parameter. _“ERC721: transfer from incorrect owner”_ * It checks that the `to` address parameter is not the zero address. If it is the zero address, the function throws an exception with the message. _”ERC721: transfer to the zero address”_ * If the transfer is restricted on the contract, it still allows burning and minting. It checks whether the `TRANSFER_ROLE` is assigned to either the `from` or `to` address. This ensures that token transfers comply with specific access control restrictions defined by the contract. _”restricted to TRANSFER\_ROLE holders”_ * The function will check if the `to` address is a contract. If it is, the `_checkOnERC721Received` hook will check if the receiver address properly handles the received token. I _”ERC721: transfer to non ERC721Receiver implementer”_ Solidity Report incorrect code Copy // safeTransferFrom function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override { safeTransferFrom(from, to, tokenId, ""); } // safeTransferFrom - with data parameter function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _safeTransfer(from, to, tokenId, data); } [​](https://developers.circle.com/contracts/erc-721-nft#settokenuri-[write]) setTokenURI \[write\] ----------------------------------------------------------------------------------------------------- This function is responsible for setting the metadata URI for a specific NFT token. ### [​](https://developers.circle.com/contracts/erc-721-nft#parameters-4) Parameters | Parameter | Type | Description | | --- | --- | --- | | `tokenId` | unit256 | The unique identifier of the NFT token for which the metadata URI is being set. | | `uri` | string | The new metadata URI that will be associated with the NFT token. | ### [​](https://developers.circle.com/contracts/erc-721-nft#failure-scenarios-3) Failure scenarios * The function checks if the caller is authorized to set the metadata URI. It calls the `canSetMetadata` function, which checks the authorization based on certain conditions specified in the contract. _”NFTMetadata: not authorized to set metadata.”_ * The function verifies if the metadata URI is not frozen. It checks the `uriFrozen` boolean flag to determine if the metadata is in a frozen state. If the metadata is frozen, meaning it cannot be changed, the function will throw an exception. _”NFTMetadata: metadata is frozen.”_ * If the provided URI is empty, the function will throw an exception with the message _”NFTMetadata: empty metadata.”_ Solidity Report incorrect code Copy function setTokenURI(uint256 _tokenId, string memory _uri) public virtual { require(_canSetMetadata(), "NFTMetadata: not authorized to set metadata."); require(!uriFrozen, "NFTMetadata: metadata is frozen."); _setTokenURI(_tokenId, _uri); } function _setTokenURI(uint256 _tokenId, string memory _uri) internal virtual { require(bytes(_uri).length > 0, "NFTMetadata: empty metadata."); _tokenURI[_tokenId] = _uri; emit MetadataUpdate(_tokenId); } [​](https://developers.circle.com/contracts/erc-721-nft#ownerof-[read]) ownerOf \[read\] ------------------------------------------------------------------------------------------- This function is used to retrieve the address of the owner of the ERC721 NFT with the specified `tokenId`. ### [​](https://developers.circle.com/contracts/erc-721-nft#parameters-5) Parameters | Parameter | Type | Description | | --- | --- | --- | | `tokenId` | unit256 | The unique identifier of the token for which the owner’s address is being fetched. | ### [​](https://developers.circle.com/contracts/erc-721-nft#failure-scenarios-4) Failure scenarios * The function checks if the owner’s address is not the zero address. This check is performed to ensure that a valid owner address is returned. _“ERC721: invalid token ID”_ ### [​](https://developers.circle.com/contracts/erc-721-nft#note) Note * The function does not revert if the token doesn’t exist. The zero address will be returned. Solidity Report incorrect code Copy function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); return owner; } [​](https://developers.circle.com/contracts/erc-721-nft#balanceof-[read]) balanceOf \[read\] ----------------------------------------------------------------------------------------------- This function retrieves the balance (number of tokens) owned by a specific owner address. ### [​](https://developers.circle.com/contracts/erc-721-nft#parameters-6) Parameters | Parameter | | | | --- | --- | --- | | `owner` | address | The address for which the token balance is being fetched. | ### [​](https://developers.circle.com/contracts/erc-721-nft#failure-scenarios-5) Failure scenarios * The function checks if the `owner` address is not the zero address. The zero address represents an invalid or nonexistent address. _“ERC721: address zero is not a valid owner”_ Solidity Report incorrect code Copy function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } Was this page helpful? YesNo [Multi-Token Template\ \ Previous](https://developers.circle.com/contracts/erc-1155-multi-token) [Paymaster\ \ Next](https://developers.circle.com/paymaster) ⌘I --- # Quickstart: Deploy an ERC-1155 Contract Template - Circle Docs [Skip to main content](https://developers.circle.com/contracts/deploy-smart-contract-template#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Quickstarts Quickstart: Deploy an ERC-1155 Contract Template [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools * [Overview](https://developers.circle.com/build-onchain) ##### Wallets * [Circle Wallets Overview](https://developers.circle.com/wallets) * Wallets Products * Concepts * Quickstarts * Tutorials * References ##### Contracts * [Circle Contracts Overview](https://developers.circle.com/contracts) * Concepts * Quickstarts * [Deploy a Smart Contract using Bytecode](https://developers.circle.com/contracts/scp-deploy-smart-contract) * [Deploy an ERC-1155 Contract Template](https://developers.circle.com/contracts/deploy-smart-contract-template) * [Interact With a Smart Contract](https://developers.circle.com/contracts/scp-interact-smart-contract) * [Event Monitoring for Smart Contracts](https://developers.circle.com/contracts/scp-event-monitoring) * References ##### Paymaster * [Paymaster Overview](https://developers.circle.com/paymaster) * Quickstarts * References ##### Developer Services * [Supported Blockchains](https://developers.circle.com/w3s/supported-blockchains-and-currencies) * [Blockchain Confirmations](https://developers.circle.com/w3s/blockchain-confirmations) * [Chain ID for Signing Transactions](https://developers.circle.com/w3s/sign-tx-chain-id) * [API Keys](https://developers.circle.com/w3s/keys) * [Testnet vs. Mainnet](https://developers.circle.com/w3s/sandbox-vs-production) * [Testnet Faucets](https://developers.circle.com/w3s/developer-console-faucet) * [Circle Developer Account](https://developers.circle.com/w3s/circle-developer-account) * [Developer Account Logs](https://developers.circle.com/w3s/developer-account-logs) * [Manage Team Members](https://developers.circle.com/w3s/manage-team-members) * [Postman API Suite](https://developers.circle.com/w3s/postman) * [Idempotent Requests](https://developers.circle.com/w3s/idempotent-requests) * [Compliance Requirements](https://developers.circle.com/w3s/compliance-requirements) * [HTTP Errors](https://developers.circle.com/w3s/synchronous-errors) * [Transaction States and Errors](https://developers.circle.com/w3s/asynchronous-states-and-statuses) * [Glossary](https://developers.circle.com/w3s/programmable-wallets-primitives) On this page * [Prerequisites](https://developers.circle.com/contracts/deploy-smart-contract-template#prerequisites) * [Evaluate templates](https://developers.circle.com/contracts/deploy-smart-contract-template#evaluate-templates) * [Console path](https://developers.circle.com/contracts/deploy-smart-contract-template#console-path) * [Step 1: Set up your Console Wallet](https://developers.circle.com/contracts/deploy-smart-contract-template#step-1%3A-set-up-your-console-wallet) * [Step 2: Deploy the smart contract](https://developers.circle.com/contracts/deploy-smart-contract-template#step-2%3A-deploy-the-smart-contract) * [Step 3: Mint a token](https://developers.circle.com/contracts/deploy-smart-contract-template#step-3%3A-mint-a-token) * [API path](https://developers.circle.com/contracts/deploy-smart-contract-template#api-path) * [Step 1: Set up your environment](https://developers.circle.com/contracts/deploy-smart-contract-template#step-1%3A-set-up-your-environment) * [1.1. Get your wallet information](https://developers.circle.com/contracts/deploy-smart-contract-template#1-1-get-your-wallet-information) * [1.2. Understand deployment parameters](https://developers.circle.com/contracts/deploy-smart-contract-template#1-2-understand-deployment-parameters) * [1.3. Template parameters](https://developers.circle.com/contracts/deploy-smart-contract-template#1-3-template-parameters) * [Step 2: Deploy the smart contract](https://developers.circle.com/contracts/deploy-smart-contract-template#step-2%3A-deploy-the-smart-contract-2) * [2.1. Check deployment status](https://developers.circle.com/contracts/deploy-smart-contract-template#2-1-check-deployment-status) * [Step 3: Mint a token](https://developers.circle.com/contracts/deploy-smart-contract-template#step-3%3A-mint-a-token-2) * [Summary](https://developers.circle.com/contracts/deploy-smart-contract-template#summary) * [Next steps](https://developers.circle.com/contracts/deploy-smart-contract-template#next-steps) This quickstart walks you through deploying an ERC-1155 Multi-Token contract using Contract Templates and minting your first token. Contract Templates make it easy to integrate smart contracts into your application without writing Solidity code. Deploy contracts in minutes using curated and audited templates that support popular onchain use cases. **Note:** This quickstart provides all the code you need to deploy an ERC-1155 contract and mint tokens. You can deploy using either the [Console](https://developers.circle.com/contracts/deploy-smart-contract-template#console-path) or [API](https://developers.circle.com/contracts/deploy-smart-contract-template#api-path) . [​](https://developers.circle.com/contracts/deploy-smart-contract-template#prerequisites) Prerequisites ---------------------------------------------------------------------------------------------------------- Before you begin, ensure you have: * A [Circle Developer Account](https://console.circle.com/) * For the API path: * An [API key](https://developers.circle.com/w3s/circle-developer-account) * A [dev-controlled wallet](https://developers.circle.com/wallets/dev-controlled/create-your-first-wallet) * Your [Entity Secret registered](https://developers.circle.com/wallets/dev-controlled/register-entity-secret) [​](https://developers.circle.com/contracts/deploy-smart-contract-template#evaluate-templates) Evaluate templates -------------------------------------------------------------------------------------------------------------------- To learn more about the ERC-1155 template or other templates, visit: * **[Console](https://console.circle.com/) :** View templates, their use cases, ABI functions, events, and code. * **[Templates Glossary](https://developers.circle.com/contracts/scp-templates-overview) :** Review all templates and their configuration options. ![](https://mintcdn.com/circle-167b8d39/D-mmMTaVnQhPM6l2/w3s/images/scp-console-templates02.png?w=2500&fit=max&auto=format&n=D-mmMTaVnQhPM6l2&q=85&s=1dfd484f17f3da7964a4e2957619a914) * * * [​](https://developers.circle.com/contracts/deploy-smart-contract-template#console-path) Console path -------------------------------------------------------------------------------------------------------- Use the Console and a Console Wallet to deploy a smart contract template and mint a token. This is the preferred method for those new to smart contracts. ### [​](https://developers.circle.com/contracts/deploy-smart-contract-template#step-1:-set-up-your-console-wallet) Step 1: Set up your Console Wallet Console Wallets are Smart Contract Accounts designed for use within the Console. They leverage [Gas Station](https://developers.circle.com/wallets/gas-station) , eliminating the need to maintain gas for transaction fees. If you don’t have a Console Wallet, you’ll be prompted to create one during deployment. **Console Wallet Deploy Cost:** Unlike EOAs, SCAs cost gas to deploy. With lazy deployment, you won’t pay the gas fee at wallet creation as it’s charged when you initiate your first outbound transaction. ### [​](https://developers.circle.com/contracts/deploy-smart-contract-template#step-2:-deploy-the-smart-contract) Step 2: Deploy the smart contract In the [Console](https://console.circle.com/) : 1. Navigate to the **Templates** tab. 2. Select **Multi-Token** ERC-1155. 3. Fill in the deployment parameters: | Parameter | Description | | --- | --- | | **Name** | The offchain name of the contract, only visible in Circle’s systems. Use `MyERC1155Contract`. | | **Contract Name** | The onchain name for the contract. Use `MyERC1155Contract`. | | **Default Admin** | The address with admin permissions to execute permissioned functions. Use your Console Wallet address. | | **Primary Sale Recipient** | The address that receives first-time sale proceeds. Use your Console Wallet address. | | **Royalty Recipient** | The address that receives royalties from secondary sales. Use your Console Wallet address. | | **Royalty Percent** | The royalty share as a decimal (for example, `0.05` for 5% of secondary sales). Use `0`. | | **Network** | The blockchain network to deploy onto. Select `Arc Testnet`. | | **Select Wallet** | The wallet to deploy the smart contract from. Select your Console Wallet. | | **Deployment Speed** | The fee level affecting transaction processing speed (FAST, AVERAGE, SLOW). Select `AVERAGE`. | 4. Select **Deploy**. **Console Wallet Creation:** After selecting a network, you’ll be prompted to create a Console Wallet. This wallet is automatically created on all available networks. On testnet, a [Gas Station Policy](https://developers.circle.com/wallets/gas-station/policy-management) is also created. ![](https://mintcdn.com/circle-167b8d39/D-mmMTaVnQhPM6l2/w3s/images/scp-derc1155-consolewallet02.png?w=2500&fit=max&auto=format&n=D-mmMTaVnQhPM6l2&q=85&s=78ed3b70bbfdcec1523bb946d48e1cb2) Once deployed, you’ll return to the **Contracts** dashboard. The deployment status will initially show **Pending**, then change to **Complete** after a few seconds. ![](https://mintcdn.com/circle-167b8d39/D-mmMTaVnQhPM6l2/w3s/images/scp-derc1155-consolecontracts02.png?w=2500&fit=max&auto=format&n=D-mmMTaVnQhPM6l2&q=85&s=a44b3fbf4a1d11352ad28e8790a23b33) ### [​](https://developers.circle.com/contracts/deploy-smart-contract-template#step-3:-mint-a-token) Step 3: Mint a token In the [Console](https://console.circle.com/) : 1. Navigate to the **Contracts** tab. 2. Select your **MyERC1155Contract**. 3. Select the **ABI Functions** tab → **Write** → **mintTo**. 4. Fill in the parameters: | Parameter | Description | | --- | --- | | **\_to** | The wallet address to receive the minted token. Use your Console Wallet address. | | **\_tokenId** | The token ID to mint, identifying the token type in ERC-1155. Use max uint256 (`115792089237316195423570985008687907853269984665640564039457584007913129639935`) to create token ID 0. For subsequent tokens, use `0` for ID 1, `1` for ID 2, etc. | | **\_uri** | The URI for the token metadata, such as an IPFS CID or CDN URL. | | **\_amount** | The quantity of tokens to mint. Use `1`. | 5. Select **Execute Function** → ensure your Console Wallet is selected → **Execute**. ![](https://mintcdn.com/circle-167b8d39/D-mmMTaVnQhPM6l2/w3s/images/scp-derc1155-consolemint03.png?w=2500&fit=max&auto=format&n=D-mmMTaVnQhPM6l2&q=85&s=204d8a464bf0350d3d54e3f5634bf959) Select **View Transaction History** to monitor the transaction. Once the state shows **Complete**, the token has been minted successfully. **Inbound Transaction:** You’ll also see an inbound transfer indicating the token was minted to your Console Wallet. * * * [​](https://developers.circle.com/contracts/deploy-smart-contract-template#api-path) API path ------------------------------------------------------------------------------------------------ Use APIs to deploy a smart contract template and mint a token programmatically. This option requires an API key and a Dev-Controlled Wallet. ### [​](https://developers.circle.com/contracts/deploy-smart-contract-template#step-1:-set-up-your-environment) Step 1: Set up your environment #### [​](https://developers.circle.com/contracts/deploy-smart-contract-template#1-1-get-your-wallet-information) 1.1. Get your wallet information Retrieve your wallet ID using the [`GET /wallets`](https://developers.circle.com/api-reference/wallets/developer-controlled-wallets/get-wallets) API. Ensure: * Wallet custody type is **Dev-Controlled** * Blockchain is **Arc Testnet** * Account type is **SCA** (recommended—removes need for gas) Note your wallet’s address for subsequent steps. #### [​](https://developers.circle.com/contracts/deploy-smart-contract-template#1-2-understand-deployment-parameters) 1.2. Understand deployment parameters | Parameter | Description | | --- | --- | | `idempotencyKey` | A unique value for request deduplication. | | `name` | The offchain contract name. Use `MyERC1155Contract`. | | `walletId` | The ID of the wallet deploying the contract. Use your dev-controlled wallet ID. | | `templateId` | The template identifier. Use `aea21da6-0aa2-4971-9a1a-5098842b1248` for ERC-1155. See [Templates](https://developers.circle.com/contracts/scp-templates-overview)
. | | `blockchain` | The network to deploy onto. Use `ARC-TESTNET`. | | `entitySecretCiphertext` | The re-encrypted entity secret. See [Entity Secret Management](https://developers.circle.com/wallets/dev-controlled/entity-secret-management)
. | | `feeLevel` | The fee level for transaction processing. Use `MEDIUM`. | | `templateParameters` | The onchain initialization parameters (see below). | #### [​](https://developers.circle.com/contracts/deploy-smart-contract-template#1-3-template-parameters) 1.3. Template parameters | Parameter | Description | | --- | --- | | `name` | The onchain contract name. Use `MyERC1155Contract`. | | `defaultAdmin` | The address with admin permissions. Use your Dev-Controlled Wallet address. | | `primarySaleRecipient` | The address for first-time sale proceeds. Use your Dev-Controlled Wallet address. | | `royaltyRecipient` | The address for secondary sale royalties. Use your Dev-Controlled Wallet address. | | `royaltyPercent` | The royalty share as a decimal (for example, `0.05` for 5%). Use `0`. | ### [​](https://developers.circle.com/contracts/deploy-smart-contract-template#step-2:-deploy-the-smart-contract-2) Step 2: Deploy the smart contract Deploy by making a request to [`POST /templates/{id}/deploy`](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template) : Node.js Python cURL Report incorrect code Copy import { initiateDeveloperControlledWalletsClient } from "@circle-fin/developer-controlled-wallets"; import { initiateSmartContractPlatformClient } from "@circle-fin/smart-contract-platform"; const circleDeveloperSdk = initiateDeveloperControlledWalletsClient({ apiKey: "", entitySecret: "", }); const circleContractSdk = initiateSmartContractPlatformClient({ apiKey: "", entitySecret: "", }); const response = await circleContractSdk.deployContractTemplate({ id: "aea21da6-0aa2-4971-9a1a-5098842b1248", blockchain: "ARC-TESTNET", name: "MyERC1155Contract", walletId: "", templateParameters: { name: "MyERC1155Contract", defaultAdmin: "", primarySaleRecipient: "", royaltyRecipient: "", royaltyPercent: 0, }, fee: { type: "level", config: { feeLevel: "MEDIUM", }, }, }); **Response:** Report incorrect code Copy { "data": { "contractIds": ["b7c35372-ce69-4ccd-bfaa-504c14634f0d"], "transactionId": "601a0815-f749-41d8-b193-22cadd2a8977" } } A successful response indicates deployment has been **initiated**, not completed. Use the `transactionId` to check status. #### [​](https://developers.circle.com/contracts/deploy-smart-contract-template#2-1-check-deployment-status) 2.1. Check deployment status Verify deployment with [`GET /transactions/{id}`](https://developers.circle.com/api-reference/wallets/developer-controlled-wallets/get-transaction) : Node.js Python cURL Report incorrect code Copy const response = await circleDeveloperSdk.getTransaction({ id: "601a0815-f749-41d8-b193-22cadd2a8977", }); **Response:** Report incorrect code Copy { "data": { "transaction": { "id": "601a0815-f749-41d8-b193-22cadd2a8977", "blockchain": "ARC-TESTNET", "state": "COMPLETE" } } } ### [​](https://developers.circle.com/contracts/deploy-smart-contract-template#step-3:-mint-a-token-2) Step 3: Mint a token Use the `mintTo` function to mint tokens. The wallet must have `MINTER_ROLE`. Node.js Python cURL Report incorrect code Copy const response = await circleDeveloperSdk.createContractExecutionTransaction({ walletId: "", abiFunctionSignature: "mintTo(address,uint256,string,uint256)", abiParameters: [\ "",\ "115792089237316195423570985008687907853269984665640564039457584007913129639935",\ "ipfs://bafkreibdi6623n3xpf7ymk62ckb4bo75o3qemwkpfvp5i25j66itxvsoei",\ "1",\ ], contractAddress: "", fee: { type: "level", config: { feeLevel: "MEDIUM", }, }, }); **Response:** Report incorrect code Copy { "data": { "id": "601a0815-f749-41d8-b193-22cadd2a8977", "state": "INITIATED" } } Check the transaction status using [`GET /transactions/{id}`](https://developers.circle.com/api-reference/wallets/developer-controlled-wallets/get-transaction) as shown above. * * * [​](https://developers.circle.com/contracts/deploy-smart-contract-template#summary) Summary ---------------------------------------------------------------------------------------------- After completing this quickstart, you’ve successfully: * Deployed an ERC-1155 Multi-Token contract on Arc Testnet * Minted your first token using either the Console or API [​](https://developers.circle.com/contracts/deploy-smart-contract-template#next-steps) Next steps ---------------------------------------------------------------------------------------------------- * Explore the [Templates Glossary](https://developers.circle.com/contracts/scp-templates-overview) for other contract templates * Learn about [Gas Station](https://developers.circle.com/wallets/gas-station) for sponsoring transactions * View your contract on the [Arc Testnet Explorer](https://testnet.arcscan.app/) Was this page helpful? YesNo [Quickstart: Deploy a Smart Contract using Bytecode\ \ Previous](https://developers.circle.com/contracts/scp-deploy-smart-contract) [Quickstart: Interact With a Smart Contract\ \ Next](https://developers.circle.com/contracts/scp-interact-smart-contract) ⌘I --- # Contracts Templates - Circle Docs [Skip to main content](https://developers.circle.com/contracts/scp-templates-overview#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Concepts Contracts Templates [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools * [Overview](https://developers.circle.com/build-onchain) ##### Wallets * [Circle Wallets Overview](https://developers.circle.com/wallets) * Wallets Products * Concepts * Quickstarts * Tutorials * References ##### Contracts * [Circle Contracts Overview](https://developers.circle.com/contracts) * Concepts * [Templates](https://developers.circle.com/contracts/scp-templates-overview) * Quickstarts * References ##### Paymaster * [Paymaster Overview](https://developers.circle.com/paymaster) * Quickstarts * References ##### Developer Services * [Supported Blockchains](https://developers.circle.com/w3s/supported-blockchains-and-currencies) * [Blockchain Confirmations](https://developers.circle.com/w3s/blockchain-confirmations) * [Chain ID for Signing Transactions](https://developers.circle.com/w3s/sign-tx-chain-id) * [API Keys](https://developers.circle.com/w3s/keys) * [Testnet vs. Mainnet](https://developers.circle.com/w3s/sandbox-vs-production) * [Testnet Faucets](https://developers.circle.com/w3s/developer-console-faucet) * [Circle Developer Account](https://developers.circle.com/w3s/circle-developer-account) * [Developer Account Logs](https://developers.circle.com/w3s/developer-account-logs) * [Manage Team Members](https://developers.circle.com/w3s/manage-team-members) * [Postman API Suite](https://developers.circle.com/w3s/postman) * [Idempotent Requests](https://developers.circle.com/w3s/idempotent-requests) * [Compliance Requirements](https://developers.circle.com/w3s/compliance-requirements) * [HTTP Errors](https://developers.circle.com/w3s/synchronous-errors) * [Transaction States and Errors](https://developers.circle.com/w3s/asynchronous-states-and-statuses) * [Glossary](https://developers.circle.com/w3s/programmable-wallets-primitives) On this page * [Available templates](https://developers.circle.com/contracts/scp-templates-overview#available-templates) * [Benefits of templates](https://developers.circle.com/contracts/scp-templates-overview#benefits-of-templates) * [Deploy a template](https://developers.circle.com/contracts/scp-templates-overview#deploy-a-template) Smart contract templates are audited contracts that you can deploy using the Contracts API. Each template uses a standard token format and has built-in access control. You can deploy contracts in minutes without writing Solidity code. [​](https://developers.circle.com/contracts/scp-templates-overview#available-templates) Available templates -------------------------------------------------------------------------------------------------------------- The table below lists all templates. Select a template to view its settings and functions. | Template | Standard | Template ID | Use cases | | --- | --- | --- | --- | | [Token](https://developers.circle.com/contracts/erc-20-token) | ERC-20 | `a1b74add-23e0-4712-88d1-6b3009e85a86` | Fungible tokens, loyalty points, governance tokens | | [NFT](https://developers.circle.com/contracts/erc-721-nft) | ERC-721 | `76b83278-50e2-4006-8b63-5b1a2a814533` | Digital collectibles, gaming assets, tokenized assets | | [Multi-Token](https://developers.circle.com/contracts/erc-1155-multi-token) | ERC-1155 | `aea21da6-0aa2-4971-9a1a-5098842b1248` | Mixed fungible and non-fungible tokens, batch transfers | | [Airdrop](https://developers.circle.com/contracts/airdrop) | N/A | `13e322f2-18dc-4f57-8eed-4bddfc50f85e` | Bulk token distribution to multiple recipients | [​](https://developers.circle.com/contracts/scp-templates-overview#benefits-of-templates) Benefits of templates ------------------------------------------------------------------------------------------------------------------ Using templates instead of custom contracts has several benefits: * **Security**: Third-party firms audit each template. This lowers the risk of common exploits. * **Lower gas costs**: Templates use patterns that reduce transaction fees for you and your users. * **Standard compliance**: Templates follow ERC standards. This ensures they work with wallets, marketplaces, and other blockchain tools. * **Faster deployment**: Deploy contracts in minutes. [​](https://developers.circle.com/contracts/scp-templates-overview#deploy-a-template) Deploy a template ---------------------------------------------------------------------------------------------------------- To deploy a template, send a `POST` request to the [`/templates/{id}/deploy`](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template) endpoint with the template ID and your settings. For a full guide, see [Deploy a smart contract](https://developers.circle.com/contracts/scp-deploy-smart-contract) . Was this page helpful? YesNo [Contracts\ \ Previous](https://developers.circle.com/contracts) [Quickstart: Deploy a Smart Contract using Bytecode\ \ Next](https://developers.circle.com/contracts/scp-deploy-smart-contract) ⌘I --- # Multi-Token Template - Circle Docs [Skip to main content](https://developers.circle.com/contracts/erc-1155-multi-token#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation References Multi-Token Template [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools * [Overview](https://developers.circle.com/build-onchain) ##### Wallets * [Circle Wallets Overview](https://developers.circle.com/wallets) * Wallets Products * Concepts * Quickstarts * Tutorials * References ##### Contracts * [Circle Contracts Overview](https://developers.circle.com/contracts) * Concepts * Quickstarts * References * [Supported Blockchains](https://developers.circle.com/contracts/supported-blockchains) * [Airdrop Template](https://developers.circle.com/contracts/airdrop) * [Token Template](https://developers.circle.com/contracts/erc-20-token) * [Multi-Token Template](https://developers.circle.com/contracts/erc-1155-multi-token) * [NFT Template](https://developers.circle.com/contracts/erc-721-nft) ##### Paymaster * [Paymaster Overview](https://developers.circle.com/paymaster) * Quickstarts * References ##### Developer Services * [Supported Blockchains](https://developers.circle.com/w3s/supported-blockchains-and-currencies) * [Blockchain Confirmations](https://developers.circle.com/w3s/blockchain-confirmations) * [Chain ID for Signing Transactions](https://developers.circle.com/w3s/sign-tx-chain-id) * [API Keys](https://developers.circle.com/w3s/keys) * [Testnet vs. Mainnet](https://developers.circle.com/w3s/sandbox-vs-production) * [Testnet Faucets](https://developers.circle.com/w3s/developer-console-faucet) * [Circle Developer Account](https://developers.circle.com/w3s/circle-developer-account) * [Developer Account Logs](https://developers.circle.com/w3s/developer-account-logs) * [Manage Team Members](https://developers.circle.com/w3s/manage-team-members) * [Postman API Suite](https://developers.circle.com/w3s/postman) * [Idempotent Requests](https://developers.circle.com/w3s/idempotent-requests) * [Compliance Requirements](https://developers.circle.com/w3s/compliance-requirements) * [HTTP Errors](https://developers.circle.com/w3s/synchronous-errors) * [Transaction States and Errors](https://developers.circle.com/w3s/asynchronous-states-and-statuses) * [Glossary](https://developers.circle.com/w3s/programmable-wallets-primitives) On this page * [Deployment parameters](https://developers.circle.com/contracts/erc-1155-multi-token#deployment-parameters) * [Template deployment parameters](https://developers.circle.com/contracts/erc-1155-multi-token#template-deployment-parameters) * [Common functions](https://developers.circle.com/contracts/erc-1155-multi-token#common-functions) * [mintTo \[write\]](https://developers.circle.com/contracts/erc-1155-multi-token#mintto-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/erc-1155-multi-token#parameters) * [Failure scenarios](https://developers.circle.com/contracts/erc-1155-multi-token#failure-scenarios) * [Notes](https://developers.circle.com/contracts/erc-1155-multi-token#notes) * [safeTransferFrom \[write\]](https://developers.circle.com/contracts/erc-1155-multi-token#safetransferfrom-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/erc-1155-multi-token#parameters-2) * [Failure scenarios](https://developers.circle.com/contracts/erc-1155-multi-token#failure-scenarios-2) * [setApprovalForAll \[write\]](https://developers.circle.com/contracts/erc-1155-multi-token#setapprovalforall-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/erc-1155-multi-token#parameters-3) * [Failure scenarios](https://developers.circle.com/contracts/erc-1155-multi-token#failure-scenarios-3) * [Notes](https://developers.circle.com/contracts/erc-1155-multi-token#notes-2) * [setTokenURI \[write\]](https://developers.circle.com/contracts/erc-1155-multi-token#settokenuri-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/erc-1155-multi-token#parameters-4) * [Failure scenarios](https://developers.circle.com/contracts/erc-1155-multi-token#failure-scenarios-4) * [burn \[write\]](https://developers.circle.com/contracts/erc-1155-multi-token#burn-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/erc-1155-multi-token#parameters-5) * [Failure scenarios](https://developers.circle.com/contracts/erc-1155-multi-token#failure-scenarios-5) * [safeBatchTransferFrom \[write\]](https://developers.circle.com/contracts/erc-1155-multi-token#safebatchtransferfrom-%5Bwrite%5D) * [Parameters](https://developers.circle.com/contracts/erc-1155-multi-token#parameters-6) * [Failure scenarios](https://developers.circle.com/contracts/erc-1155-multi-token#failure-scenarios-6) * [balanceOfBatch \[read\]](https://developers.circle.com/contracts/erc-1155-multi-token#balanceofbatch-%5Bread%5D) * [Parameters](https://developers.circle.com/contracts/erc-1155-multi-token#parameters-7) * [Failure scenarios](https://developers.circle.com/contracts/erc-1155-multi-token#failure-scenarios-7) * [balanceOf \[read\]](https://developers.circle.com/contracts/erc-1155-multi-token#balanceof-%5Bread%5D) * [Parameters](https://developers.circle.com/contracts/erc-1155-multi-token#parameters-8) * [Failure scenarios](https://developers.circle.com/contracts/erc-1155-multi-token#failure-scenarios-8) * [uri \[read\]](https://developers.circle.com/contracts/erc-1155-multi-token#uri-%5Bread%5D) * [Parameters](https://developers.circle.com/contracts/erc-1155-multi-token#parameters-9) * [Public Variables](https://developers.circle.com/contracts/erc-1155-multi-token#public-variables) * [nextTokenIdToMint \[read\]](https://developers.circle.com/contracts/erc-1155-multi-token#nexttokenidtomint-%5Bread%5D) The Multi-Token template is an audited, ready-to-deploy smart contract for the ERC-1155 multi-token standard. ERC-1155 is a versatile token standard that allows for creating and managing multiple types of tokens within a single smart contract. Unlike other token standards, like ERC-20 and ERC-721, ERC-1155 supports fungible and non-fungible tokens, providing flexibility for various use cases. The ERC-1155 standard enables the creation of tokens representing different types of assets, such as digital collectibles, in-game items, unique artwork, and more, all within the same contract. This reduces the need to deploy separate contracts for different token types, improving efficiency and reducing costs. Some use cases of the standard include: * **Gaming assets:** With ERC-1155, developers can create game assets that can be fungible or non-fungible. For example, fungible ERC-1155 tokens can represent in-game currencies, while non-fungible ERC-1155 tokens can represent unique weapons, characters, or virtual land. * **Digital collectibles:** Similar to ERC-721, ERC-1155 can be used to create and trade digital collectibles. However, ERC-1155 offers additional flexibility, allowing for the creation of fungible and non-fungible tokens under the same contract. This enables the creation of collections with varying levels of scarcity and uniqueness. * **Tokenized real-world assets:** ERC-1155 tokens can also represent ownership of real-world assets such as real estate or shares in a company. By combining fungible and non-fungible tokens, ERC-1155 offers a more efficient solution for fractional ownership of assets. * **Batch operations:** One of the significant advantages of ERC-1155 is the ability to perform batch operations. Developers can transfer multiple tokens in a single transaction, making it more cost-efficient and reducing gas fees. In this comprehensive guide, you explore the Multi-Token template, which provides all the necessary information to deploy and understand the contract’s common functions. [​](https://developers.circle.com/contracts/erc-1155-multi-token#deployment-parameters) Deployment parameters ---------------------------------------------------------------------------------------------------------------- The Multi-Token template creates a smart contract representing and controlling any number of token types. These tokens can of the ERC-20, ERC-721 or any other standard. To create a contract using this template, provide the following parameter values when deploying a smart contract template using the [`POST: /templates/{id}/deploy`](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template) API. **Template ID:** aea21da6-0aa2-4971-9a1a-5098842b1248 ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#template-deployment-parameters) Template deployment parameters | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `name` | String | X | Name of the contract - stored on-chain. | | `symbol` | String | | Symbol of the token - stored onchain. The symbol is usually 3 or 4 characters in length. | | `defaultAdmin` | String | X | The address of the default admin. This address can execute permissioned functions on the contract. | | `primarySaleRecipient` | String | X | The recipient address for first-time sales. | | `platformFeeRecipient` | String | | The recipient address for all sale fees. | | `platformFeePercent` | Float | | The percentage of sales that go to the platform fee recipient. For example, set it as 0.1 if you want 10% of sales fees to go to platformFeeRecipient. | | `royaltyRecipient` | String | X | The recipient address for all royalties (secondary sales). This allows the contract creator to benefit from further sales of the contract token. | | `royaltyPercent` | Float | X | The percentage of secondary sales that go to the royalty recipient. For example, set it as 0.05 if you want royalties to be 5% of secondary sales. | | `contractUri` | String | | The URL for the marketplace metadata of your contract. | | `trustedForwarders` | String\[\] | | A list of addresses that can forward ERC2771 meta-transactions to this contract. | Here is an example of the `templateParameters`JSON object within the request body to [deploy a contract from a template](https://developers.circle.com/api-reference/contracts/smart-contract-platform/deploy-contract-template) for the ERC-1155 Multi-Token template. In this example, the `defaultAdmin`, `primarySaleRecipient`, and `royaltyRecipient` parameters are the same address but can be set distinctly based on your use case. JSON Report incorrect code Copy ... "templateParameters": {   "name": "My Multi-Token Contract",   "defaultAdmin": "0x4F77E56dfA40990349e1078e97AC3Eb479e0dAc6",   "primarySaleRecipient": "0x4F77E56dfA40990349e1078e97AC3Eb479e0dAc6",   "royaltyRecipient": "0x4F77E56dfA40990349e1078e97AC3Eb479e0dAc6",   "royaltyPercent": 0.05 } [​](https://developers.circle.com/contracts/erc-1155-multi-token#common-functions) Common functions ------------------------------------------------------------------------------------------------------ This section lists the most commonly used functions on the Multi-Token template, along with their respective parameters and potential failure scenarios. These functions include: * [mintTo \[write\]](https://developers.circle.com/contracts/erc-1155-multi-token#mintto-write) * [safeTransferFrom \[write\]](https://developers.circle.com/contracts/erc-1155-multi-token#safetransferfrom-write) * [setApprovalForAll \[write\]](https://developers.circle.com/contracts/erc-1155-multi-token#setapprovalforall-write) * [setTokenURI \[write\]](https://developers.circle.com/contracts/erc-1155-multi-token#settokenuri-write) * [burn \[write\]](https://developers.circle.com/contracts/erc-1155-multi-token#burn-write) * [safeBatchTransferFrom \[write\]](https://developers.circle.com/contracts/erc-1155-multi-token#safebatchtransferfrom-write) * [balanceOfBatch \[read\]](https://developers.circle.com/contracts/erc-1155-multi-token#balanceofbatch-read) * [balanceOf \[read\]](https://developers.circle.com/contracts/erc-1155-multi-token#balanceof-read) * [nextTokenIdToMint \[read\]](https://developers.circle.com/contracts/erc-1155-multi-token#nexttokenidtomint-read) * [uri \[read\]](https://developers.circle.com/contracts/erc-1155-multi-token#uri-read) At this time, not all failure scenarios or error messages received from the blockchain are passed through Circle’s APIs. Instead, you will receive a generic [`ESTIMATION_ERROR`](https://developers.circle.com/w3s/asynchronous-states-and-statuses#transaction-errors) error. If available, the `errorDetails` field will have more information on the cause of failure. [​](https://developers.circle.com/contracts/erc-1155-multi-token#mintto-[write]) mintTo \[write\] ---------------------------------------------------------------------------------------------------- The `mintTo` function allows you to create new NFTs or increase the supply of existing NFTs. It is a flexible function that can cater to both scenarios. ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#parameters) Parameters | Parameter | Type | Description | | --- | --- | --- | | `_to` | address | The address to which the newly minted NFT will be assigned. | | `_tokenId` | unit256 | The unique identifier for the NFT. If the value is set to `type(uint256).max`, the function will assign the next available token ID. Otherwise, it will assign the provided `_tokenId` value. | | `_uri` | calldata | The Uniform Resource Identifier (URI) for the NFT’s metadata. It specifies the location from where the metadata can be retrieved. | | `_amount` | unit256 | The amount of the newly minted NFTs to be assigned. | ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#failure-scenarios) Failure scenarios * **Insufficient Role:** The `mintTo` function is defined with the `onlyRole(MINTER\_ROLE)` modifier, meaning only addresses with the `MINTER\_ROLE` can call this function. The function will revert and fail if the caller does not have the necessary role. * **Token ID Overflow:** If the `_tokenId` parameter is set to `type(uint256).max` (the maximum value for a uint256), the function will attempt to create a new token and assign the next available token ID. However, an overflow can occur if the `nextTokenIdToMint` variable has reached its maximum value. This overflow condition will cause the function to fail. * **Invalid Token ID:** If the `_tokenId` parameter is not set to `type(uint256).max`, the function will attempt to mint an NFT with the specified token ID. However, if the provided `_tokenId` value is greater than or equal to the value of `nextTokenIdToMint`, the function will revert and fail with the following error message. _”invalid id”_ * **Existing Token ID with Non-Empty URI:** When `_tokenId` is provided and already exists, the function checks whether the associated metadata URI for that token ID is empty. If the URI is not empty, the token has already been minted and has an associated URI. In this case, the function will fail and revert, preventing the same token ID from being minted multiple times. * **Minting to Zero Address:** The function checks whether the `_to` address is the zero address `address(0)`. Minting tokens to the zero address is prohibited, as it represents an invalid or non-existent address. If `_to` is the zero address, the function will fail and revert with the following error message. _”ERC1155: mint to the zero address”_ * **Rejection by ERC1155Receiver Contract:** If the recipient address `_to` is a contract, the function will attempt to call the `onERC1155Received` function of that contract to check if the contract supports receiving the NFT. If the contract’s `onERC1155Received` function rejects the transfer by returning a value other than `IERC1155ReceiverUpgradeable.onERC1155Received.selector`, the function will revert and fail with the following error message. \_ “ERC1155: ERC1155Receiver rejected tokens”\_ ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#notes) Notes * **Creating New NFTs:** When you pass `type(uint256).max` via the `_tokenId` parameter, the function will create a new NFT with `_tokenId` equal to `nextTokenIdToMint` and assign it to the specified `_to` address. The `_uri` parameter allows you to provide the metadata URI for the newly created NFT. The `amount` parameter allows you to specify how many instances of this NFT with the given ID should be minted. * **Increasing Supply of Existing NFTs:** If you pass an existing token ID via the `tokenId` parameter, the function will increase the supply of that specific NFT. Instead of creating a new token ID, the function will mint additional instances of the existing NFT, adding to the current supply. Again, the `_amount` parameter determines how many additional instances of the NFT should be minted. Solidity Report incorrect code Copy // Lets an account with MINTER_ROLE mint an NFT. function mintTo( address _to, uint256 _tokenId, string calldata _uri, uint256 _amount ) external onlyRole(MINTER_ROLE) { uint256 tokenIdToMint; if (_tokenId == type(uint256).max) { tokenIdToMint = nextTokenIdToMint; nextTokenIdToMint += 1; } else { require(_tokenId < nextTokenIdToMint, "invalid id"); tokenIdToMint = _tokenId; } // `_mintTo` is re-used. `mintTo` just adds a minter role check. _mintTo(_to, _uri, tokenIdToMint, _amount); } [​](https://developers.circle.com/contracts/erc-1155-multi-token#safetransferfrom-[write]) safeTransferFrom \[write\] ------------------------------------------------------------------------------------------------------------------------ The `safeTransferFrom` function allows for transferring a specified amount of a particular token ID from one address `from` to another address `to`. ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#parameters-2) Parameters | Parameter | Type | Description | | --- | --- | --- | | `from` | address | The address of the current token owner, from whom the tokens will be transferred. | | `to` | address | The address of the recipient who will receive the transferred tokens. | | `id` | uint256 | The unique identifier for transferring the token. | | `amount` | uint256 | The amount of tokens being transferred. This represents the number of tokens to be transferred. | | `data` | bytes | Optional additional data to pass to the receiver contract if it is a contract. This can include custom arguments or instructions for the receiving contract. | ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#failure-scenarios-2) Failure scenarios * **Transfer to Zero Address:** The function verifies if the to address is the zero address `address(0)`. Transfers to the zero address are not permitted, as it represents an invalid or non-existent address. If the `to` address is the zero address, the function fails and reverts with the following error message. _”ERC1155: transfer to the zero address”_ * **Insufficient Balance:** The function checks if the from address has a sufficient balance of the specified token ID (id) to perform the transfer. If the balance exceeds the specified amount, the function fails and reverts to the following error message. _”ERC1155: insufficient balance for transfer”_ * **Caller Not Authorized:** The function verifies if the caller of the `_msgSender()` function is either the owner of the tokens (`from`) or has been approved as an operator for `from`. If the caller is neither the token owner nor an approved operator, the function fails and reverts with the following error message. _”ERC1155: caller is not token owner or approved”_ * **Before/After Token Transfer Hooks:** The function calls the `_beforeTokenTransfer` and `_afterTokenTransfer` hooks to update any necessary state or perform additional checks. These hooks may contain custom business logic that can cause the transfer to fail if certain conditions are not met. * **ERC1155Receiver Contract Rejection:** If the `to` address is a contract, the function attempts to call the `onERC1155Received` function of that contract to check if the contract supports receiving the tokens. If the contract’s `onERC1155Received` function rejects the transfer by returning a value other than `IERC1155ReceiverUpgradeable.onERC1155Received.selector`, the function fails and reverts with the following error message. _”ERC1155: ERC1155Receiver rejected tokens”_ Solidity Report incorrect code Copy // See IERC1155-safeTransferFrom. function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" ); _safeTransferFrom(from, to, id, amount, data); } [​](https://developers.circle.com/contracts/erc-1155-multi-token#setapprovalforall-[write]) setApprovalForAll \[write\] -------------------------------------------------------------------------------------------------------------------------- The `setApprovalForAll` function is used to set the approval status for an operator to manage all tokens of the caller (owner) on their behalf. ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#parameters-3) Parameters | Parameter | Type | Description | | --- | --- | --- | | `operator` | address | The operator’s address for whom the approval status is set. The operator will be able to manage all tokens owned by the caller. | | `approved` | bool | The boolean value indicates whether the operator is approved (true) or disapproved (false) to manage all tokens on behalf of the caller. | ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#failure-scenarios-3) Failure scenarios * The function requires that the caller (owner) cannot set the approval status for themselves. If the operator address provided is the same as the owner address, the function will fail with the given following error message. _”ERC1155: setting approval status for self”_ ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#notes-2) Notes * Once an operator is approved using the `setApprovalForAll` function, they can act on behalf of the token owner. This includes performing actions such as transferring tokens. Solidity Report incorrect code Copy // See {IERC1155-setApprovalForAll}. function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } // Approve `operator` to operate on all of `owner` tokens // Emits an {ApprovalForAll} event. function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { require(owner != operator, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } [​](https://developers.circle.com/contracts/erc-1155-multi-token#settokenuri-[write]) setTokenURI \[write\] -------------------------------------------------------------------------------------------------------------- The `setTokenURI` function is used to set the metadata URI for a given NFT. ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#parameters-4) Parameters | Parameter | Type | Description | | --- | --- | --- | | `tokenId` | unit256 | The unique identifier of the NFT for which the metadata URI needs to be set. | | `uri` | string | The URI string represents the metadata’s location associated with the NFT. | ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#failure-scenarios-4) Failure scenarios * The function requires the metadata URI to have a length greater than zero. This error occurs when the input parameter `_uri` is an empty string. \_“NFTMetadata: empty metadata” \_ * This error occurs if the `_canSetMetadata()` function returns false. It indicates that the caller has no authority or permission to set the metadata for the given NFT. _”NFTMetadata: not authorized to set metadata”_ * This error occurs when `uriFrozen` is true, indicating that the metadata is frozen and cannot be updated. _”NFTMetadata: metadata is frozen”_ Solidity Report incorrect code Copy // Sets the metadata URI for a given NFT. function setTokenURI(uint256 _tokenId, string memory _uri) public virtual { require(_canSetMetadata(), "NFTMetadata: not authorized to set metadata."); require(!uriFrozen, "NFTMetadata: metadata is frozen."); _setTokenURI(_tokenId, _uri); } // Sets the metadata URI for a given NFT. function _setTokenURI(uint256 _tokenId, string memory _uri) internal virtual { require(bytes(_uri).length > 0, "NFTMetadata: empty metadata."); _tokenURI[_tokenId] = _uri; emit MetadataUpdate(_tokenId); } [​](https://developers.circle.com/contracts/erc-1155-multi-token#burn-[write]) burn \[write\] ------------------------------------------------------------------------------------------------ This function allows a token owner to burn a specified amount (value) of tokens they own. ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#parameters-5) Parameters | Parameter | Type | Description | | --- | --- | --- | | `account` | address | The address of the token owner who wants to burn their tokens. | | `id` | unit256 | The unique identifier of the token to be burned. | | `value` | unit256 | The amount of tokens to be burned. | ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#failure-scenarios-5) Failure scenarios * This error occurs when the caller of the burn function is neither the owner of the tokens nor approved to burn them. The caller must either be the account that owns the tokens or have approval from the owner to burn the tokens. \_“ERC1155: caller is not owner nor approved” \_ * The function checks that the burning amount does not exceed the available balance. This error occurs if the amount of tokens specified to be burned (`amount`) is greater than the balance of tokens (`fromBalance`) owned by the specified account. _”ERC1155: burn amount exceeds balance”_ * This error occurs if the from address (the address from which the tokens are being burned) is the zero address (0x000…). This address is generally reserved as an invalid or non-existent address and cannot be used for token burning. _”ERC1155: burn from the zero address”_ Solidity Report incorrect code Copy // Lets a token owner burn the tokens they own (i.e. destroy for good) function burn(address account, uint256 id, uint256 value) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved." ); _burn(account, id, value); } [​](https://developers.circle.com/contracts/erc-1155-multi-token#safebatchtransferfrom-[write]) safeBatchTransferFrom \[write\] ---------------------------------------------------------------------------------------------------------------------------------- This function enables the safe transfer of multiple ERC1155 tokens from one address (`from`) to another address (`to`) in a batch. ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#parameters-6) Parameters | Parameter | Type | Description | | --- | --- | --- | | `from` | address | The address from which the tokens are transferred. | | `to` | address | The address to which the tokens are transferred. | | `ids` | uint256\[\] | An array of unique identifiers of the tokens to be transferred. | | `amounts` | uint256\[\] | An array specifying the corresponding amounts of tokens to be transferred for each ID. | | `data` | bytes | Additional data to pass along with the transfer. Optional parameter. | ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#failure-scenarios-6) Failure scenarios * This error occurs if the caller of the function is neither the token owner nor approved to perform the transfer. The caller must either be the from address or have approval from the from address to transfer the tokens. _”ERC1155: caller is not token owner or approved”_ * This error occurs if the lengths of the `ids` and amounts arrays do not match. Each ID should have a corresponding amount to be transferred. The arrays should have the same length. _”ERC1155: ids and amounts length mismatch”_ * This error occurs if the `to` address is the zero address (0x000…). Transferring tokens to the zero address is not allowed as it is generally used to represent an invalid or non-existent address. _”ERC1155: transfer to the zero address”_ * This error occurs if the from address does not have a sufficient balance of tokens to transfer. The function checks that the from address has enough tokens of each ID to fulfill the transfer. _”ERC1155: insufficient balance for transfer”_ * This error occurs if the to address is a contract and the contract does not implement the `onERC1155BatchReceived` function from the `IERC1155ReceiverUpgradeable` interface or if the function returns a value other than `onERC1155BatchReceived.selector`. This check ensures that the receiving contract can handle the transferred tokens properly. _”ERC1155: ERC1155Receiver rejected tokens”_ Solidity Report incorrect code Copy // IERC1155-safeBatchTransferFrom function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } [​](https://developers.circle.com/contracts/erc-1155-multi-token#balanceofbatch-[read]) balanceOfBatch \[read\] ------------------------------------------------------------------------------------------------------------------ The `balanceOfBatch` function retrieves the balances of multiple accounts for multiple token IDs in a single function call. ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#parameters-7) Parameters | Parameter | Type | Description | | --- | --- | --- | | `accounts` | address\[\] | An array of addresses representing the accounts to query the balances for. | | `ids` | unit256\[\] | An array of unique identifiers of the tokens to query the balances for. | ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#failure-scenarios-7) Failure scenarios * **Mismatched Array Lengths:** The function requires that the length of the accounts array is equal to the length of the `ids` array. If this condition is not met, it will throw a required exception with the following error message. _”ERC1155: accounts and ids length mismatch”_ Solidity Report incorrect code Copy // IERC1155-balanceOfBatch // Requirements: // `accounts` and `ids` must have the same length. function balanceOfBatch( address[] memory accounts, uint256[] memory ids ) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } [​](https://developers.circle.com/contracts/erc-1155-multi-token#balanceof-[read]) balanceOf \[read\] -------------------------------------------------------------------------------------------------------- The `balanceOf` function retrieves the balance of a specific account for a particular token ID. ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#parameters-8) Parameters | Parameter | Type | Description | | --- | --- | --- | | `account` | address | The EVM address for which the balance is being queried. | | `id` | unit256 | The unique token identifier for which the balance is being queried. | ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#failure-scenarios-8) Failure scenarios * **Zero Address:** The function requires that the account parameter is not set to the zero address `address(0)`. If this condition is not met, it will throw a required exception with the following error message. _”ERC1155: address zero is not a valid owner”._ Solidity Report incorrect code Copy // See IERC1155-balanceOf // Requirements: // account cannot be the zero address. function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: address zero is not a valid owner"); return _balances[id][account]; } [​](https://developers.circle.com/contracts/erc-1155-multi-token#uri-[read]) uri \[read\] -------------------------------------------------------------------------------------------- The URI function retrieves the associated URI with a specific token ID. This URI provides a way to access metadata and additional information about the token. ### [​](https://developers.circle.com/contracts/erc-1155-multi-token#parameters-9) Parameters | Parameter | Type | Description | | --- | --- | --- | | `tokenId` | unit256 | This is the unique token identifier for retrieving the URI. | Solidity Report incorrect code Copy // Returns the URI for a tokenId function uri(uint256 _tokenId) public view override returns (string memory) { return _tokenURI[_tokenId]; } [​](https://developers.circle.com/contracts/erc-1155-multi-token#public-variables) Public Variables ------------------------------------------------------------------------------------------------------ Public variables are accessible from within the contract and can be accessed from external contracts. Solidity automatically generates a getter function for public state variables. [​](https://developers.circle.com/contracts/erc-1155-multi-token#nexttokenidtomint-[read]) nextTokenIdToMint \[read\] ------------------------------------------------------------------------------------------------------------------------ The `nextTokenIdToMint` variable is a public constant on the smart contract. An unsigned integer (uint256) represents the next token ID minted or created when `type(uint256).max` is passed to the `mintTo` function. Solidity Report incorrect code Copy // The next token ID of the NFT to mint. uint256 public nextTokenIdToMint; Was this page helpful? YesNo [Token Template\ \ Previous](https://developers.circle.com/contracts/erc-20-token) [NFT Template\ \ Next](https://developers.circle.com/contracts/erc-721-nft) ⌘I --- # Circle Contracts Supported Blockchains - Circle Docs [Skip to main content](https://developers.circle.com/contracts/supported-blockchains#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation References Circle Contracts Supported Blockchains [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools * [Overview](https://developers.circle.com/build-onchain) ##### Wallets * [Circle Wallets Overview](https://developers.circle.com/wallets) * Wallets Products * Concepts * Quickstarts * Tutorials * References ##### Contracts * [Circle Contracts Overview](https://developers.circle.com/contracts) * Concepts * Quickstarts * References * [Supported Blockchains](https://developers.circle.com/contracts/supported-blockchains) * [Airdrop Template](https://developers.circle.com/contracts/airdrop) * [Token Template](https://developers.circle.com/contracts/erc-20-token) * [Multi-Token Template](https://developers.circle.com/contracts/erc-1155-multi-token) * [NFT Template](https://developers.circle.com/contracts/erc-721-nft) ##### Paymaster * [Paymaster Overview](https://developers.circle.com/paymaster) * Quickstarts * References ##### Developer Services * [Supported Blockchains](https://developers.circle.com/w3s/supported-blockchains-and-currencies) * [Blockchain Confirmations](https://developers.circle.com/w3s/blockchain-confirmations) * [Chain ID for Signing Transactions](https://developers.circle.com/w3s/sign-tx-chain-id) * [API Keys](https://developers.circle.com/w3s/keys) * [Testnet vs. Mainnet](https://developers.circle.com/w3s/sandbox-vs-production) * [Testnet Faucets](https://developers.circle.com/w3s/developer-console-faucet) * [Circle Developer Account](https://developers.circle.com/w3s/circle-developer-account) * [Developer Account Logs](https://developers.circle.com/w3s/developer-account-logs) * [Manage Team Members](https://developers.circle.com/w3s/manage-team-members) * [Postman API Suite](https://developers.circle.com/w3s/postman) * [Idempotent Requests](https://developers.circle.com/w3s/idempotent-requests) * [Compliance Requirements](https://developers.circle.com/w3s/compliance-requirements) * [HTTP Errors](https://developers.circle.com/w3s/synchronous-errors) * [Transaction States and Errors](https://developers.circle.com/w3s/asynchronous-states-and-statuses) * [Glossary](https://developers.circle.com/w3s/programmable-wallets-primitives) Circle Contracts is available on the following blockchains: | Mainnet | Testnet | | --- | --- | | Arbitrum | Arbitrum Sepolia | | \- | Arc Testnet | | Avalanche | Avalanche Fuji | | Base | Base Sepolia | | Ethereum | Ethereum Sepolia | | Monad | Monad Testnet | | OP Mainnet | OP Sepolia | | Polygon PoS | Polygon PoS Amoy | | Unichain | Unichain Sepolia | Was this page helpful? YesNo [Quickstart: Event Monitoring for Smart Contracts\ \ Previous](https://developers.circle.com/contracts/scp-event-monitoring) [Airdrop Template\ \ Next](https://developers.circle.com/contracts/airdrop) ⌘I --- # Getting Started with the Contracts Python SDK - Circle Docs [Skip to main content](https://developers.circle.com/sdks/contracts-python-sdk#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Contracts Getting Started with the Contracts Python SDK [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools * [SDKs](https://developers.circle.com/sdks) * [Server-side SDK Pydantic v2 Upgrade](https://developers.circle.com/sdks/pydantic-v2-upgrade) ##### Developer-Controlled Wallets * [Node.js SDK](https://developers.circle.com/sdks/developer-controlled-wallets-nodejs-sdk) * [Python SDK](https://developers.circle.com/sdks/developer-controlled-wallets-python-sdk) ##### User-Controlled Wallets * [Node.js SDK](https://developers.circle.com/sdks/user-controlled-wallets-nodejs-sdk) * [Python SDK](https://developers.circle.com/sdks/user-controlled-wallets-python-sdk) ##### Contracts * [Node.js SDK](https://developers.circle.com/sdks/contracts-nodejs-sdk) * [Python SDK](https://developers.circle.com/sdks/contracts-python-sdk) On this page * [Prerequisites](https://developers.circle.com/sdks/contracts-python-sdk#prerequisites) * [Install the SDK](https://developers.circle.com/sdks/contracts-python-sdk#install-the-sdk) * [Contracts client](https://developers.circle.com/sdks/contracts-python-sdk#contracts-client) * [Import the client](https://developers.circle.com/sdks/contracts-python-sdk#import-the-client) * [Import a smart contract](https://developers.circle.com/sdks/contracts-python-sdk#import-a-smart-contract) * [Client configuration options](https://developers.circle.com/sdks/contracts-python-sdk#client-configuration-options) Use the Python SDK to interact with Contracts APIs, which allow you interact with smart contracts on the blockchain using the Developer Services platform. This page provides short examples of how to install and use the Smart Contract Platform SDK. For complete examples, see the [Sample Projects](https://developers.circle.com/sample-projects) page. For more information see the [Contracts documentation](https://developers.circle.com/contracts) . **Pydantic v2 upgrade**Starting from major version 9, the Python SDK uses Pydantic v2. This change brings performance improvements, enhanced features, and bug fixes.If you are already using the SDK, and choose to upgrade to major version 9, you may need to make some changes to your code.For more information, see [Server-side SDK Pydantic v2 Upgrade](https://developers.circle.com/sdks/pydantic-v2-upgrade) . [​](https://developers.circle.com/sdks/contracts-python-sdk#prerequisites) Prerequisites ------------------------------------------------------------------------------------------- * Have Python installed. * Have an active [Circle Developer Account](https://console.circle.com/) . * [Generate an API key](https://developers.circle.com/w3s/keys) to use in requests to the Circle API. * [Generate an entity secret](https://developers.circle.com/wallets/dev-controlled/register-entity-secret) to use in requests with the Contracts SDK. Although not a requirement for using the SDK, Circle recommends that you [use a virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/) for development. A Python virtual environment is an isolated environment that you can use to silo your project from the global Python environment. [​](https://developers.circle.com/sdks/contracts-python-sdk#install-the-sdk) Install the SDK ----------------------------------------------------------------------------------------------- Use the following command to install the SDK with [pip](https://pypi.org/project/pip/) : Report incorrect code Copy pip install circle-smart-contract-platform [​](https://developers.circle.com/sdks/contracts-python-sdk#contracts-client) Contracts client ------------------------------------------------------------------------------------------------- To start using the SDK, you first need to configure a client and initialize it with your API key and entity secret. ### [​](https://developers.circle.com/sdks/contracts-python-sdk#import-the-client) Import the client The following example shows how to import the client and configure it to use your API key and entity secret: Report incorrect code Copy from circle.web3 import utils client = utils.init_smart_contract_platform_client( api_key="Your API KEY", entity_secret="Your entity secret" ) ### [​](https://developers.circle.com/sdks/contracts-python-sdk#import-a-smart-contract) Import a smart contract The following example shows how to import a smart contract using the client: Report incorrect code Copy from circle.web3 import smart_contract_platform api_instance = smart_contract_platform.DeployImportApi(client) # import contract try: request = smart_contract_platform.ImportContractRequest.from_dict({ "name": "UChildERC20Proxy", "address": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", "blockchain": "MATIC" }) response = api_instance.import_contract(request) print(response) except smart_contract_platform.ApiException as e: print("Exception when calling DeployImportApi->import_contract: %s\n" % e) [​](https://developers.circle.com/sdks/contracts-python-sdk#client-configuration-options) Client configuration options ------------------------------------------------------------------------------------------------------------------------- The client for the Contracts SDK accepts the following configuration parameters: | **Option** | **Required?** | **Description** | | --- | --- | --- | | `api_key` | Yes | The API key used to authenticate requests to the Circle API. | | `entity_secret` | Yes | Your configured entity secret. | | `host` | No | The base URL that overrides the default API URL of `https://api.circle.com/v1/w3s`. | | `user_agent` | No | Custom user agent request header. If provided, it’s added before the default user agent header. | Was this page helpful? YesNo [Getting Started with the Contracts Node.js SDK\ \ Previous](https://developers.circle.com/sdks/contracts-nodejs-sdk) ⌘I --- # Quickstart: Deploy a Smart Contract using Bytecode - Circle Docs [Skip to main content](https://developers.circle.com/contracts/scp-deploy-smart-contract#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Quickstarts Quickstart: Deploy a Smart Contract using Bytecode [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools * [Overview](https://developers.circle.com/build-onchain) ##### Wallets * [Circle Wallets Overview](https://developers.circle.com/wallets) * Wallets Products * Concepts * Quickstarts * Tutorials * References ##### Contracts * [Circle Contracts Overview](https://developers.circle.com/contracts) * Concepts * Quickstarts * [Deploy a Smart Contract using Bytecode](https://developers.circle.com/contracts/scp-deploy-smart-contract) * [Deploy an ERC-1155 Contract Template](https://developers.circle.com/contracts/deploy-smart-contract-template) * [Interact With a Smart Contract](https://developers.circle.com/contracts/scp-interact-smart-contract) * [Event Monitoring for Smart Contracts](https://developers.circle.com/contracts/scp-event-monitoring) * References ##### Paymaster * [Paymaster Overview](https://developers.circle.com/paymaster) * Quickstarts * References ##### Developer Services * [Supported Blockchains](https://developers.circle.com/w3s/supported-blockchains-and-currencies) * [Blockchain Confirmations](https://developers.circle.com/w3s/blockchain-confirmations) * [Chain ID for Signing Transactions](https://developers.circle.com/w3s/sign-tx-chain-id) * [API Keys](https://developers.circle.com/w3s/keys) * [Testnet vs. Mainnet](https://developers.circle.com/w3s/sandbox-vs-production) * [Testnet Faucets](https://developers.circle.com/w3s/developer-console-faucet) * [Circle Developer Account](https://developers.circle.com/w3s/circle-developer-account) * [Developer Account Logs](https://developers.circle.com/w3s/developer-account-logs) * [Manage Team Members](https://developers.circle.com/w3s/manage-team-members) * [Postman API Suite](https://developers.circle.com/w3s/postman) * [Idempotent Requests](https://developers.circle.com/w3s/idempotent-requests) * [Compliance Requirements](https://developers.circle.com/w3s/compliance-requirements) * [HTTP Errors](https://developers.circle.com/w3s/synchronous-errors) * [Transaction States and Errors](https://developers.circle.com/w3s/asynchronous-states-and-statuses) * [Glossary](https://developers.circle.com/w3s/programmable-wallets-primitives) On this page * [Prerequisites](https://developers.circle.com/contracts/scp-deploy-smart-contract#prerequisites) * [Step 1: Project setup](https://developers.circle.com/contracts/scp-deploy-smart-contract#step-1%3A-project-setup) * [1.1 Set up a new project](https://developers.circle.com/contracts/scp-deploy-smart-contract#1-1-set-up-a-new-project) * [1.2 Install dependencies](https://developers.circle.com/contracts/scp-deploy-smart-contract#1-2-install-dependencies) * [Step 2: Create a wallet and fund it with testnet tokens](https://developers.circle.com/contracts/scp-deploy-smart-contract#step-2%3A-create-a-wallet-and-fund-it-with-testnet-tokens) * [2.1 Setup and run a create-wallet script](https://developers.circle.com/contracts/scp-deploy-smart-contract#2-1-setup-and-run-a-create-wallet-script) * [2.3 Fund the wallet with test USDC](https://developers.circle.com/contracts/scp-deploy-smart-contract#2-3-fund-the-wallet-with-test-usdc) * [2.4 Check the wallet’s balance](https://developers.circle.com/contracts/scp-deploy-smart-contract#2-4-check-the-wallet%E2%80%99s-balance) * [Step 3: Compile a smart contract](https://developers.circle.com/contracts/scp-deploy-smart-contract#step-3%3A-compile-a-smart-contract) * [3.1 Obtain ABI and bytecode from Remix IDE](https://developers.circle.com/contracts/scp-deploy-smart-contract#3-1-obtain-abi-and-bytecode-from-remix-ide) * [Step 4: Deploy the smart contract](https://developers.circle.com/contracts/scp-deploy-smart-contract#step-4%3A-deploy-the-smart-contract) This quickstart walks you through deploying a smart contract using the compiled bytecode and ABI using Circle Contracts. Circle Contracts provides an API for deploying, exploring, and interacting with smart contracts. The platform offers a powerful toolset for developers to build decentralized applications and for businesses to transition onchain. This guide can also be followed to deploy smart contracts on the other [supported blockchains](https://developers.circle.com/contracts/supported-blockchains) by changing the `blockchain` parameter in your request. Additionally, you can deploy to Mainnet by swapping out the Testnet API key for a Mainnet API key. See the [Testnet vs Mainnet](https://developers.circle.com/w3s/sandbox-vs-production) guide for more details. [​](https://developers.circle.com/contracts/scp-deploy-smart-contract#prerequisites) **Prerequisites** --------------------------------------------------------------------------------------------------------- Before you begin, ensure that you: 1. Create a [Developer Account and acquire an API key](https://developers.circle.com/w3s/circle-developer-account) in the Console. 2. Make sure to [register your Entity Secret](https://developers.circle.com/wallets/dev-controlled/register-entity-secret) prior to this Quickstart. [​](https://developers.circle.com/contracts/scp-deploy-smart-contract#step-1:-project-setup) **Step 1: Project setup** ------------------------------------------------------------------------------------------------------------------------- Set up your local development environment and install the required dependencies. ### [​](https://developers.circle.com/contracts/scp-deploy-smart-contract#1-1-set-up-a-new-project) 1.1 Set up a new project Create a new directory, navigate to it and initialize a new project with default settings NodeJS Python Report incorrect code Copy mkdir scp-bytecode-deploy cd scp-bytecode-deploy npm init -y npm pkg set type=module ### [​](https://developers.circle.com/contracts/scp-deploy-smart-contract#1-2-install-dependencies) 1.2 Install dependencies In the project directory, install the required dependencies. This guide uses SDKs for Circle [developer-controlled wallets](https://developers.circle.com/wallets/dev-controlled/create-your-first-wallet) and [Contracts](https://developers.circle.com/contracts) . NodeJS Python Report incorrect code Copy npm install @circle-fin/developer-controlled-wallets @circle-fin/smart-contract-platform [​](https://developers.circle.com/contracts/scp-deploy-smart-contract#step-2:-create-a-wallet-and-fund-it-with-testnet-tokens) Step 2: Create a wallet and fund it with testnet tokens ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- In this section, you will create a developer-controlled wallet with the SDK and fund it with testnet USDC to pay for the gas fees needed to deploy the smart contract. If you already have a developer-controlled wallet, skip to [Step 3](https://developers.circle.com/contracts/scp-deploy-smart-contract#step-3:-compile-a-smart-contract) . ### [​](https://developers.circle.com/contracts/scp-deploy-smart-contract#2-1-setup-and-run-a-create-wallet-script) 2.1 Setup and run a create-wallet script Import the developer-controlled wallets SDK and initialize the client. You will require your API key and Entity Secret for this. Note that your API key and Entity Secret are sensitive credentials. Do not commit them to Git or share them publicly. Store them securely in environment variables or a secrets manager. Developer-controlled wallets are created in a wallet set, which is the source from which individual wallet keys are derived. NodeJS Python Report incorrect code Copy import { initiateDeveloperControlledWalletsClient } from "@circle-fin/developer-controlled-wallets"; const client = initiateDeveloperControlledWalletsClient({ apiKey: "", entitySecret: "", }); // Create a wallet set const walletSetResponse = await client.createWalletSet({ name: "WalletSet 1", }); console.log("Created WalletSet", walletSetResponse.data?.walletSet); // Create a wallet on Arc Testnet const walletsResponse = await client.createWallets({ blockchains: ["ARC-TESTNET"], count: 1, walletSetId: walletSetResponse.data?.walletSet?.id ?? "", }); console.log("Created Wallets", walletsResponse.data?.wallets); If you are not using the developer-controlled wallets SDK, you can call the API directly as well. You will need to make 2 requests, one to create the wallet set and one to create the wallet. Make sure to replace the [Entity Secret ciphertext](https://developers.circle.com/wallets/dev-controlled/entity-secret-management#what-is-an-entity-secret-ciphertext) and idempotency key. Report incorrect code Copy curl --request POST \ --url https://api.circle.com/v1/w3s/developer/walletSets \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "entitySecretCiphertext": "", "idempotencyKey": "", "name": "WalletSet 1" } ' The wallet set ID is required for creating the wallet. Report incorrect code Copy curl --request POST \ --url https://api.circle.com/v1/w3s/developer/wallets \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "idempotencyKey": "", "blockchains": [\ "ARC-TESTNET"\ ], "entitySecretCiphertext": "", "walletSetId": "", "accountType": "EOA", "count": 1, ] } ' You should end up with a new developer-controlled wallet, and the response will look something like this: Report incorrect code Copy [\ {\ "id": "a2f67c91-b7e3-5df4-9c8e-42bbd51a9fcb",\ "state": "LIVE",\ "walletSetId": "5c3e9f20-8d4b-55a1-a63b-c21f44de8a72",\ "custodyType": "DEVELOPER",\ "refId": "",\ "name": "",\ "address": "0x9eab451f27dca39bd3f5d76ef28c86cc0b3a72df",\ "blockchain": "ARC-TESTNET",\ "accountType": "EOA",\ "updateDate": "2025-11-07T01:35:03Z",\ "createDate": "2025-11-07T01:35:03Z"\ }\ ] ### [​](https://developers.circle.com/contracts/scp-deploy-smart-contract#2-3-fund-the-wallet-with-test-usdc) 2.3 Fund the wallet with test USDC Obtain some testnet USDC for executing transactions like making transfers and paying gas fees for those transactions. Circle’s [Testnet Faucet](https://faucet.circle.com/) provides testnet USDC and can be used once per hour to obtain additional USDC. ### [​](https://developers.circle.com/contracts/scp-deploy-smart-contract#2-4-check-the-wallet%E2%80%99s-balance) 2.4 Check the wallet’s balance You can check your wallet’s balance from the [Developer Console](https://console.circle.com/wallets/dev/wallets) or programmatically by making a request to [`GET /wallets/{id}/balances`](https://developers.circle.com/api-reference/wallets/developer-controlled-wallets/list-wallet-balance) with the wallet ID of the wallet you created. NodeJS Python cURL Report incorrect code Copy const response = await client.getWalletTokenBalance({ id: "", }); [​](https://developers.circle.com/contracts/scp-deploy-smart-contract#step-3:-compile-a-smart-contract) **Step 3: Compile a smart contract** ----------------------------------------------------------------------------------------------------------------------------------------------- In this section, you will compile and deploy a minimal smart contract for an onchain payment inbox using Contracts. Users pay by approving and depositing USDC, payments are recorded via events, and the owner can withdraw the accumulated balance. This contract is intentionally minimal and for learning purposes only. Smart contracts that manage real funds typically require additional security patterns, testing, and audits, and often rely on community-reviewed libraries such as [OpenZeppelin](https://www.openzeppelin.com/) . Report incorrect code Copy // SPDX-License-Identifier: MIT pragma solidity ^0.8.20; interface IERC20 { function transfer(address to, uint256 amount) external returns (bool); function transferFrom(address from, address to, uint256 amount) external returns (bool); function balanceOf(address account) external view returns (uint256); } contract MerchantTreasuryUSDC { address public immutable owner; IERC20 public immutable usdc; event PaymentReceived(address indexed sender, uint256 amount); event FundsWithdrawn(address indexed to, uint256 amount); constructor(address _owner, address _usdc) { require(_owner != address(0), "Invalid owner"); require(_usdc != address(0), "Invalid USDC"); owner = _owner; usdc = IERC20(_usdc); } function deposit(uint256 amount) external { require(amount > 0, "Invalid amount"); bool ok = usdc.transferFrom(msg.sender, address(this), amount); require(ok, "USDC transferFrom failed"); emit PaymentReceived(msg.sender, amount); } function withdraw() external { require(msg.sender == owner, "Unauthorized"); uint256 amount = usdc.balanceOf(address(this)); require(amount > 0, "No funds"); bool ok = usdc.transfer(owner, amount); require(ok, "USDC transfer failed"); emit FundsWithdrawn(owner, amount); } function balance() external view returns (uint256) { return usdc.balanceOf(address(this)); } } * `constructor(address _owner)`: Sets the treasury owner and the USDC token address at deployment * `receive() (payable)`: Transfers approved USDC from the caller into the contract and emits `PaymentReceived(sender, amount)` * `withdraw()`: Allows only the owner to withdraw the entire USDC balance; emits `FundsWithdrawn(to, amount)` * `balance() (view)`: Returns the contract’s current USDC balance ### [​](https://developers.circle.com/contracts/scp-deploy-smart-contract#3-1-obtain-abi-and-bytecode-from-remix-ide) 3.1 Obtain ABI and bytecode from Remix IDE 1. Open the [Remix IDE](https://remix.ethereum.org/) . 2. Create a new file in the contracts folder called `MerchantTreasury.sol`. ![](https://mintcdn.com/circle-167b8d39/3iKZ5_wALbhuoLEF/w3s/images/scp-remix.png?w=2500&fit=max&auto=format&n=3iKZ5_wALbhuoLEF&q=85&s=73cbfbf5d7ba94fa45ee1284b150768a) 3. Copy and paste the Solidity code into the file, then click on the Compile button. ![](https://mintcdn.com/circle-167b8d39/3iKZ5_wALbhuoLEF/w3s/images/scp-remix2.png?w=2500&fit=max&auto=format&n=3iKZ5_wALbhuoLEF&q=85&s=527028c9b375c02620796a8f34e55a69) 4. Navigate to the Solidity Compiler tab from the left sidebar. Under Contracts, make sure MerchantTreasuryUSDC (Merchant Treasury.sol) is selected. You should see the option to copy the ABI and Bytecode. These values will be used in the next step. ![](https://mintcdn.com/circle-167b8d39/3iKZ5_wALbhuoLEF/w3s/images/scp-remix3.png?w=2500&fit=max&auto=format&n=3iKZ5_wALbhuoLEF&q=85&s=fc31e1eee52cdefa49b7b7b62733078c) 1. The compiler output is available under Compilation Details. For more information on the Solidity compiler’s outputs, see [using the compiler](https://docs.soliditylang.org/en/stable/using-the-compiler.html) . 2. The Application Binary Interface (ABI) is the standard way to interact with contracts on an EVM from outside the blockchain and for contract-to-contract interaction. [​](https://developers.circle.com/contracts/scp-deploy-smart-contract#step-4:-deploy-the-smart-contract) Step 4: Deploy the smart contract --------------------------------------------------------------------------------------------------------------------------------------------- In this section, you will deploy the smart contract on Arc using the contract’s ABI and bytecode, which you have compiled in the previous step. Import and initialize the Contracts SDK, then copy the ABI JSON and raw bytecode over from Remix. Note that you need to append `0x` to the raw bytecode. The `constructorParameters` correspond to the arguments encoded in the contract’s deployment bytecode. Since different contracts define different constructors, these parameters vary based on the specific contract you deployed. For this specific example, the parameter is the wallet address of the owner of the contract. NodeJS Python cURL Report incorrect code Copy import { initiateSmartContractPlatformClient } from "@circle-fin/smart-contract-platform"; const client = initiateSmartContractPlatformClient({ apiKey: "", entitySecret: "", }); const abiJson = PASTE_YOUR_ABI_JSON_HERE; const bytecode = "0xPASTE_YOUR_BYTECODE_HERE"; const response = await client.deployContract({ name: "MerchantTreasury Contract", description: "Contract to receive payments and allow an owner to withdraw funds", blockchain: "ARC-TESTNET", walletId: "", abiJson: JSON.stringify(abiJson, null, 2), bytecode: bytecode, constructorParameters: [\ "", // Initial owner of the contract\ "0x3600000000000000000000000000000000000000", // USDC contract address on Arc Testnet\ ], fee: { type: "level", config: { feeLevel: "MEDIUM", }, }, }); console.log(response.data); After running the script successfully, you should receive a response object that looks like this: Report incorrect code Copy { contractId: 'xxxxxxxx-xxxx-7xxx-8xxx-xxxxxxxxxxxx', transactionId: 'xxxxxxxx-xxxx-5xxx-axxx-xxxxxxxxxxxx' } You can check the status of the deployment from the [Developer Console](https://console.circle.com/smart-contracts/contracts) or run `getContract` from the SDK directly. NodeJS Python cURL Report incorrect code Copy const response = await circleContractSdk.getContract({ id: "", }); Once your contract is deployed, you will be able to interact with it from your application and mint new NFTs with it. You should be able to see it from the console and on the [Arc Testnet Explorer](https://testnet.arcscan.app/) . Was this page helpful? YesNo [Contracts Templates\ \ Previous](https://developers.circle.com/contracts/scp-templates-overview) [Quickstart: Deploy an ERC-1155 Contract Template\ \ Next](https://developers.circle.com/contracts/deploy-smart-contract-template) ⌘I --- # Quickstart: Interact With a Smart Contract - Circle Docs [Skip to main content](https://developers.circle.com/contracts/scp-interact-smart-contract#content-area) [Circle Docs home page![light logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/light.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=2b9bcc9c0c73f64bc6c1a8d3ce1739d8)![dark logo](https://mintcdn.com/circle-167b8d39/0trqHUiFee3uaBGZ/logo/dark.svg?fit=max&auto=format&n=0trqHUiFee3uaBGZ&q=85&s=a8247f00843a27f22fe54ddc5d0f235c)](https://developers.circle.com/) Search... ⌘K Search... Navigation Quickstarts Quickstart: Interact With a Smart Contract [Get Started](https://developers.circle.com/) [Assets](https://developers.circle.com/assets) [Build Onchain](https://developers.circle.com/build-onchain) [Crosschain Transfers](https://developers.circle.com/crosschain-transfers) [Payments](https://developers.circle.com/payments) [Mint & FX](https://developers.circle.com/mint-and-fx) [API Reference](https://developers.circle.com/api-reference/wallets/common/ping) Developer Tools * [Overview](https://developers.circle.com/build-onchain) ##### Wallets * [Circle Wallets Overview](https://developers.circle.com/wallets) * Wallets Products * Concepts * Quickstarts * Tutorials * References ##### Contracts * [Circle Contracts Overview](https://developers.circle.com/contracts) * Concepts * Quickstarts * [Deploy a Smart Contract using Bytecode](https://developers.circle.com/contracts/scp-deploy-smart-contract) * [Deploy an ERC-1155 Contract Template](https://developers.circle.com/contracts/deploy-smart-contract-template) * [Interact With a Smart Contract](https://developers.circle.com/contracts/scp-interact-smart-contract) * [Event Monitoring for Smart Contracts](https://developers.circle.com/contracts/scp-event-monitoring) * References ##### Paymaster * [Paymaster Overview](https://developers.circle.com/paymaster) * Quickstarts * References ##### Developer Services * [Supported Blockchains](https://developers.circle.com/w3s/supported-blockchains-and-currencies) * [Blockchain Confirmations](https://developers.circle.com/w3s/blockchain-confirmations) * [Chain ID for Signing Transactions](https://developers.circle.com/w3s/sign-tx-chain-id) * [API Keys](https://developers.circle.com/w3s/keys) * [Testnet vs. Mainnet](https://developers.circle.com/w3s/sandbox-vs-production) * [Testnet Faucets](https://developers.circle.com/w3s/developer-console-faucet) * [Circle Developer Account](https://developers.circle.com/w3s/circle-developer-account) * [Developer Account Logs](https://developers.circle.com/w3s/developer-account-logs) * [Manage Team Members](https://developers.circle.com/w3s/manage-team-members) * [Postman API Suite](https://developers.circle.com/w3s/postman) * [Idempotent Requests](https://developers.circle.com/w3s/idempotent-requests) * [Compliance Requirements](https://developers.circle.com/w3s/compliance-requirements) * [HTTP Errors](https://developers.circle.com/w3s/synchronous-errors) * [Transaction States and Errors](https://developers.circle.com/w3s/asynchronous-states-and-statuses) * [Glossary](https://developers.circle.com/w3s/programmable-wallets-primitives) On this page * [1\. Retrieve the Smart Contract’s Functions](https://developers.circle.com/contracts/scp-interact-smart-contract#1-retrieve-the-smart-contract%E2%80%99s-functions) * [2\. Contract Query Function](https://developers.circle.com/contracts/scp-interact-smart-contract#2-contract-query-function) * [3\. Contract Execution Function](https://developers.circle.com/contracts/scp-interact-smart-contract#3-contract-execution-function) In this guide, we will interact with a deployed smart contract using APIs. If you haven’t deployed a smart contract, follow the [deploy a smart contract](https://developers.circle.com/contracts/scp-deploy-smart-contract) tutorial. [​](https://developers.circle.com/contracts/scp-interact-smart-contract#1-retrieve-the-smart-contract%E2%80%99s-functions) 1\. Retrieve the Smart Contract’s Functions ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- To fetch the new Contract object, make a `GET /contracts/{id}` request that includes the `contractId` object returned from your deployment request. The `functions` property returned in the successful request contains a list of all of the functions on the contract: Node.js SDK Python SDK cURL Report incorrect code Copy // Import and configure the developer-controlled wallet SDK const { initiateDeveloperControlledWalletsClient, } = require("@circle-fin/developer-controlled-wallets"); const circleDeveloperSdk = initiateDeveloperControlledWalletsClient({ apiKey: "", entitySecret: "", }); // Import and configure the smart contract SDK const { initiateSmartContractPlatformClient, } = require("@circle-fin/smart-contract-platform"); const circleContractSdk = initiateSmartContractPlatformClient({ apiKey: "", entitySecret: "", }); const response = await circleContractSdk.getContract({ id: "0189db84-72b7-7fcc-832b-5bf886b9a0ef", }); JSON Report incorrect code Copy { "data": { "contract": { "id": "0189db84-72b7-7fcc-832b-5bf886b9a0ef", "entityId": "dcfa8149-98d8-4ed4-91fb-de7f3627b384", "deploymentTransactionId": "4f5bfa38-c598-56a6-932e-8b5bbd3d5fc9", "name": "First Contract Name", "description": "First Contract Description", "contractInputType": "BYTECODE", "createDate": "2023-08-09T18:17:17Z", "updateDate": "2023-08-09T18:17:17Z", "archived": false, "contractAddress": "0x1e124d7384cd34448ea5907bd0052a79355ab5eb", "blockchain": "MATIC-AMOY", "status": "COMPLETE", "deployerAddress": "0x1bf9ad0cc2ad298c69a2995aa806ee832788218c", "txHash": "0x241c4df6f08f9ed2b569c9f9b1cc48fb6074ffffaeee7552e716ce059161a743", "abiJson": "[\n\t{\n\t\t\"inputs\": [],\n\t\t\"stateMutability\": \"nonpayable\",\n\t\t\"type\": \"constructor\"\n\t},\n\t{\n\t\t\"anonymous\": false,\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"indexed\": true,\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"owner\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"indexed\": true,\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"approved\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"indexed\": true,\n\t\t\t\t\"internalType\": \"uint256\",\n\t\t\t\t\"name\": \"tokenId\",\n\t\t\t\t\"type\": \"uint256\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"Approval\",\n\t\t\"type\": \"event\"\n\t},\n\t{\n\t\t\"anonymous\": false,\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"indexed\": true,\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"owner\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"indexed\": true,\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"operator\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"indexed\": false,\n\t\t\t\t\"internalType\": \"bool\",\n\t\t\t\t\"name\": \"approved\",\n\t\t\t\t\"type\": \"bool\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"ApprovalForAll\",\n\t\t\"type\": \"event\"\n\t},\n\t{\n\t\t\"anonymous\": false,\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"indexed\": true,\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"previousOwner\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"indexed\": true,\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"newOwner\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"OwnershipTransferred\",\n\t\t\"type\": \"event\"\n\t},\n\t{\n\t\t\"anonymous\": false,\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"indexed\": true,\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"from\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"indexed\": true,\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"to\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"indexed\": true,\n\t\t\t\t\"internalType\": \"uint256\",\n\t\t\t\t\"name\": \"tokenId\",\n\t\t\t\t\"type\": \"uint256\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"Transfer\",\n\t\t\"type\": \"event\"\n\t},\n\t{\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"to\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"internalType\": \"uint256\",\n\t\t\t\t\"name\": \"tokenId\",\n\t\t\t\t\"type\": \"uint256\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"approve\",\n\t\t\"outputs\": [],\n\t\t\"stateMutability\": \"nonpayable\",\n\t\t\"type\": \"function\"\n\t},\n\t{\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"owner\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"balanceOf\",\n\t\t\"outputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"uint256\",\n\t\t\t\t\"name\": \"\",\n\t\t\t\t\"type\": \"uint256\"\n\t\t\t}\n\t\t],\n\t\t\"stateMutability\": \"view\",\n\t\t\"type\": \"function\"\n\t},\n\t{\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"uint256\",\n\t\t\t\t\"name\": \"tokenId\",\n\t\t\t\t\"type\": \"uint256\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"getApproved\",\n\t\t\"outputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t}\n\t\t],\n\t\t\"stateMutability\": \"view\",\n\t\t\"type\": \"function\"\n\t},\n\t{\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"owner\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"operator\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"isApprovedForAll\",\n\t\t\"outputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"bool\",\n\t\t\t\t\"name\": \"\",\n\t\t\t\t\"type\": \"bool\"\n\t\t\t}\n\t\t],\n\t\t\"stateMutability\": \"view\",\n\t\t\"type\": \"function\"\n\t},\n\t{\n\t\t\"inputs\": [],\n\t\t\"name\": \"name\",\n\t\t\"outputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"string\",\n\t\t\t\t\"name\": \"\",\n\t\t\t\t\"type\": \"string\"\n\t\t\t}\n\t\t],\n\t\t\"stateMutability\": \"view\",\n\t\t\"type\": \"function\"\n\t},\n\t{\n\t\t\"inputs\": [],\n\t\t\"name\": \"owner\",\n\t\t\"outputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t}\n\t\t],\n\t\t\"stateMutability\": \"view\",\n\t\t\"type\": \"function\"\n\t},\n\t{\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"uint256\",\n\t\t\t\t\"name\": \"tokenId\",\n\t\t\t\t\"type\": \"uint256\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"ownerOf\",\n\t\t\"outputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t}\n\t\t],\n\t\t\"stateMutability\": \"view\",\n\t\t\"type\": \"function\"\n\t},\n\t{\n\t\t\"inputs\": [],\n\t\t\"name\": \"renounceOwnership\",\n\t\t\"outputs\": [],\n\t\t\"stateMutability\": \"nonpayable\",\n\t\t\"type\": \"function\"\n\t},\n\t{\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"to\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"internalType\": \"uint256\",\n\t\t\t\t\"name\": \"tokenId\",\n\t\t\t\t\"type\": \"uint256\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"safeMint\",\n\t\t\"outputs\": [],\n\t\t\"stateMutability\": \"nonpayable\",\n\t\t\"type\": \"function\"\n\t},\n\t{\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"from\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"to\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"internalType\": \"uint256\",\n\t\t\t\t\"name\": \"tokenId\",\n\t\t\t\t\"type\": \"uint256\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"safeTransferFrom\",\n\t\t\"outputs\": [],\n\t\t\"stateMutability\": \"nonpayable\",\n\t\t\"type\": \"function\"\n\t},\n\t{\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"from\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"to\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"internalType\": \"uint256\",\n\t\t\t\t\"name\": \"tokenId\",\n\t\t\t\t\"type\": \"uint256\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"internalType\": \"bytes\",\n\t\t\t\t\"name\": \"data\",\n\t\t\t\t\"type\": \"bytes\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"safeTransferFrom\",\n\t\t\"outputs\": [],\n\t\t\"stateMutability\": \"nonpayable\",\n\t\t\"type\": \"function\"\n\t},\n\t{\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"operator\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"internalType\": \"bool\",\n\t\t\t\t\"name\": \"approved\",\n\t\t\t\t\"type\": \"bool\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"setApprovalForAll\",\n\t\t\"outputs\": [],\n\t\t\"stateMutability\": \"nonpayable\",\n\t\t\"type\": \"function\"\n\t},\n\t{\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"bytes4\",\n\t\t\t\t\"name\": \"interfaceId\",\n\t\t\t\t\"type\": \"bytes4\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"supportsInterface\",\n\t\t\"outputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"bool\",\n\t\t\t\t\"name\": \"\",\n\t\t\t\t\"type\": \"bool\"\n\t\t\t}\n\t\t],\n\t\t\"stateMutability\": \"view\",\n\t\t\"type\": \"function\"\n\t},\n\t{\n\t\t\"inputs\": [],\n\t\t\"name\": \"symbol\",\n\t\t\"outputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"string\",\n\t\t\t\t\"name\": \"\",\n\t\t\t\t\"type\": \"string\"\n\t\t\t}\n\t\t],\n\t\t\"stateMutability\": \"view\",\n\t\t\"type\": \"function\"\n\t},\n\t{\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"uint256\",\n\t\t\t\t\"name\": \"tokenId\",\n\t\t\t\t\"type\": \"uint256\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"tokenURI\",\n\t\t\"outputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"string\",\n\t\t\t\t\"name\": \"\",\n\t\t\t\t\"type\": \"string\"\n\t\t\t}\n\t\t],\n\t\t\"stateMutability\": \"view\",\n\t\t\"type\": \"function\"\n\t},\n\t{\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"from\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"to\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"internalType\": \"uint256\",\n\t\t\t\t\"name\": \"tokenId\",\n\t\t\t\t\"type\": \"uint256\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"transferFrom\",\n\t\t\"outputs\": [],\n\t\t\"stateMutability\": \"nonpayable\",\n\t\t\"type\": \"function\"\n\t},\n\t{\n\t\t\"inputs\": [\n\t\t\t{\n\t\t\t\t\"internalType\": \"address\",\n\t\t\t\t\"name\": \"newOwner\",\n\t\t\t\t\"type\": \"address\"\n\t\t\t}\n\t\t],\n\t\t\"name\": \"transferOwnership\",\n\t\t\"outputs\": [],\n\t\t\"stateMutability\": \"nonpayable\",\n\t\t\"type\": \"function\"\n\t}\n]", "functions": [\ {\ "name": "approve",\ "type": "function",\ "inputs": [\ {\ "name": "to",\ "type": "address"\ },\ {\ "name": "tokenId",\ "type": "uint256"\ }\ ],\ "stateMutability": "nonpayable"\ },\ {\ "name": "balanceOf",\ "type": "function",\ "inputs": [\ {\ "name": "owner",\ "type": "address"\ }\ ],\ "stateMutability": "view",\ "outputs": [\ {\ "name": "",\ "type": "uint256"\ }\ ]\ },\ {\ "name": "getApproved",\ "type": "function",\ "inputs": [\ {\ "name": "tokenId",\ "type": "uint256"\ }\ ],\ "stateMutability": "view",\ "outputs": [\ {\ "name": "",\ "type": "address"\ }\ ]\ },\ {\ "name": "isApprovedForAll",\ "type": "function",\ "inputs": [\ {\ "name": "owner",\ "type": "address"\ },\ {\ "name": "operator",\ "type": "address"\ }\ ],\ "stateMutability": "view",\ "outputs": [\ {\ "name": "",\ "type": "bool"\ }\ ]\ },\ {\ "name": "name",\ "type": "function",\ "stateMutability": "view",\ "outputs": [\ {\ "name": "",\ "type": "string"\ }\ ]\ },\ {\ "name": "owner",\ "type": "function",\ "stateMutability": "view",\ "outputs": [\ {\ "name": "",\ "type": "address"\ }\ ]\ },\ {\ "name": "ownerOf",\ "type": "function",\ "inputs": [\ {\ "name": "tokenId",\ "type": "uint256"\ }\ ],\ "stateMutability": "view",\ "outputs": [\ {\ "name": "",\ "type": "address"\ }\ ]\ },\ {\ "name": "renounceOwnership",\ "type": "function",\ "stateMutability": "nonpayable"\ },\ {\ "name": "safeMint",\ "type": "function",\ "inputs": [\ {\ "name": "to",\ "type": "address"\ },\ {\ "name": "tokenId",\ "type": "uint256"\ }\ ],\ "stateMutability": "nonpayable"\ },\ {\ "name": "safeTransferFrom",\ "type": "function",\ "inputs": [\ {\ "name": "from",\ "type": "address"\ },\ {\ "name": "to",\ "type": "address"\ },\ {\ "name": "tokenId",\ "type": "uint256"\ }\ ],\ "stateMutability": "nonpayable"\ },\ {\ "name": "safeTransferFrom",\ "type": "function",\ "inputs": [\ {\ "name": "from",\ "type": "address"\ },\ {\ "name": "to",\ "type": "address"\ },\ {\ "name": "tokenId",\ "type": "uint256"\ },\ {\ "name": "data",\ "type": "bytes"\ }\ ],\ "stateMutability": "nonpayable"\ },\ {\ "name": "setApprovalForAll",\ "type": "function",\ "inputs": [\ {\ "name": "operator",\ "type": "address"\ },\ {\ "name": "approved",\ "type": "bool"\ }\ ],\ "stateMutability": "nonpayable"\ },\ {\ "name": "supportsInterface",\ "type": "function",\ "inputs": [\ {\ "name": "interfaceId",\ "type": "bytes4"\ }\ ],\ "stateMutability": "view",\ "outputs": [\ {\ "name": "",\ "type": "bool"\ }\ ]\ },\ {\ "name": "symbol",\ "type": "function",\ "stateMutability": "view",\ "outputs": [\ {\ "name": "",\ "type": "string"\ }\ ]\ },\ {\ "name": "tokenURI",\ "type": "function",\ "inputs": [\ {\ "name": "tokenId",\ "type": "uint256"\ }\ ],\ "stateMutability": "view",\ "outputs": [\ {\ "name": "",\ "type": "string"\ }\ ]\ },\ {\ "name": "transferFrom",\ "type": "function",\ "inputs": [\ {\ "name": "from",\ "type": "address"\ },\ {\ "name": "to",\ "type": "address"\ },\ {\ "name": "tokenId",\ "type": "uint256"\ }\ ],\ "stateMutability": "nonpayable"\ },\ {\ "name": "transferOwnership",\ "type": "function",\ "inputs": [\ {\ "name": "newOwner",\ "type": "address"\ }\ ],\ "stateMutability": "nonpayable"\ }\ ], "events": [\ {\ "name": "Approval",\ "type": "event",\ "inputs": [\ {\ "name": "owner",\ "type": "address",\ "indexed": true\ },\ {\ "name": "approved",\ "type": "address",\ "indexed": true\ },\ {\ "name": "tokenId",\ "type": "uint256",\ "indexed": true\ }\ ],\ "anonymous": false\ },\ {\ "name": "ApprovalForAll",\ "type": "event",\ "inputs": [\ {\ "name": "owner",\ "type": "address",\ "indexed": true\ },\ {\ "name": "operator",\ "type": "address",\ "indexed": true\ },\ {\ "name": "approved",\ "type": "bool",\ "indexed": false\ }\ ],\ "anonymous": false\ },\ {\ "name": "OwnershipTransferred",\ "type": "event",\ "inputs": [\ {\ "name": "previousOwner",\ "type": "address",\ "indexed": true\ },\ {\ "name": "newOwner",\ "type": "address",\ "indexed": true\ }\ ],\ "anonymous": false\ },\ {\ "name": "Transfer",\ "type": "event",\ "inputs": [\ {\ "name": "from",\ "type": "address",\ "indexed": true\ },\ {\ "name": "to",\ "type": "address",\ "indexed": true\ },\ {\ "name": "tokenId",\ "type": "uint256",\ "indexed": true\ }\ ],\ "anonymous": false\ }\ ], "verificationStatus": "UNVERIFIED" } } **Note:** Smart contract functions are defined using the Application Binary Interface (ABI). Some important ABI properties are: 1. `name`: The function name. This is used in the `abiFunctionSignature` to select which function to call when reading from or executing a function on a smart contract. 2. `inputs`: The names and types of the arguments to the function. These parameters are passed to the `contracts/read` or `developer/transactions/contractExecution` APIs via the `abiParameters` property. 3. `outputs`: The output values when the function returns. Some functions do not return anything. 4. `stateMutability`: Defines how the function interacts with the blockchain. 1. `view` and `pure` functions do not change the state of the blockchain, so these are `read` functions. 2. `nonpayable` and `payable` functions update the state of the blockchain, so these are `execute` functions. `nonpayable` is the default for a function if no `stateMutability` property exists. [​](https://developers.circle.com/contracts/scp-interact-smart-contract#2-contract-query-function) 2\. Contract Query Function --------------------------------------------------------------------------------------------------------------------------------- Once you have selected a read function from the list, you can send an API request to `POST /contracts/query`. The example below is making a request to the `owner()` function to check the current owner of the contract **Notes:** * The `abiFunctionSignature` is derived from the function name and the parenthesized list of parameter types. For instance, the `abiFunctionSignature` for a function named `testFunction` that takes an `address` and an `uint256` would be `testFunction(address,uint256)`. * Read interactions _do not_ require gas on the blockchain, so you are not required to a specify a wallet. * A shortened `abiJson`, containing only the part of the ABI describing the `owner` function of the contract, was used to demonstrate, but ordinarily, the entire ABI would be included in the request. Node.js SDK Python SDK Bash Report incorrect code Copy response = await client.queryContract({ abiFunctionSignature: "owner()", address: "0x1e124d7384cd34448ea5907bd0052a79355ab5eb", blockchain: "MATIC-AMOY", abiJson: '[{"inputs": [],"name": "owner","outputs": [{"internalType": "address","name": "","type": "address"}],"stateMutability": "view","type": "function"}]', }); Response Body Report incorrect code Copy { "data": { "outputData": "0x000000000000000000000000D4D2DB6B4e42Db2c2C0797F009942b35e466DB29", "outputValues": ["0xD4D2DB6B4e42Db2c2C0797F009942b35e466DB29"] } } [​](https://developers.circle.com/contracts/scp-interact-smart-contract#3-contract-execution-function) 3\. Contract Execution Function ----------------------------------------------------------------------------------------------------------------------------------------- Once you have chosen an execute function you can make a request to `POST developer/transactions/contractExecution` or `user/transactions/contractExecution`, for developer-controlled and user-controlled wallets, respectively. The example below uses the developer-controlled endpoint to call the `safeMint()` function to mint an NFT. The function takes in two parameters: the `to` address and the assigned `tokenId` for the NFT. The `abiFunctionSignature` is `safeMint(address, uint256)`. * **Note:** The `safeMint` function must be called by the `owner` of the contract. We specified this function modifier when generating the contract earlier. * **Note:** Write functions _do_ require gas on the blockchain, so a `walletId` must be specified in the request. Node.js SDK Python SDK Bash Report incorrect code Copy const response = await circleDeveloperSdk.createContractExecutionTransaction({ walletId: "ce714f5b-0d8e-4062-9454-61aa1154869b", contractAddress: "0x2f3A40A3db8a7e3D09B0adfEfbCe4f6F81927557", abiFunctionSignature: "safeMint(address, uint256)", abiParameters: ["0x6E5eAf34c73D1CD0be4e24f923b97CF38e10d1f3", 1], fee: { type: "level", config: { feeLevel: "MEDIUM", }, }, }); Response Body Report incorrect code Copy { "data": { "transactionId": "84cb1754-f236-4bfc-8562-70fa6ee168c8" } } Was this page helpful? YesNo [Quickstart: Deploy an ERC-1155 Contract Template\ \ Previous](https://developers.circle.com/contracts/deploy-smart-contract-template) [Quickstart: Event Monitoring for Smart Contracts\ \ Next](https://developers.circle.com/contracts/scp-event-monitoring) ⌘I ---