Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: OpenZeppelin/openzeppelin-upgrades
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: aff3cdacedb7265f5b54cdb8408e9517bb009e7f
Choose a base ref
...
head repository: OpenZeppelin/openzeppelin-upgrades
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 25d1ba62c1ecb82b022982754b63c05b4ba416dc
Choose a head ref
Loading
Showing with 17,395 additions and 12,305 deletions.
  1. +1 −0 .eslintrc.js
  2. +13 −0 .github/actions/setup/action.yml
  3. +57 −0 .github/workflows/checks.yml
  4. +0 −40 .github/workflows/coverage.yml
  5. +4 −21 .github/workflows/pack.yml
  6. +0 −47 .github/workflows/test.yml
  7. +1 −0 .node-version
  8. +0 −1 .npmrc
  9. +65 −28 docs/modules/ROOT/pages/api-core.adoc
  10. +457 −79 docs/modules/ROOT/pages/api-hardhat-upgrades.adoc
  11. +376 −72 docs/modules/ROOT/pages/api-truffle-upgrades.adoc
  12. +42 −6 docs/modules/ROOT/pages/faq.adoc
  13. +2 −2 docs/modules/ROOT/pages/index.adoc
  14. +11 −0 docs/modules/ROOT/pages/network-files.adoc
  15. +14 −9 docs/modules/ROOT/pages/proxies.adoc
  16. +84 −28 docs/modules/ROOT/pages/writing-upgradeable.adoc
  17. +2 −3 package.json
  18. +119 −0 packages/core/CHANGELOG.md
  19. +2 −2 packages/core/ava.config.js
  20. +4 −1 packages/core/contracts/Initializable.sol
  21. +7 −0 packages/core/contracts/test/Memory05.sol
  22. +12 −0 packages/core/contracts/test/Memory08.sol
  23. +64 −0 packages/core/contracts/test/RenamedRetyped.sol
  24. +167 −0 packages/core/contracts/test/RetypeFromContract.sol
  25. +14 −1 packages/core/contracts/test/Standalone.sol
  26. +516 −0 packages/core/contracts/test/Storage.sol
  27. +7 −0 packages/core/contracts/test/Storage088.sol
  28. +21 −0 packages/core/contracts/test/Storage089.sol
  29. +18 −0 packages/core/contracts/test/StorageRenamedRetyped.sol
  30. +10 −0 packages/core/contracts/test/ValidationsSameNameSafe.sol
  31. +12 −0 packages/core/contracts/test/ValidationsSameNameUnsafe.sol
  32. +10 −0 packages/core/contracts/test/ValidationsUDVT.sol
  33. +10 −0 packages/core/contracts/test/ignore-errors/AllowChild.sol
  34. +10 −0 packages/core/contracts/test/ignore-errors/AllowChildCallTransitive.sol
  35. +7 −0 packages/core/contracts/test/ignore-errors/AllowChildInheritedTransitive.sol
  36. +10 −0 packages/core/contracts/test/ignore-errors/AllowChildSelfReachable.sol
  37. +16 −0 packages/core/contracts/test/ignore-errors/AllowParent.sol
  38. +16 −0 packages/core/contracts/test/ignore-errors/AllowParentSelfReachable.sol
  39. +12 −0 packages/core/contracts/test/ignore-errors/AllowReachable.sol
  40. +14 −0 packages/core/contracts/test/ignore-errors/AllowReachableParent.sol
  41. +15 −0 packages/core/contracts/test/ignore-errors/AllowReachableParentCall.sol
  42. +94 −0 packages/core/contracts/test/ignore-errors/Constructors.sol
  43. +19 −0 packages/core/contracts/test/ignore-errors/Modifiers.sol
  44. +14 −0 packages/core/contracts/test/ignore-errors/RiskyFreeFunctions.sol
  45. +40 −0 packages/core/contracts/test/ignore-errors/RiskyLibrary.sol
  46. +24 −0 packages/core/contracts/test/ignore-errors/RiskyParentContract.sol
  47. +5 −0 packages/core/contracts/test/ignore-errors/SafeContract.sol
  48. +10 −0 packages/core/contracts/test/ignore-errors/SafeContractWithFreeFunctionCall.sol
  49. +10 −0 packages/core/contracts/test/ignore-errors/SafeContractWithLibraryCall.sol
  50. +8 −0 packages/core/contracts/test/ignore-errors/SafeContractWithLibraryImport.sol
  51. +12 −0 packages/core/contracts/test/ignore-errors/SafeContractWithLibraryUsingFor.sol
  52. +10 −0 packages/core/contracts/test/ignore-errors/SafeContractWithParentCall.sol
  53. +10 −0 packages/core/contracts/test/ignore-errors/SafeContractWithTransitiveLibraryCall.sol
  54. +14 −0 packages/core/contracts/test/ignore-errors/SafeRecursion.sol
  55. +17 −0 packages/core/contracts/test/ignore-errors/TransitiveAllowReachable.sol
  56. +17 −0 packages/core/contracts/test/ignore-errors/TransitiveRiskyLibrary.sol
  57. +7 −0 packages/core/contracts/test/ignore-errors/TransitiveUnsafeParent.sol
  58. +12 −0 packages/core/contracts/test/ignore-errors/UnsafeAllow.sol
  59. +12 −0 packages/core/contracts/test/ignore-errors/UnsafeAllowParent.sol
  60. +12 −0 packages/core/contracts/test/ignore-errors/UnsafeAllowReachableDifferentOpcode.sol
  61. +12 −0 packages/core/contracts/test/ignore-errors/UnsafeAllowReachableParentDifferentOpcode.sol
  62. +12 −0 packages/core/contracts/test/ignore-errors/UnsafeContract.sol
  63. +10 −0 packages/core/contracts/test/ignore-errors/UnsafeContractWithFreeFunctionCall.sol
  64. +7 −0 packages/core/contracts/test/ignore-errors/UnsafeContractWithInheritedParent.sol
  65. +7 −0 packages/core/contracts/test/ignore-errors/UnsafeContractWithInheritedTransitiveParent.sol
  66. +10 −0 packages/core/contracts/test/ignore-errors/UnsafeContractWithLibraryCall.sol
  67. +12 −0 packages/core/contracts/test/ignore-errors/UnsafeContractWithLibraryUsingFor.sol
  68. +10 −0 packages/core/contracts/test/ignore-errors/UnsafeContractWithParentCall.sol
  69. +10 −0 packages/core/contracts/test/ignore-errors/UnsafeContractWithTransitiveLibraryCall.sol
  70. +42 −0 packages/core/contracts/test/ignore-errors/UnsafeParentContract.sol
  71. +14 −0 packages/core/contracts/test/ignore-errors/UnsafeRecursion.sol
  72. +14 −1 packages/core/hardhat.config.js
  73. +26 −0 packages/core/hardhat/separate-test-contracts.js
  74. +9 −10 packages/core/package.json
  75. +65 −0 packages/core/scripts/copy-build-info.js
  76. +12 −0 packages/core/src/add-proxy-to-manifest.ts
  77. +84 −17 packages/core/src/deployment.ts
  78. +7 −0 packages/core/src/eip-1967-type.ts
  79. +6 −7 packages/core/src/eip-1967.ts
  80. +2 −1 packages/core/src/impl-address.ts
  81. +33 −1 packages/core/src/impl-store.test.ts
  82. +85 −18 packages/core/src/impl-store.ts
  83. +27 −5 packages/core/src/index.ts
  84. +4 −2 packages/core/src/levenshtein.ts
  85. +11 −8 packages/core/src/manifest-storage-layout.test.ts
  86. +11 −3 packages/core/src/manifest-storage-layout.ts
  87. +453 −2 packages/core/src/manifest.test.ts
  88. +168 −18 packages/core/src/manifest.ts
  89. +41 −5 packages/core/src/provider.ts
  90. +28 −1 packages/core/src/proxy-kind.ts
  91. +1 −1 packages/core/src/scripts/migrate-oz-cli-project.test.ts
  92. BIN packages/core/src/scripts/migrate-oz-cli-project.test.ts.snap
  93. +5 −0 packages/core/src/solc-api.ts
  94. +1 −1 packages/core/src/src-decoder.ts
  95. +25 −2 packages/core/src/standalone.test.ts
  96. +114 −0 packages/core/src/storage-0.8.test.ts
  97. +180 −0 packages/core/src/storage-0.8.test.ts.md
  98. BIN packages/core/src/storage-0.8.test.ts.snap
  99. +89 −0 packages/core/src/storage-memory-0.5.test.ts
  100. +175 −0 packages/core/src/storage-memory-0.5.test.ts.md
  101. BIN packages/core/src/storage-memory-0.5.test.ts.snap
  102. +482 −21 packages/core/src/storage.test.ts
  103. +348 −109 packages/core/src/storage.test.ts.md
  104. BIN packages/core/src/storage.test.ts.snap
  105. +193 −19 packages/core/src/storage/compare.ts
  106. +117 −53 packages/core/src/storage/extract.ts
  107. +26 −0 packages/core/src/storage/gap.ts
  108. +33 −7 packages/core/src/storage/layout.ts
  109. +206 −0 packages/core/src/storage/report-gap.test.ts
  110. +89 −0 packages/core/src/storage/report-gap.test.ts.md
  111. BIN packages/core/src/storage/report-gap.test.ts.snap
  112. +133 −0 packages/core/src/storage/report-rename-retype.test.ts
  113. +51 −0 packages/core/src/storage/report-rename-retype.test.ts.md
  114. BIN packages/core/src/storage/report-rename-retype.test.ts.snap
  115. +169 −0 packages/core/src/storage/report-retype-from-contract.test.ts
  116. +9 −2 packages/core/src/storage/report.test.ts
  117. +12 −4 packages/core/src/storage/report.test.ts.md
  118. BIN packages/core/src/storage/report.test.ts.snap
  119. +123 −13 packages/core/src/storage/report.ts
  120. +44 −0 packages/core/src/usage-error.ts
  121. +11 −0 packages/core/src/utils/execall.ts
  122. +14 −5 packages/core/src/utils/function.ts
  123. +106 −106 packages/core/src/utils/parse-type-id.test.ts.md
  124. BIN packages/core/src/utils/parse-type-id.test.ts.snap
  125. +17 −0 packages/core/src/utils/stabilize-layout.ts
  126. +1 −1 packages/core/src/utils/type-id.ts
  127. +137 −0 packages/core/src/validate-ignore-errors.test.ts
  128. +16 −2 packages/core/src/validate.test.ts
  129. +3 −3 packages/core/src/validate/data.ts
  130. +1 −1 packages/core/src/validate/index.ts
  131. +49 −4 packages/core/src/validate/overrides.ts
  132. +76 −34 packages/core/src/validate/query.ts
  133. +49 −0 packages/core/src/validate/run.test.ts
  134. +260 −48 packages/core/src/validate/run.ts
  135. +28 −0 packages/plugin-defender-hardhat/CHANGELOG.md
  136. +27 −5 packages/plugin-defender-hardhat/README.md
  137. BIN packages/plugin-defender-hardhat/assets/verified-deploy.png
  138. +1 −2 packages/plugin-defender-hardhat/ava.config.js
  139. +10 −0 packages/plugin-defender-hardhat/contracts/Greeter.sol
  140. +8 −7 packages/plugin-defender-hardhat/package.json
  141. +34 −19 packages/plugin-defender-hardhat/src/index.ts
  142. +59 −26 packages/plugin-defender-hardhat/src/propose-upgrade.ts
  143. +2 −2 packages/plugin-defender-hardhat/src/type-extensions.ts
  144. +24 −0 packages/plugin-defender-hardhat/src/utils.ts
  145. +101 −0 packages/plugin-defender-hardhat/src/verify-deployment.ts
  146. +6 −10 packages/plugin-defender-hardhat/test/propose-upgrade-beacon.js
  147. +3 −25 packages/plugin-defender-hardhat/test/propose-upgrade-transparent.js
  148. +3 −7 packages/plugin-defender-hardhat/test/propose-upgrade-unsafeAllow.js
  149. +65 −0 packages/plugin-defender-hardhat/test/propose-upgrade-use-deployed.js
  150. +81 −27 packages/plugin-defender-hardhat/test/propose-upgrade-uups.js
  151. +44 −0 packages/plugin-defender-hardhat/test/utils.js
  152. +105 −0 packages/plugin-defender-hardhat/test/verify-deployment.js
  153. +78 −0 packages/plugin-hardhat/CHANGELOG.md
  154. +2 −2 packages/plugin-hardhat/ava.config.js
  155. +187 −0 packages/plugin-hardhat/contracts/CustomProxy.sol
  156. +14 −5 packages/plugin-hardhat/package.json
  157. +5 −5 packages/plugin-hardhat/src/deploy-beacon-proxy.ts
  158. +3 −3 packages/plugin-hardhat/src/deploy-beacon.ts
  159. +24 −0 packages/plugin-hardhat/src/deploy-implementation.ts
  160. +19 −0 packages/plugin-hardhat/src/deploy-proxy-admin.ts
  161. +2 −10 packages/plugin-hardhat/src/deploy-proxy.ts
  162. +111 −0 packages/plugin-hardhat/src/force-import.ts
  163. +55 −3 packages/plugin-hardhat/src/index.ts
  164. +31 −15 packages/plugin-hardhat/src/prepare-upgrade.ts
  165. +3 −3 packages/plugin-hardhat/src/upgrade-beacon.ts
  166. +2 −2 packages/plugin-hardhat/src/upgrade-proxy.ts
  167. +53 −47 packages/plugin-hardhat/src/utils/deploy-impl.ts
  168. +68 −0 packages/plugin-hardhat/src/utils/etherscan-api.ts
  169. +2 −1 packages/plugin-hardhat/src/utils/index.ts
  170. +31 −7 packages/plugin-hardhat/src/utils/options.ts
  171. +60 −0 packages/plugin-hardhat/src/utils/simulate-deploy.ts
  172. +64 −0 packages/plugin-hardhat/src/utils/validate-impl.ts
  173. +32 −15 packages/plugin-hardhat/src/utils/validations.ts
  174. +18 −0 packages/plugin-hardhat/src/validate-implementation.ts
  175. +65 −0 packages/plugin-hardhat/src/validate-upgrade.ts
  176. +662 −0 packages/plugin-hardhat/src/verify-proxy.ts
  177. +28 −0 packages/plugin-hardhat/test/admin.js
  178. +7 −7 packages/plugin-hardhat/test/beacon-upgrade-block-proxy.js
  179. +8 −2 packages/plugin-hardhat/test/beacon-upgrade-storage.js
  180. +346 −0 packages/plugin-hardhat/test/implementation-functions.js
  181. +151 −0 packages/plugin-hardhat/test/import-with-deploy.js
  182. +338 −0 packages/plugin-hardhat/test/import.js
  183. +45 −0 packages/plugin-hardhat/test/prepare-upgrade-txresponse.js
  184. +6 −0 packages/plugin-hardhat/test/transparent-upgrade-storage.js
  185. +140 −0 packages/plugin-hardhat/test/use-deployed-implementation.js
  186. +6 −0 packages/plugin-hardhat/test/uups-upgrade-storage.js
  187. +34 −0 packages/plugin-truffle/CHANGELOG.md
  188. +3 −2 packages/plugin-truffle/package.json
  189. +4 −4 packages/plugin-truffle/src/admin.ts
  190. +6 −5 packages/plugin-truffle/src/deploy-beacon-proxy.ts
  191. +2 −2 packages/plugin-truffle/src/deploy-beacon.ts
  192. +9 −0 packages/plugin-truffle/src/deploy-implementation.ts
  193. +11 −0 packages/plugin-truffle/src/deploy-proxy-admin.ts
  194. +4 −10 packages/plugin-truffle/src/deploy-proxy.ts
  195. +100 −0 packages/plugin-truffle/src/force-import.ts
  196. +5 −0 packages/plugin-truffle/src/index.ts
  197. +16 −12 packages/plugin-truffle/src/prepare-upgrade.ts
  198. +2 −2 packages/plugin-truffle/src/upgrade-beacon.ts
  199. +17 −11 packages/plugin-truffle/src/upgrade-proxy.ts
  200. +3 −0 packages/plugin-truffle/src/utils/debug.ts
  201. +35 −49 packages/plugin-truffle/src/utils/deploy-impl.ts
  202. +36 −9 packages/plugin-truffle/src/utils/options.ts
  203. +45 −0 packages/plugin-truffle/src/utils/simulate-deploy.ts
  204. +5 −0 packages/plugin-truffle/src/utils/truffle.ts
  205. +65 −0 packages/plugin-truffle/src/utils/validate-impl.ts
  206. +53 −8 packages/plugin-truffle/src/utils/validations.ts
  207. +3 −3 packages/plugin-truffle/src/utils/wrap-provider.ts
  208. +10 −0 packages/plugin-truffle/src/validate-implementation.ts
  209. +62 −0 packages/plugin-truffle/src/validate-upgrade.ts
  210. +188 −0 packages/plugin-truffle/test/contracts/CustomProxy.sol
  211. +4 −1 packages/plugin-truffle/test/contracts/Greeter.sol
  212. +4 −1 packages/plugin-truffle/test/contracts/GreeterV2.sol
  213. +3 −0 packages/plugin-truffle/test/contracts/GreeterV3.sol
  214. +14 −0 packages/plugin-truffle/test/migrations/2_0_deploy_proxy_admin.js
  215. +10 −1 packages/plugin-truffle/test/migrations/2_1_deploy_greeter_transparent.js
  216. +10 −1 packages/plugin-truffle/test/migrations/2_2_deploy_greeter_uups.js
  217. +7 −1 packages/plugin-truffle/test/migrations/2_3_deploy_greeter_beacon.js
  218. +22 −0 packages/plugin-truffle/test/test/admin.js
  219. +8 −8 packages/plugin-truffle/test/test/beacon-upgrade-block-proxy.js
  220. +19 −0 packages/plugin-truffle/test/test/beacon-upgrade-storage.js
  221. +262 −0 packages/plugin-truffle/test/test/implementation-functions.js
  222. +116 −0 packages/plugin-truffle/test/test/import-with-deploy.js
  223. +272 −0 packages/plugin-truffle/test/test/import.js
  224. +19 −0 packages/plugin-truffle/test/test/transparent-upgrade-storage.js
  225. +126 −0 packages/plugin-truffle/test/test/use-deployed-implementation.js
  226. +19 −0 packages/plugin-truffle/test/test/uups-upgrade-storage.js
  227. +10 −0 packages/plugin-truffle/test/truffle-config.js
  228. +1 −1 renovate.json
  229. +1 −1 tsconfig.base.json
  230. +5,317 −11,041 yarn.lock
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ module.exports = {
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
env: {
node: true,
es2022: true,
},
plugins: ['unicorn'],
rules: {
13 changes: 13 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Setup

runs:
using: composite
steps:
- uses: actions/setup-node@v3
with:
node-version: 14.x
cache: yarn

- name: Install dependencies
run: yarn --frozen-lockfile --prefer-offline
shell: bash
57 changes: 57 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: checks

on:
push:
branches: [master]
pull_request: {}

concurrency:
group: checks-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up environment
uses: ./.github/actions/setup

- name: Run linter
run: yarn lint

tests:
strategy:
matrix:
package:
- core
- plugin-hardhat
- plugin-truffle
- plugin-defender-hardhat

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up environment
uses: ./.github/actions/setup

- name: Run tests
run: yarn --cwd "packages/${{matrix.package}}" run test

coverage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up environment
uses: ./.github/actions/setup

- name: Run coverage
run: yarn coverage

- uses: codecov/codecov-action@v3
40 changes: 0 additions & 40 deletions .github/workflows/coverage.yml

This file was deleted.

25 changes: 4 additions & 21 deletions .github/workflows/pack.yml
Original file line number Diff line number Diff line change
@@ -9,33 +9,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12.x

- name: Get yarn cache directory
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache node modules
uses: actions/cache@v2
with:
path: |
${{steps.yarn-cache-dir-path.outputs.dir}}
~/.cache/node-gyp-cache
key: ${{runner.os}}-yarn-${{env.cache-version}}-${{hashFiles('yarn.lock')}}
env:
cache-version: 2
- uses: actions/checkout@v3

- name: Install dependencies
run: yarn --frozen-lockfile
- name: Set up environment
uses: ./.github/actions/setup

- name: Pack tarballs
run: bash scripts/bundle-pack.sh

- name: Uplaod tarballs as artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: package
path: "*.tgz"
47 changes: 0 additions & 47 deletions .github/workflows/test.yml

This file was deleted.

1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

93 changes: 65 additions & 28 deletions docs/modules/ROOT/pages/api-core.adoc
Original file line number Diff line number Diff line change
@@ -4,55 +4,92 @@ The core logic to check for upgrade safety as well as storage layout compatibili

The package exports a standalone interface that works with https://docs.soliditylang.org/en/latest/using-the-compiler.html#compiler-input-and-output-json-description[Solidity input and output JSON objects].

[.hljs-theme-light.nopadding]
```javascript
[source,ts]
----
import { UpgradeableContract } from '@openzeppelin/upgrades-core';
```
----

== UpgradeableContract

This class represents the implementation for an upgradeable contract and gives access to error reports.

[.hljs-theme-light.nopadding]
```javascript
new UpgradeableContract(name, solcInput, solcOutput, opts?);
```

`opts` is an object with options as defined in xref:api-hardhat-upgrades.adoc#common-options[Common Options].
=== constructor UpgradeableContract
[source,ts]
----
constructor UpgradeableContract(
name: string,
solcInput: SolcInput,
solcOutput: SolcOutput,
opts?: {
unsafeAllow?: ValidationError[],
unsafeAllowRenames?: boolean,
unsafeSkipStorageCheck?: boolean,
kind?: 'uups' | 'transparent' | 'beacon',
},
): UpgradeableContract
----

Creates a new instance of `UpgradeableContract`.

*Parameters:*

* `name` - the name of the implementation contract as either a fully qualified name or contract name. If multiple contracts have the same name, you must use the fully qualified name e.g., `contracts/Bar.sol:Bar`.
* `solcInput` - the Solidity input JSON object for the implementation contract.
* `solcOutput` - the Solidity output JSON object for the implementation contract.
* `opts` - an object with options as defined in xref:api-hardhat-upgrades.adoc#common-options[Common Options].

TIP: In Hardhat, `solcInput` and `solcOutput` can be obtained from the Build Info file, which itself can be retrieved with `hre.artifacts.getBuildInfo`.

=== getErrorReport
=== .getErrorReport
[source,ts]
----
getErrorReport(): Report
----

Returns a report about errors pertaining to proxied contracts, e.g. the use of `selfdestruct`.
**Returns:**

[.hljs-theme-light.nopadding]
```javascript
contract.getErrorReport()
```
* a report about errors pertaining to proxied contracts, e.g. the use of `selfdestruct`.

=== getStorageUpgradeReport
=== .getStorageUpgradeReport
[source,ts]
----
getStorageUpgradeReport(
upgradedContract: UpgradeableContract,
opts?: {
unsafeAllow?: ValidationError[],
unsafeAllowRenames?: boolean,
unsafeSkipStorageCheck?: boolean,
kind?: 'uups' | 'transparent' | 'beacon',
},
): Report
----

Compares the storage layout of an upgradeable contract with that of a proposed upgrade. Receives as an argument another instance of `UpgradeableContract`.
Compares the storage layout of an upgradeable contract with that of a proposed upgrade.

[.hljs-theme-light.nopadding]
```javascript
contract.getStorageUpgradeReport(upgradedContract)
```
*Parameters:*

== Report
* `upgradedContract` - another instance of `UpgradeableContract` representing the proposed upgrade.

An object that represents the results of an analysis.
* `opts` - an object with options as defined in xref:api-hardhat-upgrades.adoc#common-options[Common Options].

**Returns:**

* a report about errors pertaining to proxied contracts, e.g. the use of `selfdestruct`, and storage layout conflicts.

[.hljs-theme-light.nopadding]
```typescript
== Report
[source,ts]
----
interface Report {
ok: boolean;
explain(color?: boolean): string;
}
```
----

An object that represents the results of an analysis.

**Members:**

The field `ok` is `false` if any errors were found, and `true` otherwise.
* `ok` - `false` if any errors were found, otherwise `true`.

The method `explain()` will return a message explaining the errors in detail, if any.
* `explain()` - returns a message explaining the errors in detail, if any.

Loading