1

Build a Project Config File

Need help designing your config? Head to https://wizard.patchwork.dev to build it with a visual editor, or even better, let AI build it for you from a description of how you’d like your app to work.

Example: patchwork.config.ts

import { ProjectConfig } from "@patchworkdev/common/types";

const rizzlerProjectConfig: ProjectConfig = {
name: "RizzlerProject",
scopes: [
    {
        name: "rizzler",
        whitelist: true,
        userAssign: false,
        userPatch: false,
    }
],
contracts: {
    "Rizzler": {
        scopeName: "rizzler",
        name: "Rizzler",
        symbol: "RZLR",
        baseURI: "https://rizzco/",
        schemaURI: "https://rizzco/rizzler-schema.json",
        imageURI: "https://rizzco/assets/{tokenID}.png",
        fields: [
            {
                id: 1,
                key: "shortname",
                type: "char16",
                description: "Short Name"
            },
            {
                id: 2,
                key: "count",
                type: "uint64",
                description: "Rizz Count"
            },
            {
                id: 3,
                key: "rizz",
                type: "uint64",
                description: "Rizz Level"
            }
        ],
        features: []
    }
}
};

export default rizzlerProjectConfig;

2

Use PDK to generate your app's contracts

pdk generate contracts patchwork.config.ts
3

Customize

Use your favorite editor or IDE to customize your generated Solidity contracts, adding any logic your app requires.

For each contract section in your config, there will be two contracts generated (e.g., Rizzler.sol, and RizzlerGenerated.sol). We recommend putting custom logic and method overrides in the contract without the Generated suffix, as this won’t get overwritten when the generators are rerun.

4

Build Contracts

pdk generate contractBuild patchwork.config.ts
5

Deploy server-side resources

Deploy the generated schema files where the SchemaURI points to and set up any graphical assets.

6

Generate contract deploy script

pdk generate deployScripts
7

Deploy to Base Sepolia

OWNER=<your-wallet-address> PATCHWORK_PROTOCOL=0x5fCa9f36772CE35bFbD3Cc75E854F0bEBDDD1ed4 TRY_DEPLOY=true forge script --optimize --optimizer-runs=200 -vvv RizzlerProject-deploy.s.sol --rpc-url https://sepolia.base.org --private-key <your-private-key> --broadcast
For test deployments, use a testnet only private key that doesn’t control any valuable mainnet assets. For prodcution deployments, it is recommended to deploy with a hardware wallet add a line to the end of the deployment script that transfers contract ownership to a safe as the final deployment step.
v2 of Patchwork Protocol is deployed at 0x00000000001616E65bb9FdA42dFBb7155406549b on Base and Sepolia. It is deployed to 0x5fCa9f36772CE35bFbD3Cc75E854F0bEBDDD1ed4 on Base Sepolia.

Congrats! You’ve deployed your first Patchwork App! Need help generating the rest of your app’s frontend and backend services? Head over to the create-patchwork docs.