Getting started
Introduction
The Patchwork Development Kit provides a toolset for defining onchain metadata schemas and generating Patchwork-compatible contracts. Define schemas in JSON and use the PDK tool to validate and generate solidity.
Workflow
- Define a contract configuration in JSON, adding the features and metadata fields your app requires.
- Run the PDK contract generator to convert the JSON into a Solidity contract.
- Customize your solidity contract by adding your own custom logic.
- Deploy to any EVM-compatible chain where Patchwork Protocol is deployed.
Installing
In a git repository root directory, perform the following steps to prepare a project:
1
Install Foundry
Foundry is a smart contract development toolchain. You can install it by following the instructions at Foundry’s installation guide.
forge install
2
Install Patchwork Contracts Library
forge install runic-inc/patchwork
3
Install OpenZeppelin Contracts
forge install openzeppelin/openzeppelin-contracts
4
Configure Project Remappings
In project directory, create the file remappings.txt
@openzeppelin/=lib/openzeppelin-contracts/
@patchwork/=lib/patchwork/src/
forge-std/=lib/forge-std/src/
lib/=lib/
5
Install PDK
Option 1 - Local project installation (recommended for npm/js projects)
npm i @patchworkdev/pdk
Option 2 - Global binary installation
npm i -g @patchworkdev/pdk