Introduction
Project configuration
Our PDK generators will accept a properly typed Patchwork project configuration file as input and will generate the same name solidity contract as output in the current working directory.
Here’s an example Patchwork project configuration:
From this file, we can generate Solidity boilerplate, indexer schemas, React hooks and more.
Project configuration
Name | Description |
---|---|
name | The name of your app |
scopes | Scope configuration records |
contracts | Contract configuration records |
contractRelations | Contract relations records |
networks | Network configuration records |
Contract configuration
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 |
baseURI | The base URI |
schemaURI | The schema URI |
imageURI | The image URI |
features | List of features |
fields | List of fields |
Contract 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 |
Contract 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. |
Contract 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) |
If you’re using Typescript, you’ll need to import the Feature
enum from @patchworkdev/common/types
.