Skip to main content
POST
/
tokenization
/
templates
TypeScript
const response: Promise<FireblocksResponse<ContractTemplateDto>> = fireblocks.contractTemplates.uploadContractTemplate(contractTemplatesApiUploadContractTemplateRequest);
{
  "id": "b70701f4-d7b1-4795-a8ee-b09cdb5b850d",
  "name": "My Contract",
  "description": "an ERC20 implementation",
  "abi": [
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "implementation",
          "type": "address"
        },
        {
          "internalType": "bytes",
          "name": "_data",
          "type": "bytes"
        }
      ],
      "stateMutability": "payable",
      "type": "constructor"
    }
  ],
  "isPublic": true,
  "initializationPhase": "ON_DEPLOYMENT",
  "longDescription": "a full ERC20 implementation, containing the following:\n\n - mint\n - burn\n",
  "attributes": {
    "useCases": [
      "Stablecoin",
      "CBDC"
    ],
    "standards": [
      "ERC-20",
      "ERC-1400"
    ],
    "auditor": {
      "name": "MyAuditor",
      "imageURL": "https://my-images.com/my-image.jpg",
      "link": "https://my-auditor.com/my-audit-report"
    }
  },
  "docs": {
    "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.",
    "errors": {
      "ERC1967NonPayable()": [
        {
          "details": "An upgrade function sees `msg.value > 0` that may be lost."
        }
      ]
    },
    "events": {
      "Upgraded(address)": {
        "details": "Emitted when the implementation is upgraded."
      }
    },
    "kind": "dev",
    "methods": {
      "constructor": {
        "details": "Initializes the upgradeable proxy with an initial implementation specified by `implementation`. If `_data` is nonempty, it's used as data in a delegate call to `implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - If `data` is empty, `msg.value` must be zero."
      }
    },
    "version": 1
  },
  "owner": "b70701f4-d7b1-4795-a8ee-b09cdb5b850d",
  "vendor": {
    "id": "b70701f4-d7b1-4795-a8ee-b09cdb5b4453",
    "name": "Fireblocks"
  },
  "canDeploy": true,
  "type": "FUNGIBLE_TOKEN",
  "implementationContractId": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://developers.fireblocks.com/llms.txt

Use this file to discover all available pages before exploring further.

Headers

Idempotency-Key
string

A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours.

Body

application/json
name
string
required

The name of the contract template

Example:

"My Contract"

description
string
required

A short description of the contract template

Example:

"an ERC20 implementation"

bytecode
string
required

The compiled artifact of this smart contract. Used for deployment of this contract template

type
enum<string>
required

The type of the contract template

Available options:
FUNGIBLE_TOKEN,
NON_FUNGIBLE_TOKEN,
NON_TOKEN,
TOKEN_EXTENSION,
TOKEN_UTILITY
Example:

"FUNGIBLE_TOKEN"

abi
object[]
required

The abi of the contract template. Necessary for displaying and for after deployment encoding

Example:
[
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "implementation",
        "type": "address"
      },
      {
        "internalType": "bytes",
        "name": "_data",
        "type": "bytes"
      }
    ],
    "stateMutability": "payable",
    "type": "constructor"
  }
]
longDescription
string

A full description of the contract template. May contain to break the lines

Example:

"a full ERC20 implementation, containing the following:\n\n - mint\n - burn\n"

sourcecode
string

The source code of the contract. Optional.

docs
object

A natspec compliant documentation json. Can be retrieved from the output json after compilation

Example:
{
  "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.",
  "errors": {
    "ERC1967NonPayable()": [
      {
        "details": "An upgrade function sees `msg.value > 0` that may be lost."
      }
    ]
  },
  "events": {
    "Upgraded(address)": {
      "details": "Emitted when the implementation is upgraded."
    }
  },
  "kind": "dev",
  "methods": {
    "constructor": {
      "details": "Initializes the upgradeable proxy with an initial implementation specified by `implementation`. If `_data` is nonempty, it's used as data in a delegate call to `implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - If `data` is empty, `msg.value` must be zero."
    }
  },
  "version": 1
}
attributes
object

The attributes related to this contract template. It will be displayed in the tokenization page

Example:
{
  "useCases": ["Stablecoin", "CBDC"],
  "standards": ["ERC-20", "ERC-1400"],
  "auditor": {
    "name": "MyAuditor",
    "imageURL": "https://my-images.com/my-image.jpg",
    "link": "https://my-auditor.com/my-audit-report"
  }
}
protocol
enum<string>

The protocol that the template will be used for

Available options:
ETH,
SOL
Example:

"ETH"

Response

Contract was uploaded successfully

id
string
required

The unique identifier of the contract template

Example:

"b70701f4-d7b1-4795-a8ee-b09cdb5b850d"

name
string
required

The name of the contract template

Example:

"My Contract"

description
string
required

A short description of the contract template

Example:

"an ERC20 implementation"

abi
object[]
required

The abi of the contract template. Necessary for displaying and for after deployment encoding

Example:
[
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "implementation",
        "type": "address"
      },
      {
        "internalType": "bytes",
        "name": "_data",
        "type": "bytes"
      }
    ],
    "stateMutability": "payable",
    "type": "constructor"
  }
]
isPublic
boolean
required

Is this a contract that is viewable by all fireblocks's users or is it visible only for this workspace

Example:

true

initializationPhase
enum<string>
required
Available options:
ON_DEPLOYMENT,
POST_DEPLOYMENT
longDescription
string

A full description of the contract template. May contain to break the lines

Example:

"a full ERC20 implementation, containing the following:\n\n - mint\n - burn\n"

attributes
object

The attributes related to this contract template. It will be displayed in the tokenization page

Example:
{
  "useCases": ["Stablecoin", "CBDC"],
  "standards": ["ERC-20", "ERC-1400"],
  "auditor": {
    "name": "MyAuditor",
    "imageURL": "https://my-images.com/my-image.jpg",
    "link": "https://my-auditor.com/my-audit-report"
  }
}
docs
object

A natspec compliant documentation json. Can be retrieved from the output json after compilation

Example:
{
  "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.",
  "errors": {
    "ERC1967NonPayable()": [
      {
        "details": "An upgrade function sees `msg.value > 0` that may be lost."
      }
    ]
  },
  "events": {
    "Upgraded(address)": {
      "details": "Emitted when the implementation is upgraded."
    }
  },
  "kind": "dev",
  "methods": {
    "constructor": {
      "details": "Initializes the upgradeable proxy with an initial implementation specified by `implementation`. If `_data` is nonempty, it's used as data in a delegate call to `implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - If `data` is empty, `msg.value` must be zero."
    }
  },
  "version": 1
}
owner
string

The workspace id of the owner of this contract template. If it's a private contract, only this workspace will be allowed to deploy it

Example:

"b70701f4-d7b1-4795-a8ee-b09cdb5b850d"

vendor
object

The details of the vendor of this contract template. Applicable only for public contract templates

canDeploy
boolean

True if the workspace allowed to deploy this contract, false otherwise

Example:

true

type
enum<string>

The type of the contract template

Available options:
FUNGIBLE_TOKEN,
NON_FUNGIBLE_TOKEN,
NON_TOKEN,
TOKEN_EXTENSION,
TOKEN_UTILITY
Example:

"FUNGIBLE_TOKEN"

implementationContractId
string