Contract Templates

Upload contract template

Upload a new contract template. This contract template will be available for the workspace

post/tokenization/templates

Request

Headers

Idempotency-Keystring

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.

Request body

namestring required

The name of the contract template

descriptionstring required

A short description of the contract template

longDescriptionstring

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

bytecodestring required

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

sourcecodestring

The source code of the contract. Optional.

type'FUNGIBLE_TOKEN' | 'NON_FUNGIBLE_TOKEN' | 'NON_TOKEN' | 'TOKEN_EXTENSION' | 'TOKEN_UTILITY' required

The type of the contract template

protocol'ETH' | 'SOL'

The protocol that the template will be used for

Example request

{
  "name": "My Contract",
  "description": "an ERC20 implementation",
  "longDescription": "a full ERC20 implementation, containing the following:\n\n - mint\n - burn\n",
  "type": "FUNGIBLE_TOKEN",
  "docs": {
    "details": "A token that can be minted and burned",
    "events": "Upgraded(address): {\"details\": \"Emitted when the implementation is upgraded.\"}",
    "kind": "dev",
    "methods": {
      "constructor": {
        "details": "Initializes the contract"
      }
    },
    "version": 1
  },
  "abi": [
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "implementation",
          "type": "address"
        },
        {
          "internalType": "bytes",
          "name": "_data",
          "type": "bytes"
        }
      ],
      "stateMutability": "payable",
      "type": "constructor"
    }
  ],
  "protocol": "ETH"
}

Response

Contract was uploaded successfully

idstring required

The unique identifier of the contract template

namestring required

The name of the contract template

descriptionstring required

A short description of the contract template

longDescriptionstring

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

ownerstring

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

isPublicboolean required

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

canDeployboolean

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

type'FUNGIBLE_TOKEN' | 'NON_FUNGIBLE_TOKEN' | 'NON_TOKEN' | 'TOKEN_EXTENSION' | 'TOKEN_UTILITY'

The type of the contract template

implementationContractIdstring
initializationPhase'ON_DEPLOYMENT' | 'POST_DEPLOYMENT' required

Example response

{
  "id": "b70701f4-d7b1-4795-a8ee-b09cdb5b850d",
  "name": "My Contract",
  "description": "an ERC20 implementation",
  "longDescription": "a full ERC20 implementation, containing the following:\n\n - mint\n - burn\n",
  "abi": [
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "implementation",
          "type": "address"
        },
        {
          "internalType": "bytes",
          "name": "_data",
          "type": "bytes"
        }
      ],
      "stateMutability": "payable",
      "type": "constructor"
    }
  ],
  "docs": {
    "details": "A token that can be minted and burned",
    "events": "Upgraded(address): {\"details\": \"Emitted when the implementation is upgraded.\"}",
    "kind": "dev",
    "methods": {
      "constructor": {
        "details": "Initializes the contract"
      }
    },
    "version": 1
  },
  "owner": "b70701f4-d7b1-4795-a8ee-b09cdb5b850d",
  "vendor": {
    "id": "b70701f4-d7b1-4795-a8ee-b09cdb5b4453",
    "name": "Fireblocks"
  },
  "isPublic": true,
  "canDeploy": true,
  "type": "FUNGIBLE_TOKEN"
}

Changes

No recorded changes to this operation across all 1 revision of this API.