@nevermined-io/protocol-artifacts
v1.5.0
Published
Typed ABIs and addresses of the deployed Nevermined protocol contracts
Readme
@nevermined-io/protocol-artifacts
Typed ABIs and addresses of the deployed Nevermined protocol contracts. Built and published by nevermined-io/protocol on every release, so consumers never compile the contracts repo.
import {
nvmConfigAbi, // ABI, `as const`
nvmConfigAddress, // address
nvmConfigConfig, // { address, abi }
addresses, // { NVMConfig: '0x…', … }
manifest, // { version, gitSha, addressesSource, networks }
} from '@nevermined-io/protocol-artifacts'A few interfaces that consumers call on addresses they get at runtime ship as
an ABI only, with no address: iFeeControllerAbi (a plan's fee controller can
be any IFeeController).
Plain JSON is also exported: @nevermined-io/protocol-artifacts/abis/<Contract>.json,
/addresses.json and /manifest.json.
One address set
The contracts are deployed with CREATE2, so they have the same address on every
network. manifest.networks lists the networks (name → chainId). The build
fails if any network disagrees, so the package never ships two address sets.
Versions
| Package version | Addresses from | npm dist-tag |
|---|---|---|
| X.Y.Z (release) | deployments/deployment-vX.Y.Z-<network>.json, every network required | latest |
| X.Y.Z-rc.N, X.Y.Z-dev.<sha> (prerelease) | deployments/latest-<network>.json (last deploy) | rc, dev |
manifest.addressesSource is release or latest accordingly. Each version is
published together with the nvm-local-chain image of the same tag (vX.Y.Z),
so a consumer pins both to one release.
Building it locally
forge build
pnpm build:artifacts # -> dist/protocol-artifacts, version <package.json>-local
node scripts/artifacts/build-package.mjs --version 1.6.0 --out /tmp/pkg
node scripts/artifacts/build-package.mjs --self-testTo try an unreleased contract change from nvm-monorepo, build it here and
pnpm link the dist/protocol-artifacts directory there.
See scripts/artifacts/build-package.mjs for the full rules and
.github/workflows/release-artifacts.yml for the release job.
