跳到主要内容

Getting started

信息

If you're interested in building a Juicebox smart contract, see the juice-contract-template GitHub Repository. If you need any help, join our Discord server.

Import

Add the protocol files to the project.

# command line
npm install @jbx-protocol/juice-contracts-v3/

If referencing from typescript:

const contract = require(`@jbx-protocol/juice-contracts-v3/deployments/${network}/${contractName}.json`)

If referencing from a contract:

import '@jbx-protocol/juice-contracts-v3/contracts/[file-path].sol'

Now what

From here, you can build the following:

Basics: Interact with the protocol's basic functionality. Useful for building front-ends.

Pay a project: Deploy or inherit from a contract that makes it easy to forward funds to Juicebox projects.

Split payments: Deploy or inherit from a contract that makes it easy to forward funds to groups of splits whose members are either addresses, Juicebox projects, or arbitrary contracts that inherit from IJBSplitAllocator.

Program a treasury: Get familiar with the configurable properties available when launching a project.

Program project permissions: Build custom Juicebox Project NFT logic to create your own project access controls.

Program treasury extensions: Create custom contractual rules defining what happens when a project receives funds, and under what conditions funds can leave the treasury during a funding cycle.