For the complete documentation index, see llms.txt. This page is also available as Markdown.

Code examples

Look up, predict, and deploy KPK funds through the KpkOivFactory and the CCIP orchestrator, with viem, ethers.js, and Python.

Practical examples for looking up a fund's contract addresses, predicting them ahead of a deployment, and deploying a fund across chains — through the KpkOivFactory and the CcipOivDeployer orchestrator.

Source: KpkOivFactory.sol · CcipOivDeployer.sol

The factory and orchestrator share the same address on every chain — take them from Deployment addresses. The addresses below are placeholders.

In the returned OivInstance, the field named avatarSafe is the fund's Portfolio Safe (the Zodiac module's avatar — the Safe that holds the fund's assets); kpkSharesProxy is the ERC-20 shares token investors hold.


1. Look up a deployed fund

Funds registered on the factory are returned by getFund(registeredFundId) as an OivInstance — the seven per-fund addresses.

struct OivInstance {
    address avatarSafe;           // the fund's Portfolio Safe (holds assets)
    address managerSafe;
    address execRolesModifier;
    address subRolesModifier;
    address managerRolesModifier;
    address kpkSharesImpl;
    address kpkSharesProxy;        // the ERC-20 shares token
}

function getFund(uint256 registeredFundId) external view returns (OivInstance memory);

predictOivAddresses(config, caller) on the factory returns the same OivInstance for a set of inputs without sending a transaction — handy to look up a fund's Portfolio Safe before it is deployed. For CCIP-deployed funds, predict through the orchestrator instead (next section), which applies the config-bound salt.


2. Deploy a fund across chains

A single mainnet call to CcipOivDeployer.deployEverywhere deploys the full OIV on mainnet and fans the operational stack out to every configured sidechain (see Cross-chain deployment). Build an OivConfig, predict the resulting addresses, quote the native CCIP fee, then deploy with that fee as msg.value.

Deploy to a subset of chains with the deployEverywhere(config, destChainIds[], gasLimit) overload, and add a chain to an existing fund later — or retry a permanently-failed CCIP delivery — with dispatchTo(config, destChainIds[], gasLimit) using the same config. See Cross-chain deployment.

Last updated