Skip to main content
VaultKit treats every Shield policy as a composite, even when it has one module. defineComposite(...) reads the deployed NewtonPolicy.getPolicyData() list, aligns your modules to that onchain oracle set, and returns the pack passed to createShield(...).
The module list is order-independent when you pass it, but the deployed policy must contain the same oracle set. A missing or extra oracle fails before VaultKit builds an intent.

Onchain Manifest

shield.setParams(...) writes the full manifest envelope to NewtonPolicy.PolicyConfig.policyParams. Operators validate this exact byte shape; they do not unwrap params before schema validation.
A composite params_schema.json must describe this envelope: required root fields are _manifest, modules, and params; pack params live under params.<short-id>.

Per-Call Options

shield.sendCall(...) and typed vendor overlays accept prepareQueryOptions, keyed by short pack id. The composite routes each entry to the matching module’s prepareQuery.
Each module’s returned wasmArgs is validated against that module’s schema before the intent is built. A rejected module fails closed.

Params and Secrets

Params and secrets are both keyed by short pack id:
Secrets are encrypted client-side and uploaded to Newton Gateway. They are not written onchain.

Depositor Verification

A depositor or monitoring service can verify a deployed Shield contract without trusting offchain docs:
  1. Read Shield.getPolicyAddress().
  2. Read INewtonPolicy(policy).getPolicyData() for the constituent oracles.
  3. Read each oracle’s getWasmCid().
  4. Read Shield.getPolicyConfig().policyParams and decode the manifest.
  5. Compare manifest modules[] and wasmCid values against the onchain reads.
@newton-xyz/policy-pack-shared exposes introspectComposite({ publicClient, shieldAddress }) for this path. It returns a report with booleans such as onChainPolicyDataMatches and per-module wasmCidsMatch; it throws only when the manifest bytes cannot be decoded.

Recovery Flag

createShield({ skipPolicyBindingCheck: true }) attaches without validating the onchain manifest. Use it only for first-time or interrupted setup recovery so the next call can write setParams(...); remove it for production runs.

Composite-Specific Errors