OpenZeppelin Upgrades Core API
The core logic to check for upgrade safety as well as storage layout compatibility is implemented by the package @openzeppelin/upgrades-core
.
The package exports a standalone interface that works with Solidity input and output JSON objects.
import { UpgradeableContract } from '@openzeppelin/upgrades-core';
UpgradeableContract
This class represents the implementation for an upgradeable contract and gives access to error reports.
new UpgradeableContract(name, solcInput, solcOutput, opts?);
opts
is an object with options as defined in Common Options.
In Hardhat, solcInput and solcOutput can be obtained from the Build Info file, which itself can be retrieved with hre.artifacts.getBuildInfo .
|