Skip to content
You are reading Codefi Orchestrate development version documentation and some displayed features may not be available in the stable release. You can switch to stable version using the version box at screen bottom.

How to register a smart contract

Use the Orchestrate Gateway API to register smart contracts. Orchestrate supports registration of different versions of the same smart contract. Registering smart contracts is needed for the following purposes:

Tip

Check the REST API Reference or the JS SDK Reference for a detailed description of all endpoints.

Register a smart contract

Register a smart contract using the Orchestrate Gateway API by sending a POST request to the /contracts endpoint.

Example

{
  "abi": {...},
  "bytecode": "0x6080604052348015600f57600080f...",
  "deployedBytecode": "0x6080604052348015600f57600080f...",
  "name": "ERC20",
  "tag": "v1.0.0"
}
import { SimpleToken } from '../artifacts/SimpleToken'

const contract = await client.registerContract({
  name: 'SimpleToken',
  tag: "v1.0.0",
  abi: SimpleToken.abi,
  bytecode: SimpleToken.bytecode,
  deployedBytecode: SimpleToken.deployedBytecode
})
{
  "uuid": "47afcb8c-e8bf-4275-a21d-ae29968e10d8",
  "abi": {...},
  "bytecode": "0x6080604052348015600f57600080f...",
  "deployedBytecode": "0x6080604052348015600f57600080f...",
  "name": "ERC20",
  "tag": "v1.0.0",
  "createdAt": "2020-07-29T03:59:52.783253Z"
}
  • name - Name of the contract.
  • tag - Version of the contract. Specifying a version already registered will overwrite it.
  • abi - JSON ABI of the contract.
  • bytecode - Bytecode of the contract.
  • deployedBytecode - Deployed bytecode of the contract.

Tip

We recommend using the Truffle Suite to develop smart contracts using Solidity.

ConsenSys has acquired Quorum from J.P. Morgan. Please read the FAQ.
Questions or feedback? You can obtain paid professional support by Consensys at orchestrate@consensys.net