Workflow

  1. Define a contract configuration in JSON, adding the features and metadata fields your app requires.
  2. Run the PDK contract generator to convert the JSON into a Solidity contract.
  3. Customize your solidity contract by adding your own custom logic.
  4. Deploy to any EVM-compatible chain where Patchwork Protocol is deployed.

Workflow

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