Getting started
Contract configurations
Overview
The PDK contract generator will accept a properly schemad JSON as input and will generate the same name solidity contract as output in the current working directory.
Example:
pdk generate MyContract.json
The above command will read MyContract.json and will output MyContract.sol using the parameters and options specified in the JSON.
Contract configuration JSON
Name | Description |
---|---|
scopeName | The scope name of the contract |
name | The ERC-721 Name of the contract |
symbol | The ERC-721 symbol of the contract |
schemaURI | The schema URI |
imageURI | The image URI |
features | List of features |
fields | List of fields |
Contract configuration JSON fields
Name | Description |
---|---|
id | The field ID (must be unique) |
key | The field key (must be unique) |
type | The field type (Must be in field type enum) |
arrayLength | The array length (1 is default, 0 is dynamic and >1 is a static array) |
description | The field description |
Field types
Name | Description |
---|---|
boolean | A boolean type (true or false) |
int8 | An 8-bit signed integer. |
int16 | A 16-bit signed integer. |
int32 | A 32-bit signed integer. |
int64 | A 64-bit signed integer. |
int128 | A 128-bit signed integer. |
int256 | A 256-bit signed integer. |
uint8 | An 8-bit unsigned integer. |
uint16 | A 16-bit unsigned integer. |
uint32 | A 32-bit unsigned integer. |
uint64 | A 64-bit unsigned integer. |
uint128 | A 128-bit unsigned integer. |
uint256 | A 256-bit unsigned integer. |
char8 | An 8-character string (64 bits). |
char16 | A 16-character string (128 bits). |
char32 | A 32-character string (256 bits). |
char64 | A 64-character string (512 bits). |
literef | A 64-bit Literef reference to a patchwork fragment. |
address | A 160-bit address. |
string | A dynamically-sized string. |
Features
Name | Description |
---|---|
fragmentmulti | A multi-assignable fragment |
fragmentsingle | A single-assignable fragment |
patch | A 721 patch |
patchaccount | An account patch |
patch1155 | An 1155 patch |
mintable | Mintable |
reversible | Reversible (patch) |