Skip to main content
POST
/
platform
/
admin
/
smart_contract_template_versions
cURL
curl --request POST \
  --url https://api.example.com/platform/admin/smart_contract_template_versions \
  --header 'Content-Type: application/json' \
  --data '
{
  "smartContractTemplateId": 1,
  "version": "1.0.0",
  "sourceCode": "pragma solidity ^0.8.0; contract ERC20Token { string public name; string public symbol; uint256 public totalSupply; }"
}
'
{
  "isSuccess": true,
  "isFailure": false,
  "error": null,
  "value": {
    "id": 42,
    "name": "Example"
  }
}

Query Parameters

api-version
string | null

Body

application/json

Request to create a new version of a smart contract template.

smartContractTemplateId
integer<int64>
required

Identifier of the smart contract template this version belongs to.

Example:

1

version
string
required

Version number of the template.

Minimum string length: 1
Example:

"1.0.0"

sourceCode
string
required

Solidity source code of the smart contract.

Minimum string length: 1
Example:

"pragma solidity ^0.8.0; contract ERC20Token { string public name; string public symbol; uint256 public totalSupply; }"

Response

Wrapper for API operation results containing success status, error information, and return value.

isSuccess
boolean

True if the operation completed successfully, false otherwise.

Example:

true

isFailure
boolean

True if the operation failed, false otherwise.

Example:

false

error
object

Error information returned when the operation fails.

Example:
{
"code": "ValidationError",
"message": "The request parameters failed validation.",
"info": [
"The Name field is required.",
"The Id field must be greater than 0."
]
}
value
object

The result value returned when the operation is successful.

Example:
{
"smartContractTemplateId": 1,
"version": "1.0.0",
"sourceCode": "pragma solidity ^0.8.0; contract ERC20Token { string public name; string public symbol; uint256 public totalSupply; }"
}