Cross-chain deployment (CCIP)
How a single transaction on any wired chain deploys a fund there and fans the operational stack out over Chainlink CCIP to the other chains it can reach, at the same addresses everywhere.
A fund spans one or more chains, and its Portfolio Safe, Manager Safe, and Roles Modifiers must share the same address on every chain (see Architecture overview). Doing that by hand means running deployStack on each chain from the same account, in separate transactions. CcipOivDeployer automates it: a single transaction on any wired chain deploys that chain's part of the fund and fans the operational stack out over Chainlink CCIP to every other wired chain that is not a shares chain and that it can reach, producing identical Portfolio / Manager / Roles addresses across all chains.
Source: CcipOivDeployer.sol
Contract
CcipOivDeployer (external orchestrator around KpkOivFactory)
Address
0xD99e4B13fc50A6321f6A84f2D4F83d6e34AE699D, same on every chain
Origin chain
Any wired chain; there is no designated source chain
Entry points
deployEverywhere · dispatchTo · deployLocal (permissionless) · promoteShares (fund governance)
Addresses
Why an orchestrator (not CCIP inside the factory)
KpkOivFactory mixes msg.sender into every CREATE2 salt to stop salt-squatting, so its cross-chain address invariant holds only when the same caller invokes the factory on every chain. A raw CCIP integration would break this: on a destination chain the factory's caller would be the CCIP Router, not the original account.
CcipOivDeployer solves it by being the single, uniform caller of the factory on every chain. Because the orchestrator is itself deployed at the same address on all chains (deterministic CREATE2, identical creation code), the factory sees one identical msg.sender everywhere, and the address invariant is preserved, with no CCIP logic inside the factory's deployment path. All CCIP, fee, and router logic lives in the orchestrator.
Shares chains
Every fund declares a shares-chain topology: the list of chains that carry its kpkShares token, and the base asset it uses on each.
struct SharesChain {
uint256 chainId; // a chain that runs deployOiv for this fund
address asset; // the fund's base asset on that chain
}Every chain in
sharesChainsgets the full fund (stack + shares token). Every other wired chain gets the operational stack only, through the fan-out when the origin has a CCIP lane to it, or otherwise throughdispatchTofrom another chain ordeployLocalon that chain.The topology must be non-empty, strictly ascending by
chainId, and at most 20 entries.The topology is hashed into the fund's salt, so pass the same array everywhere, for the life of the fund. A different topology is a different fund, at different addresses.
A fund with more than one shares chain cannot also use
additionalAssets(AdditionalAssetsNeedASingleSharesChain): those asset addresses are chain-specific but bound into the salt.A declared chain is skipped by the fan-out and refuses inbound stacks, so it holds nothing until its own
deployLocalruns. Declare only the chains you intend to use; a chain added later goes throughpromoteShares.
Shares tokens are never deployed over CCIP. Each shares chain is filled by a transaction on that chain.
The flow
Local half. If the origin chain is in
sharesChains, the orchestrator runsdeployOivthere (stack + shares token). Otherwise it runsdeployStack; starting from a stack-only chain is supported.Fan-out. One CCIP message goes to every other wired chain that is not a shares chain and that the local router can reach. Each destination runs
deployStackat the same addresses.Other shares chains. Each remaining chain in
sharesChainsis filled by its owndeployLocal(config, sharesChains)call on that chain.
The orchestrator derives each destination's StackConfig by calling the factory's own oivToStackConfig(config) helper at runtime, so the mapping can never drift and fragment a fund's addresses.
Entry points
deployEverywhere, dispatchTo, and deployLocal are permissionless. The two CCIP-sending entry points are caller-funded (fees paid in native gas as msg.value; see CCIP fees) and run on any wired chain.
deployEverywhere(config, sharesChains, gasLimit)
Deploy locally and fan out to every reachable wired chain that is not a shares chain.
deployEverywhere(config, sharesChains, destChainIds[], gasLimit)
Same, but only to the given destination chains.
deployEverywhere(config, gasLimit)
Shorthand for a single shares chain: this one, with config.sharesParams.asset as its base asset.
dispatchTo(config, sharesChains, destChainIds[], gasLimit)
CCIP fan-out only (no local deploy), to add a stack chain later or retry a permanently-failed delivery.
deployLocal(config, sharesChains)
Deploy this chain's part with no CCIP at all: shares token on a declared shares chain, stack otherwise.
promoteShares(config, sharesChains)
Add the shares token to a chain the topology does not declare. Restricted to fund governance; see below.
quoteDeployEverywhere(config, [sharesChains, [destChainIds[],]] gasLimit)
View: total native fee and per-destination breakdown to size msg.value.
predictOiv(config, sharesChains)
View: the addresses the fund will have (applies the orchestrator's salt derivation; see below).
supportedChainIds()
View: the wired chains this chain can currently reach over CCIP.
CCIP fees
Every cross-chain message costs a CCIP fee. deployEverywhere sends one message per destination chain, so the amount to pay is the sum of the per-destination fees.
Paid in native gas, by the caller. The fee is paid in the origin chain's native token as the
msg.valueof thedeployEverywhere/dispatchTocall: the account that triggers the deployment funds it. CCIP is not paid in LINK here, and the orchestrator keeps no fee treasury, so there is nothing to pre-fund or drain.What a fee covers. For each destination, the CCIP Router prices delivering the message and executing
ccipReceivethere up to thegasLimitpassed. The total therefore scales with the number of destinations and the gas limit.Quote before you send.
quoteDeployEverywhereis a view that returns thetotalFeeand the per-destination breakdown. Send at leasttotalFeeasmsg.value.Surplus is refunded. If
msg.valueexceeds the total fee, the excess is refunded to the caller in the same transaction, so sending a small buffer over the quote is safe.Fees are not refunded for a failed delivery. A message that reverts on arrival still spent its fee. The orchestrator validates the whole config, including the shares half and the timelocks, on the origin chain before pricing, so most mistakes revert before any fee is paid.
Gas limit
gasLimit is the destination execution budget baked into each message's price. It is prepaid, so unspent destination gas is not refunded, and too low a limit makes the destination delivery fail (see Operational model).
Pass 3,000,000 for any timelocked fund. CCIP caps destination execution at 3,000,000 gas on many lanes, and a timelocked
deployStackwith a large role set needs about 2.6M–2.8M plus about 80k for theccipReceiveframe.A fund with no exec timelock measures about 1.58M; 2,000,000 is ample.
The Manager Safe can have at most 10 owners for anything sent over CCIP (
ManagerOwnersExceedCcipBudget), so the stack fits under the cap.
Security model
ccipReceive accepts a message only when all three hold:
msg.senderis the configured CCIP Router.message.sourceChainSelectoris one of the chains in the orchestrator's registry.The decoded source sender equals
address(this), the sibling orchestrator on the originating chain (same address everywhere).
Check (3) is the load-bearing guard: only a contract at the orchestrator's address can be the source sender. A destination also refuses a stack aimed at one of the fund's shares chains (SharesChainRefusesStack), so nobody can occupy the addresses that chain's shares deployment needs. If a delivery finds the fund's stack already deployed at its addresses under the expected exec governance, it succeeds rather than failing.
All three checks assume the configured router is genuine. The orchestrator owner can repoint it (configure), so a hostile owner or router could land a stack at a fund's addresses on a chain under a different exec owner; a genuine delivery then fails rather than reporting success, but the addresses stay occupied. This is why the owner must remain a governance multisig (see Deployment addresses).
Operational model
Partial failure is possible. A destination message can fail (e.g. gas underestimate). It then enters CCIP's
FAILEDstate and can be manually re-executed within its retry window. Monitor delivery on the CCIP Explorer.Recovery / add a stack chain.
deployEverywhereis the first fan-out and cannot be re-run with the same config (its local deploy would revertStackAlreadyDeployedHere; a fully wired stack is the one thing adoption refuses). To extend a fund to a new stack chain, or resend to one whose delivery permanently failed, usedispatchTowith the sameconfigandsharesChains, so the stack lands at the fund's existing addresses. Don't re-dispatch to a chain that already has the stack: the fee is spent either way.Fees. Paid by the caller in native gas as
msg.value; quote and size them per CCIP fees.Preconditions.
deployStackreverts unless the canonicalEmptycontract and the Safe MultiSend / ZodiacMultiSendUnwrappercontracts are present on the target chain. They are on every chain listed on Deployment addresses.New funds only. Addresses are keyed to the orchestrator and the factory generation, so a fund deployed directly by an EOA, or on an earlier factory generation, cannot be extended through this path. A fund using CCIP must enter through the current (salt v4) orchestrator from the start.
Adding shares to a new chain
Two situations, with different calls:
A chain that is in
sharesChainsbut has not deployed yet: calldeployLocal(config, sharesChains)on that chain. Not the factory's rawdeployOiv(it usesconfig.saltverbatim and builds a separate fund at different addresses), and notpromoteShares(it revertsSharesChainAlreadyDeclaredfor a declared chain).A chain that is not in
sharesChainsat all: callpromoteShares(config, sharesChains)on that chain, passing the fund's original config and topology. The promoted shares token lands at the fund's existing shares address, and nothing else moves.
promoteShares is the one gated entry point, because a promoted chain's base asset is not committed to by the topology: an open promotion would let anyone holding the config deploy a shares token in an asset of their choosing at the fund's canonical address. Its preconditions:
The caller is the exec Roles Modifier's live owner on that chain, not
config.adminas such. That isadminwhile nothing has been rotated, the exec timelock on a timelocked fund, and whatever governance now owns the modifier after a rotation.A fund born with an exec timelock stays promotable only while that birth timelock still owns the exec Roles Modifier (
TimelockMismatchotherwise).execTimelockis part of the salt, so it cannot be restated.A fund born without an exec timelock and without a
sharesTimelockis refusedPromotionWouldRearmTheBirthAdminafter any rotation of exec governance, including to a hand-deployed exec timelock, because the promoted token'sDEFAULT_ADMIN_ROLEwould otherwise go to the replacedadmin, with no way to take it back.The fund's operational stack already exists on that chain (
StackNotDeployedotherwise).The Portfolio Safe has already approved the predicted shares proxy for
type(uint256).maxon the base asset and everycanRedeemadditional asset (ApprovalNotGrantedotherwise). The proxy address is predictable, so approve first.Every
additionalAssetsentry has code on that chain at the same address (AdditionalAssetHasNoCodeHereotherwise).
Supported destinations
The orchestrator's chain registry is seeded at construction with 19 chains, identically on every chain. CCIP lanes are directional, so being in the registry does not mean a chain is reachable from every origin. Call supportedChainIds() on the origin chain to see which chains its router can reach right now:
The all-chains
deployEverywhereskips unreachable chains silently.An explicitly named unreachable chain reverts
LaneNotSupported(chainId, selector), from the quote and the deploy alike, before any fee is paid.
The orchestrator owner can still correct or retire registry entries (setChainSelector / removeChainSelector). The full chain list is on Deployment addresses.
Last updated