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

NameDescription
scopeNameThe scope name of the contract
nameThe ERC-721 Name of the contract
symbolThe ERC-721 symbol of the contract
schemaURIThe schema URI
imageURIThe image URI
featuresList of features
fieldsList of fields

Contract configuration JSON fields

NameDescription
idThe field ID (must be unique)
keyThe field key (must be unique)
typeThe field type (Must be in field type enum)
arrayLengthThe array length (1 is default, 0 is dynamic and >1 is a static array)
descriptionThe field description

Field types

NameDescription
booleanA boolean type (true or false)
int8An 8-bit signed integer.
int16A 16-bit signed integer.
int32A 32-bit signed integer.
int64A 64-bit signed integer.
int128A 128-bit signed integer.
int256A 256-bit signed integer.
uint8An 8-bit unsigned integer.
uint16A 16-bit unsigned integer.
uint32A 32-bit unsigned integer.
uint64A 64-bit unsigned integer.
uint128A 128-bit unsigned integer.
uint256A 256-bit unsigned integer.
char8An 8-character string (64 bits).
char16A 16-character string (128 bits).
char32A 32-character string (256 bits).
char64A 64-character string (512 bits).
literefA 64-bit Literef reference to a patchwork fragment.
addressA 160-bit address.
stringA dynamically-sized string.

Features

NameDescription
fragmentmultiA multi-assignable fragment
fragmentsingleA single-assignable fragment
patchA 721 patch
patchaccountAn account patch
patch1155An 1155 patch
mintableMintable
reversibleReversible (patch)