Setting up Portfolio
There are several ways to set up Portfolio into your project, depending on the tools and languages you're using.
If you're starting a Solidity project from scratch, we recommend using our Forge-based template repository (opens in a new tab), as it contains all the necessary dependencies and configuration to get you started, including a local setup and working examples.
You can get started here (opens in a new tab).
If you're using Forge (opens in a new tab), you might want to install Portfolio as a submodule:
forge install primitivefinance/portfolio
Note that in this case you'll still need to either deploy Portfolio contracts locally (check out this example (opens in a new tab)) or fork a network (opens in a new tab) to interact with the deployed contracts.
# Using yarn yarn add @primitivexyz/portfolio # Using npm npm i @primitivexyz/portfolio # Using pnpm pnpm add @primitivexyz/portfolio
In this case you'll also need to either deploy Portfolio contracts locally or interact with deploy contracts on a forked network.
Alternatively, a manual installation is also possible, either by copy-pasting the interfaces from the Portfolio repository (opens in a new tab) or directly by importing them, for example in Remix: