From 8600b1233afa8994ccc5b16a8e9d46325f9b2ab1 Mon Sep 17 00:00:00 2001 From: Alain Olivier Date: Mon, 26 Feb 2024 17:40:08 +0100 Subject: [PATCH 01/15] chore(package.json): add @ledgerhq/hw-transport-node-hid --- package-lock.json | 670 +++++++++++++++++++++++++++++----------------- package.json | 1 + 2 files changed, 431 insertions(+), 240 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5625654..bd4af17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "devDependencies": { "@commitlint/config-conventional": "^18.5.0", "@ethersproject/hardware-wallets": "^5.7.0", + "@ledgerhq/hw-transport-node-hid": "^6.28.4", "@nomicfoundation/hardhat-chai-matchers": "^2.0.6", "@nomicfoundation/hardhat-ethers": "^3.0.5", "@nomicfoundation/hardhat-network-helpers": "^1.0.10", @@ -959,6 +960,129 @@ "@ledgerhq/hw-transport-node-hid": "5.26.0" } }, + "node_modules/@ethersproject/hardware-wallets/node_modules/@ledgerhq/hw-transport-node-hid": { + "version": "5.26.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-5.26.0.tgz", + "integrity": "sha512-qhaefZVZatJ6UuK8Wb6WSFNOLWc2mxcv/xgsfKi5HJCIr4bPF/ecIeN+7fRcEaycxj4XykY6Z4A7zDVulfFH4w==", + "dev": true, + "optional": true, + "dependencies": { + "@ledgerhq/devices": "^5.26.0", + "@ledgerhq/errors": "^5.26.0", + "@ledgerhq/hw-transport": "^5.26.0", + "@ledgerhq/hw-transport-node-hid-noevents": "^5.26.0", + "@ledgerhq/logs": "^5.26.0", + "lodash": "^4.17.20", + "node-hid": "1.3.0", + "usb": "^1.6.3" + } + }, + "node_modules/@ethersproject/hardware-wallets/node_modules/@ledgerhq/hw-transport-node-hid-noevents": { + "version": "5.51.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-5.51.1.tgz", + "integrity": "sha512-9wFf1L8ZQplF7XOY2sQGEeOhpmBRzrn+4X43kghZ7FBDoltrcK+s/D7S+7ffg3j2OySyP6vIIIgloXylao5Scg==", + "dev": true, + "optional": true, + "dependencies": { + "@ledgerhq/devices": "^5.51.1", + "@ledgerhq/errors": "^5.50.0", + "@ledgerhq/hw-transport": "^5.51.1", + "@ledgerhq/logs": "^5.50.0", + "node-hid": "2.1.1" + } + }, + "node_modules/@ethersproject/hardware-wallets/node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/@ledgerhq/hw-transport": { + "version": "5.51.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-5.51.1.tgz", + "integrity": "sha512-6wDYdbWrw9VwHIcoDnqWBaDFyviyjZWv6H9vz9Vyhe4Qd7TIFmbTl/eWs6hZvtZBza9K8y7zD8ChHwRI4s9tSw==", + "dev": true, + "optional": true, + "dependencies": { + "@ledgerhq/devices": "^5.51.1", + "@ledgerhq/errors": "^5.50.0", + "events": "^3.3.0" + } + }, + "node_modules/@ethersproject/hardware-wallets/node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/node-addon-api": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", + "dev": true, + "optional": true + }, + "node_modules/@ethersproject/hardware-wallets/node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/node-hid": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/node-hid/-/node-hid-2.1.1.tgz", + "integrity": "sha512-Skzhqow7hyLZU93eIPthM9yjot9lszg9xrKxESleEs05V2NcbUptZc5HFqzjOkSmL0sFlZFr3kmvaYebx06wrw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "bindings": "^1.5.0", + "node-addon-api": "^3.0.2", + "prebuild-install": "^6.0.0" + }, + "bin": { + "hid-showdevices": "src/show-devices.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@ethersproject/hardware-wallets/node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/prebuild-install": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.4.tgz", + "integrity": "sha512-Z4vpywnK1lBg+zdPCVCsKq0xO66eEV9rWo2zrROGGiRS4JtueBOdlB1FnY8lcy7JsUud/Q3ijUxyWN26Ika0vQ==", + "dev": true, + "optional": true, + "dependencies": { + "detect-libc": "^1.0.3", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^2.21.0", + "npmlog": "^4.0.1", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^3.0.3", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@ethersproject/hardware-wallets/node_modules/decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "dev": true, + "optional": true, + "dependencies": { + "mimic-response": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@ethersproject/hardware-wallets/node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "dev": true, + "optional": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/@ethersproject/hardware-wallets/node_modules/ethers": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", @@ -1007,6 +1131,123 @@ "@ethersproject/wordlists": "5.7.0" } }, + "node_modules/@ethersproject/hardware-wallets/node_modules/mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "dev": true, + "optional": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@ethersproject/hardware-wallets/node_modules/node-abi": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz", + "integrity": "sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==", + "dev": true, + "optional": true, + "dependencies": { + "semver": "^5.4.1" + } + }, + "node_modules/@ethersproject/hardware-wallets/node_modules/node-addon-api": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", + "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==", + "dev": true, + "optional": true + }, + "node_modules/@ethersproject/hardware-wallets/node_modules/node-hid": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/node-hid/-/node-hid-1.3.0.tgz", + "integrity": "sha512-BA6G4V84kiNd1uAChub/Z/5s/xS3EHBCxotQ0nyYrUG65mXewUDHE1tWOSqA2dp3N+mV0Ffq9wo2AW9t4p/G7g==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "bindings": "^1.5.0", + "nan": "^2.14.0", + "node-abi": "^2.18.0", + "prebuild-install": "^5.3.4" + }, + "bin": { + "hid-showdevices": "src/show-devices.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@ethersproject/hardware-wallets/node_modules/prebuild-install": { + "version": "5.3.6", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.6.tgz", + "integrity": "sha512-s8Aai8++QQGi4sSbs/M1Qku62PFK49Jm1CbgXklGz4nmHveDq0wzJkg7Na5QbnO1uNH8K7iqx2EQ/mV0MZEmOg==", + "dev": true, + "optional": true, + "dependencies": { + "detect-libc": "^1.0.3", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^2.7.0", + "noop-logger": "^0.1.1", + "npmlog": "^4.0.1", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^3.0.3", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0", + "which-pm-runs": "^1.0.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@ethersproject/hardware-wallets/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "optional": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/@ethersproject/hardware-wallets/node_modules/simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "dev": true, + "optional": true, + "dependencies": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/@ethersproject/hardware-wallets/node_modules/usb": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/usb/-/usb-1.9.2.tgz", + "integrity": "sha512-dryNz030LWBPAf6gj8vyq0Iev3vPbCLHCT8dBw3gQRXRzVNsIdeuU+VjPp3ksmSPkeMAl1k+kQ14Ij0QHyeiAg==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "node-addon-api": "^4.2.0", + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, "node_modules/@ethersproject/hash": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", @@ -1605,102 +1846,136 @@ } }, "node_modules/@ledgerhq/hw-transport-node-hid": { - "version": "5.26.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-5.26.0.tgz", - "integrity": "sha512-qhaefZVZatJ6UuK8Wb6WSFNOLWc2mxcv/xgsfKi5HJCIr4bPF/ecIeN+7fRcEaycxj4XykY6Z4A7zDVulfFH4w==", + "version": "6.28.4", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-6.28.4.tgz", + "integrity": "sha512-f6yQvZe4cwg6ibRn1YE9wWTdvpyT7FBIxxYHAd4RKm0l5/WFZS2G8CwdNJQwlOr89iBgGvEswWYh8EhUxM5QYA==", "dev": true, - "optional": true, "dependencies": { - "@ledgerhq/devices": "^5.26.0", - "@ledgerhq/errors": "^5.26.0", - "@ledgerhq/hw-transport": "^5.26.0", - "@ledgerhq/hw-transport-node-hid-noevents": "^5.26.0", - "@ledgerhq/logs": "^5.26.0", - "lodash": "^4.17.20", - "node-hid": "1.3.0", - "usb": "^1.6.3" + "@ledgerhq/devices": "^8.2.1", + "@ledgerhq/errors": "^6.16.2", + "@ledgerhq/hw-transport": "^6.30.4", + "@ledgerhq/hw-transport-node-hid-noevents": "^6.29.4", + "@ledgerhq/logs": "^6.12.0", + "lodash": "^4.17.21", + "node-hid": "^2.1.2", + "usb": "2.9.0" } }, "node_modules/@ledgerhq/hw-transport-node-hid-noevents": { - "version": "5.51.1", - "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-5.51.1.tgz", - "integrity": "sha512-9wFf1L8ZQplF7XOY2sQGEeOhpmBRzrn+4X43kghZ7FBDoltrcK+s/D7S+7ffg3j2OySyP6vIIIgloXylao5Scg==", + "version": "6.29.4", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-6.29.4.tgz", + "integrity": "sha512-g19nEwES/SIG9z0Zah6Y2zf883JCT57HSlHgR5DRHPrNXIJbJRZV/UbHQo3az/wZ642WmzGqkPUdmYGDjQu4rg==", "dev": true, - "optional": true, "dependencies": { - "@ledgerhq/devices": "^5.51.1", - "@ledgerhq/errors": "^5.50.0", - "@ledgerhq/hw-transport": "^5.51.1", - "@ledgerhq/logs": "^5.50.0", - "node-hid": "2.1.1" + "@ledgerhq/devices": "^8.2.1", + "@ledgerhq/errors": "^6.16.2", + "@ledgerhq/hw-transport": "^6.30.4", + "@ledgerhq/logs": "^6.12.0", + "node-hid": "^2.1.2" } }, + "node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/@ledgerhq/devices": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-8.2.1.tgz", + "integrity": "sha512-l/2I/Xzt7Z32OmGzoc/mUvaZivdn7Id/SO7hBTGpk7PtJTpBRxVAabP4GWEKCayGyOAcvTwoVxM0HMkNVfIzOQ==", + "dev": true, + "dependencies": { + "@ledgerhq/errors": "^6.16.2", + "@ledgerhq/logs": "^6.12.0", + "rxjs": "^7.8.1", + "semver": "^7.3.5" + } + }, + "node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/@ledgerhq/errors": { + "version": "6.16.2", + "resolved": "https://registry.npmjs.org/@ledgerhq/errors/-/errors-6.16.2.tgz", + "integrity": "sha512-jFpohaSW+p1Obp3NDT9QSByEtT3gtBZIjVNu8m25gnrH5zdtfPVlPwH6UiuS50s+2dHQyehV8hF+IfreKDWAZA==", + "dev": true + }, "node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/@ledgerhq/hw-transport": { - "version": "5.51.1", - "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-5.51.1.tgz", - "integrity": "sha512-6wDYdbWrw9VwHIcoDnqWBaDFyviyjZWv6H9vz9Vyhe4Qd7TIFmbTl/eWs6hZvtZBza9K8y7zD8ChHwRI4s9tSw==", + "version": "6.30.4", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-6.30.4.tgz", + "integrity": "sha512-VBcVd7UG8HDrjWMoZI5rqBDz+PBxLHTIPZOGY/fdMoEUwaBbss0Z3MxuJanMyerlfaLqnBSVuL0blz7rOyagkw==", "dev": true, - "optional": true, "dependencies": { - "@ledgerhq/devices": "^5.51.1", - "@ledgerhq/errors": "^5.50.0", + "@ledgerhq/devices": "^8.2.1", + "@ledgerhq/errors": "^6.16.2", + "@ledgerhq/logs": "^6.12.0", "events": "^3.3.0" } }, - "node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/node-addon-api": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", - "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", - "dev": true, - "optional": true + "node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/@ledgerhq/logs": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/logs/-/logs-6.12.0.tgz", + "integrity": "sha512-ExDoj1QV5eC6TEbMdLUMMk9cfvNKhhv5gXol4SmULRVCx/3iyCPhJ74nsb3S0Vb+/f+XujBEj3vQn5+cwS0fNA==", + "dev": true }, - "node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/node-hid": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/node-hid/-/node-hid-2.1.1.tgz", - "integrity": "sha512-Skzhqow7hyLZU93eIPthM9yjot9lszg9xrKxESleEs05V2NcbUptZc5HFqzjOkSmL0sFlZFr3kmvaYebx06wrw==", + "node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", "dev": true, - "hasInstallScript": true, - "optional": true, "dependencies": { - "bindings": "^1.5.0", - "node-addon-api": "^3.0.2", - "prebuild-install": "^6.0.0" - }, - "bin": { - "hid-showdevices": "src/show-devices.js" - }, - "engines": { - "node": ">=10" + "tslib": "^2.1.0" + } + }, + "node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, + "node_modules/@ledgerhq/hw-transport-node-hid/node_modules/@ledgerhq/devices": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-8.2.1.tgz", + "integrity": "sha512-l/2I/Xzt7Z32OmGzoc/mUvaZivdn7Id/SO7hBTGpk7PtJTpBRxVAabP4GWEKCayGyOAcvTwoVxM0HMkNVfIzOQ==", + "dev": true, + "dependencies": { + "@ledgerhq/errors": "^6.16.2", + "@ledgerhq/logs": "^6.12.0", + "rxjs": "^7.8.1", + "semver": "^7.3.5" } }, - "node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/prebuild-install": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.4.tgz", - "integrity": "sha512-Z4vpywnK1lBg+zdPCVCsKq0xO66eEV9rWo2zrROGGiRS4JtueBOdlB1FnY8lcy7JsUud/Q3ijUxyWN26Ika0vQ==", + "node_modules/@ledgerhq/hw-transport-node-hid/node_modules/@ledgerhq/errors": { + "version": "6.16.2", + "resolved": "https://registry.npmjs.org/@ledgerhq/errors/-/errors-6.16.2.tgz", + "integrity": "sha512-jFpohaSW+p1Obp3NDT9QSByEtT3gtBZIjVNu8m25gnrH5zdtfPVlPwH6UiuS50s+2dHQyehV8hF+IfreKDWAZA==", + "dev": true + }, + "node_modules/@ledgerhq/hw-transport-node-hid/node_modules/@ledgerhq/hw-transport": { + "version": "6.30.4", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-6.30.4.tgz", + "integrity": "sha512-VBcVd7UG8HDrjWMoZI5rqBDz+PBxLHTIPZOGY/fdMoEUwaBbss0Z3MxuJanMyerlfaLqnBSVuL0blz7rOyagkw==", "dev": true, - "optional": true, "dependencies": { - "detect-libc": "^1.0.3", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^1.0.1", - "node-abi": "^2.21.0", - "npmlog": "^4.0.1", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^3.0.3", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0" - }, - "bin": { - "prebuild-install": "bin.js" - }, - "engines": { - "node": ">=6" + "@ledgerhq/devices": "^8.2.1", + "@ledgerhq/errors": "^6.16.2", + "@ledgerhq/logs": "^6.12.0", + "events": "^3.3.0" + } + }, + "node_modules/@ledgerhq/hw-transport-node-hid/node_modules/@ledgerhq/logs": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/logs/-/logs-6.12.0.tgz", + "integrity": "sha512-ExDoj1QV5eC6TEbMdLUMMk9cfvNKhhv5gXol4SmULRVCx/3iyCPhJ74nsb3S0Vb+/f+XujBEj3vQn5+cwS0fNA==", + "dev": true + }, + "node_modules/@ledgerhq/hw-transport-node-hid/node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dev": true, + "dependencies": { + "tslib": "^2.1.0" } }, + "node_modules/@ledgerhq/hw-transport-node-hid/node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, "node_modules/@ledgerhq/hw-transport-u2f": { "version": "5.26.0", "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-u2f/-/hw-transport-u2f-5.26.0.tgz", @@ -3305,6 +3580,12 @@ "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "dev": true }, + "node_modules/@types/w3c-web-usb": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@types/w3c-web-usb/-/w3c-web-usb-1.0.10.tgz", + "integrity": "sha512-CHgUI5kTc/QLMP8hODUHhge0D4vx+9UiAwIGiT0sTy/B2XpdX1U5rJt6JSISgr6ikRT7vxV9EVAFeYZqUnl1gQ==", + "dev": true + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "5.62.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", @@ -4183,7 +4464,6 @@ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "dev": true, - "optional": true, "dependencies": { "file-uri-to-path": "1.0.0" } @@ -4193,7 +4473,6 @@ "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "dev": true, - "optional": true, "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -4219,7 +4498,6 @@ "url": "https://feross.org/support" } ], - "optional": true, "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -5485,16 +5763,18 @@ } }, "node_modules/decompress-response": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", - "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", "dev": true, - "optional": true, "dependencies": { - "mimic-response": "^2.0.0" + "mimic-response": "^3.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/deep-eql": { @@ -5603,16 +5883,12 @@ } }, "node_modules/detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", "dev": true, - "optional": true, - "bin": { - "detect-libc": "bin/detect-libc.js" - }, "engines": { - "node": ">=0.10" + "node": ">=8" } }, "node_modules/diff": { @@ -6832,7 +7108,6 @@ "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", "dev": true, - "optional": true, "engines": { "node": ">=6" } @@ -7108,8 +7383,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true, - "optional": true + "dev": true }, "node_modules/fill-range": { "version": "7.0.1", @@ -7290,8 +7564,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true, - "optional": true + "dev": true }, "node_modules/fs-extra": { "version": "7.0.1", @@ -7656,8 +7929,7 @@ "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", - "dev": true, - "optional": true + "dev": true }, "node_modules/glob": { "version": "7.2.0", @@ -7800,33 +8072,6 @@ "url": "https://github.com/sindresorhus/got?sponsor=1" } }, - "node_modules/got/node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dev": true, - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/got/node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -10457,13 +10702,12 @@ } }, "node_modules/mimic-response": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", - "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", "dev": true, - "optional": true, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -10581,8 +10825,7 @@ "version": "0.5.3", "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", - "dev": true, - "optional": true + "dev": true }, "node_modules/mkdirp-promise": { "version": "5.0.1", @@ -10905,8 +11148,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", - "dev": true, - "optional": true + "dev": true }, "node_modules/natural-compare": { "version": "1.4.0", @@ -10945,23 +11187,15 @@ "dev": true }, "node_modules/node-abi": { - "version": "2.30.1", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz", - "integrity": "sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==", + "version": "3.56.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.56.0.tgz", + "integrity": "sha512-fZjdhDOeRcaS+rcpve7XuwHBmktS1nS1gzgghwKUQQ8nTy2FdSDr6ZT8k6YhvlJeHmmQMYiT/IH9hfco5zeW2Q==", "dev": true, - "optional": true, "dependencies": { - "semver": "^5.4.1" - } - }, - "node_modules/node-abi/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, - "optional": true, - "bin": { - "semver": "bin/semver" + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" } }, "node_modules/node-addon-api": { @@ -11002,25 +11236,29 @@ } }, "node_modules/node-hid": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/node-hid/-/node-hid-1.3.0.tgz", - "integrity": "sha512-BA6G4V84kiNd1uAChub/Z/5s/xS3EHBCxotQ0nyYrUG65mXewUDHE1tWOSqA2dp3N+mV0Ffq9wo2AW9t4p/G7g==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/node-hid/-/node-hid-2.2.0.tgz", + "integrity": "sha512-vj48zh9j555DZzUhMc8tk/qw6xPFrDyPBH1ST1Z/hWaA/juBJw7IuSxPeOgpzNFNU36mGYj+THioRMt1xOdm/g==", "dev": true, "hasInstallScript": true, - "optional": true, "dependencies": { "bindings": "^1.5.0", - "nan": "^2.14.0", - "node-abi": "^2.18.0", - "prebuild-install": "^5.3.4" + "node-addon-api": "^3.0.2", + "prebuild-install": "^7.1.1" }, "bin": { "hid-showdevices": "src/show-devices.js" }, "engines": { - "node": ">=6.0.0" + "node": ">=10" } }, + "node_modules/node-hid/node_modules/node-addon-api": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", + "dev": true + }, "node_modules/nofilter": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-3.1.0.tgz", @@ -11566,33 +11804,29 @@ } }, "node_modules/prebuild-install": { - "version": "5.3.6", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.6.tgz", - "integrity": "sha512-s8Aai8++QQGi4sSbs/M1Qku62PFK49Jm1CbgXklGz4nmHveDq0wzJkg7Na5QbnO1uNH8K7iqx2EQ/mV0MZEmOg==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", + "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", "dev": true, - "optional": true, "dependencies": { - "detect-libc": "^1.0.3", + "detect-libc": "^2.0.0", "expand-template": "^2.0.3", "github-from-package": "0.0.0", "minimist": "^1.2.3", "mkdirp-classic": "^0.5.3", "napi-build-utils": "^1.0.1", - "node-abi": "^2.7.0", - "noop-logger": "^0.1.1", - "npmlog": "^4.0.1", + "node-abi": "^3.3.0", "pump": "^3.0.0", "rc": "^1.2.7", - "simple-get": "^3.0.3", + "simple-get": "^4.0.0", "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0", - "which-pm-runs": "^1.0.0" + "tunnel-agent": "^0.6.0" }, "bin": { "prebuild-install": "bin.js" }, "engines": { - "node": ">=6" + "node": ">=10" } }, "node_modules/prelude-ls": { @@ -12931,13 +13165,26 @@ ] }, "node_modules/simple-get": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", - "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", "dev": true, - "optional": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "dependencies": { - "decompress-response": "^4.2.0", + "decompress-response": "^6.0.0", "once": "^1.3.1", "simple-concat": "^1.0.0" } @@ -13623,21 +13870,6 @@ "node": ">=8" } }, - "node_modules/swarm-js/node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dev": true, - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/swarm-js/node_modules/fs-extra": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", @@ -13711,18 +13943,6 @@ "node": ">=8" } }, - "node_modules/swarm-js/node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/swarm-js/node_modules/normalize-url": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", @@ -13866,7 +14086,6 @@ "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", "dev": true, - "optional": true, "dependencies": { "chownr": "^1.1.1", "mkdirp-classic": "^0.5.2", @@ -13879,7 +14098,6 @@ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", "dev": true, - "optional": true, "dependencies": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", @@ -14432,26 +14650,25 @@ "dev": true }, "node_modules/usb": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/usb/-/usb-1.9.2.tgz", - "integrity": "sha512-dryNz030LWBPAf6gj8vyq0Iev3vPbCLHCT8dBw3gQRXRzVNsIdeuU+VjPp3ksmSPkeMAl1k+kQ14Ij0QHyeiAg==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/usb/-/usb-2.9.0.tgz", + "integrity": "sha512-G0I/fPgfHUzWH8xo2KkDxTTFruUWfppgSFJ+bQxz/kVY2x15EQ/XDB7dqD1G432G4gBG4jYQuF3U7j/orSs5nw==", "dev": true, "hasInstallScript": true, - "optional": true, "dependencies": { - "node-addon-api": "^4.2.0", - "node-gyp-build": "^4.3.0" + "@types/w3c-web-usb": "^1.0.6", + "node-addon-api": "^6.0.0", + "node-gyp-build": "^4.5.0" }, "engines": { - "node": ">=10.16.0" + "node": ">=10.20.0 <11.x || >=12.17.0 <13.0 || >=14.0.0" } }, "node_modules/usb/node_modules/node-addon-api": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", - "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==", - "dev": true, - "optional": true + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", + "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==", + "dev": true }, "node_modules/utf-8-validate": { "version": "5.0.10", @@ -14651,21 +14868,6 @@ "node": ">=8" } }, - "node_modules/web3-bzz/node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dev": true, - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/web3-bzz/node_modules/form-data-encoder": { "version": "1.7.1", "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.1.tgz", @@ -14699,18 +14901,6 @@ "url": "https://github.com/sindresorhus/got?sponsor=1" } }, - "node_modules/web3-bzz/node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/web3-bzz/node_modules/normalize-url": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", diff --git a/package.json b/package.json index a70043a..a4c2ecd 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "devDependencies": { "@commitlint/config-conventional": "^18.5.0", "@ethersproject/hardware-wallets": "^5.7.0", + "@ledgerhq/hw-transport-node-hid": "^6.28.4", "@nomicfoundation/hardhat-chai-matchers": "^2.0.6", "@nomicfoundation/hardhat-ethers": "^3.0.5", "@nomicfoundation/hardhat-network-helpers": "^1.0.10", From 9b9cf5b18443be2760f2da8e31a3cdfeb3a263c7 Mon Sep 17 00:00:00 2001 From: Alain Olivier Date: Mon, 26 Feb 2024 18:01:06 +0100 Subject: [PATCH 02/15] fix(tasks): fix getAdapter() usage in upgrade-safe task --- tasks/upgrade-safe.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/upgrade-safe.js b/tasks/upgrade-safe.js index 18870c5..25619cf 100644 --- a/tasks/upgrade-safe.js +++ b/tasks/upgrade-safe.js @@ -58,7 +58,7 @@ const proposeUpgrade = async (_args, _hre) => { const upgradeTransactionData = factory.interface.encodeFunctionData('upgradeTo', [newImplementation]) - const adapter = getAdapter(_hre.ethers, _args[PARAM_FLAG_LEDGER_WALLET]) + const adapter = await getAdapter(_hre.ethers, _args[PARAM_FLAG_LEDGER_WALLET]) await proposeTransactionToSafe( adapter, From ef66b6986d239e325aab5cc40cccf736466b6d2f Mon Sep 17 00:00:00 2001 From: Alain Olivier Date: Mon, 26 Feb 2024 18:40:00 +0100 Subject: [PATCH 03/15] refactor(tasks): define task parameters in constants --- lib/constants.js | 33 +++++++++++++++------- tasks/acl-permission.js | 45 +++++++++++++++++------------- tasks/check-permissions.js | 16 +++++++---- tasks/decode-forwarder-metadata.js | 5 +++- tasks/upgrade-safe.js | 39 +++++++++++++++----------- tasks/upgrade.js | 10 ++++--- 6 files changed, 91 insertions(+), 57 deletions(-) diff --git a/lib/constants.js b/lib/constants.js index 2ea0bd3..b77f293 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -71,16 +71,29 @@ module.exports = { INFINITE: '0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' }, TASKS: { - PARAM_NAME_ADDRESS: 'address', - PARAM_NAME_ENTITY: 'entity', - PARAM_NAME_FACTORY: 'factory', - PARAM_FLAG_NEW_IMPLEMENTATION: 'implementation', + PARAM_ADDRESS: 'address', + PARAM_DESC_ADDRESS: 'Address', + PARAM_ENTITY: 'entity', + PARAM_DESC_ENTITY: 'Address to which role will be granted/revoked', + PARAM_IMPLEMENTATION: 'implementation', + PARAM_DESC_IMPLEMENTATION: 'New implementation address', PARAM_FLAG_LEDGER_WALLET: 'ledger', - PARAM_NAME_PROXY_ADDRESS: 'proxy', - PARAM_NAME_ROLE: 'role', - PARAM_NAME_SAFE_ADDRESS: 'safe', - PARAM_NAME_TARGET: 'target', - PARAM_NAME_REVOKE: 'revoke', - PARAM_NAME_GRANT: 'grant' + PARAM_DESC_FLAG_LEDGER_WALLET: 'Use a Ledger wallet', + PARAM_PROXY_ADDRESS: 'proxy', + PARAM_DESC_PROXY_ADDRESS: 'Proxy address', + PARAM_ROLE: 'role', + PARAM_DESC_ROLE: 'Role name to be managed', + PARAM_SAFE_ADDRESS: 'safe', + PARAM_DESC_SAFE_ADDRESS: 'Safe address', + PARAM_TARGET: 'target', + PARAM_DESC_TARGET: 'Target contract address', + PARAM_REVOKE: 'revoke', + PARAM_DESC_REVOKE: 'Revoke a role', + PARAM_GRANT: 'grant', + PARAM_DESC_GRANT: 'Grant a role', + PARAM_METADATA: 'metadata', + PARAM_DESC_METADATA: 'pNetwork metadata', + PARAM_CONTRACT_FACTORY: 'factory', + PARAM_DESC_CONTRACT_FACTORY: "Contract factory name (e.g. 'EpochsManager')" } } diff --git a/tasks/acl-permission.js b/tasks/acl-permission.js index 61b271a..9c87fa1 100644 --- a/tasks/acl-permission.js +++ b/tasks/acl-permission.js @@ -3,24 +3,31 @@ const { task } = require('hardhat/config') const { TASKS: { - PARAM_NAME_ENTITY, - PARAM_NAME_TARGET, - PARAM_NAME_ROLE, - PARAM_NAME_SAFE_ADDRESS, + PARAM_ENTITY, + PARAM_DESC_ENTITY, + PARAM_TARGET, + PARAM_DESC_TARGET, + PARAM_ROLE, + PARAM_DESC_ROLE, + PARAM_SAFE_ADDRESS, + PARAM_DESC_SAFE_ADDRESS, PARAM_FLAG_LEDGER_WALLET, - PARAM_NAME_REVOKE, - PARAM_NAME_GRANT + PARAM_DESC_FLAG_LEDGER_WALLET, + PARAM_REVOKE, + PARAM_DESC_REVOKE, + PARAM_GRANT, + PARAM_DESC_GRANT } } = require('../lib/constants') const { getAllRoles } = require('../lib/roles') const { getAdapter, proposeTransactionToSafe } = require('../lib/safe') const proposeGrantRole = async (_args, _hre) => { - const safeAddress = _args[PARAM_NAME_SAFE_ADDRESS] - const targetAddress = _args[PARAM_NAME_TARGET] - const entity = _args[PARAM_NAME_ENTITY] - const role = _args[PARAM_NAME_ROLE] - const revoke = !_args[PARAM_NAME_GRANT] || _args[PARAM_NAME_REVOKE] + const safeAddress = _args[PARAM_SAFE_ADDRESS] + const targetAddress = _args[PARAM_TARGET] + const entity = _args[PARAM_ENTITY] + const role = _args[PARAM_ROLE] + const revoke = !_args[PARAM_GRANT] || _args[PARAM_REVOKE] const roles = getAllRoles(_hre.ethers) @@ -45,7 +52,7 @@ const proposeGrantRole = async (_args, _hre) => { } const actionConfirm = new Confirm({ - message: `${revoke ? 'Revoke' : 'Grant'} ${_args[PARAM_NAME_ROLE]} to ${entity} @ ${targetAddress}?` + message: `${revoke ? 'Revoke' : 'Grant'} ${_args[PARAM_ROLE]} to ${entity} @ ${targetAddress}?` }) if (!(await actionConfirm.run())) { console.info('Quitting') @@ -63,11 +70,11 @@ const proposeGrantRole = async (_args, _hre) => { } task('permissions:acl-manage', 'Propose grant/revoke role transaction to safe multisig') - .addFlag(PARAM_NAME_REVOKE, 'Revoke a role') - .addFlag(PARAM_NAME_GRANT, 'Grant a role') - .addPositionalParam(PARAM_NAME_ROLE, 'Role name to be managed') - .addPositionalParam(PARAM_NAME_ENTITY, 'Address to which role will be granted/revoked') - .addPositionalParam(PARAM_NAME_TARGET, 'Target contract address') - .addPositionalParam(PARAM_NAME_SAFE_ADDRESS, 'Safe address') - .addFlag(PARAM_FLAG_LEDGER_WALLET, 'Use a Ledger wallet') + .addFlag(PARAM_REVOKE, PARAM_DESC_REVOKE) + .addFlag(PARAM_GRANT, PARAM_DESC_GRANT) + .addPositionalParam(PARAM_ROLE, PARAM_DESC_ROLE) + .addPositionalParam(PARAM_ENTITY, PARAM_DESC_ENTITY) + .addPositionalParam(PARAM_TARGET, PARAM_DESC_TARGET) + .addPositionalParam(PARAM_SAFE_ADDRESS, PARAM_DESC_SAFE_ADDRESS) + .addFlag(PARAM_FLAG_LEDGER_WALLET, PARAM_DESC_FLAG_LEDGER_WALLET) .setAction(proposeGrantRole) diff --git a/tasks/check-permissions.js b/tasks/check-permissions.js index bd85e8a..0f28bf4 100644 --- a/tasks/check-permissions.js +++ b/tasks/check-permissions.js @@ -1,10 +1,12 @@ const { task } = require('hardhat/config') const ACLAbi = require('../lib/abi/ACL.json') -const { ADDRESSES } = require('../lib/constants') +const { + ADDRESSES, + TASKS: { PARAM_ADDRESS, PARAM_DESC_ADDRESS } +} = require('../lib/constants') const { getAllRoles } = require('../lib/roles') -const PARAM_CONTRACT_ADDRESS = 'address' const FIRST_BLOCK = { GNOSIS: 31195110, MAINNET: 10565704 @@ -68,12 +70,14 @@ const main = async (_params, { ethers, network }) => { } try { - await tryAccessControlEnumerableUpgradeable(_params[PARAM_CONTRACT_ADDRESS], roles) + await tryAccessControlEnumerableUpgradeable(_params[PARAM_ADDRESS], roles) } catch (_err) { console.info('Failed with AccessControlEnumerableUpgradeable') - await tryACL(_params[PARAM_CONTRACT_ADDRESS], roles) + await tryACL(_params[PARAM_ADDRESS], roles) } - await tryCheckOwner(_params[PARAM_CONTRACT_ADDRESS]) + await tryCheckOwner(_params[PARAM_ADDRESS]) } -task('permissions:check', 'Check permissions for a contract').setAction(main).addPositionalParam(PARAM_CONTRACT_ADDRESS) +task('permissions:check', 'Check permissions for a contract') + .setAction(main) + .addPositionalParam(PARAM_ADDRESS, PARAM_DESC_ADDRESS) diff --git a/tasks/decode-forwarder-metadata.js b/tasks/decode-forwarder-metadata.js index 357f3a5..11bf502 100644 --- a/tasks/decode-forwarder-metadata.js +++ b/tasks/decode-forwarder-metadata.js @@ -1,9 +1,12 @@ const { task, types } = require('hardhat/config') +const { + TASKS: { PARAM_METADATA, PARAM_DESC_METADATA } +} = require('../lib/constants') const { decodeMetadata } = require('../lib/metadata') task('utils:decode-forwarder-metadata', 'Decode the pNetwork Forwarder Metadata') - .addPositionalParam('metadata', 'The pNetwork Metadata', undefined, types.string, false) + .addPositionalParam(PARAM_METADATA, PARAM_DESC_METADATA, undefined, types.string, false) .setAction(async (_taskArgs, { ethers }) => { const { metadata } = _taskArgs diff --git a/tasks/upgrade-safe.js b/tasks/upgrade-safe.js index 25619cf..7875f9c 100644 --- a/tasks/upgrade-safe.js +++ b/tasks/upgrade-safe.js @@ -3,19 +3,24 @@ const { task } = require('hardhat/config') const { TASKS: { - PARAM_NAME_FACTORY, - PARAM_NAME_PROXY_ADDRESS, - PARAM_NAME_SAFE_ADDRESS, - PARAM_FLAG_NEW_IMPLEMENTATION, - PARAM_FLAG_LEDGER_WALLET + PARAM_PROXY_ADDRESS, + PARAM_DESC_PROXY_ADDRESS, + PARAM_SAFE_ADDRESS, + PARAM_DESC_SAFE_ADDRESS, + PARAM_IMPLEMENTATION, + PARAM_DESC_IMPLEMENTATION, + PARAM_FLAG_LEDGER_WALLET, + PARAM_DESC_FLAG_LEDGER_WALLET, + PARAM_CONTRACT_FACTORY, + PARAM_DESC_CONTRACT_FACTORY } } = require('../lib/constants') const { getAllRoles } = require('../lib/roles') const { getAdapter, proposeTransactionToSafe } = require('../lib/safe') const proposeUpgrade = async (_args, _hre) => { - const safeAddress = _args[PARAM_NAME_SAFE_ADDRESS] - const proxyAddress = _args[PARAM_NAME_PROXY_ADDRESS] + const safeAddress = _args[PARAM_SAFE_ADDRESS] + const proxyAddress = _args[PARAM_PROXY_ADDRESS] const { UPGRADE_ROLE } = getAllRoles(_hre.ethers) const proxyAccessControl = await _hre.ethers.getContractAt('AccessControlUpgradeable', proxyAddress) @@ -25,15 +30,15 @@ const proposeUpgrade = async (_args, _hre) => { return } - const factoryName = _args[PARAM_NAME_FACTORY] + const factoryName = _args[PARAM_CONTRACT_FACTORY] const factory = await _hre.ethers.getContractFactory(factoryName) console.info(`✔ Validating new implementation of ${factoryName} against proxy ${proxyAddress}...`) await _hre.upgrades.validateUpgrade(proxyAddress, factory) let newImplementation - if (_args[PARAM_FLAG_NEW_IMPLEMENTATION]) { - newImplementation = _args[PARAM_FLAG_NEW_IMPLEMENTATION] + if (_args[PARAM_IMPLEMENTATION]) { + newImplementation = _args[PARAM_IMPLEMENTATION] console.info(`✔ Using new implementation ${newImplementation}`) } else { console.info('✘ No new implementation provided') @@ -62,8 +67,8 @@ const proposeUpgrade = async (_args, _hre) => { await proposeTransactionToSafe( adapter, - _args[PARAM_NAME_SAFE_ADDRESS], - _args[PARAM_NAME_PROXY_ADDRESS], + _args[PARAM_SAFE_ADDRESS], + _args[PARAM_PROXY_ADDRESS], 0, upgradeTransactionData ) @@ -71,9 +76,9 @@ const proposeUpgrade = async (_args, _hre) => { } task('upgrade:proxy-safe', 'Propose contract upgrade to safe multisig') - .addPositionalParam(PARAM_NAME_FACTORY, 'Name of the contract to upgrade') - .addPositionalParam(PARAM_NAME_PROXY_ADDRESS, 'Proxy address') - .addPositionalParam(PARAM_NAME_SAFE_ADDRESS, 'Safe address') - .addOptionalParam(PARAM_FLAG_NEW_IMPLEMENTATION, 'New implementation address') - .addFlag(PARAM_FLAG_LEDGER_WALLET, 'Use a Ledger wallet') + .addPositionalParam(PARAM_CONTRACT_FACTORY, PARAM_DESC_CONTRACT_FACTORY) + .addPositionalParam(PARAM_PROXY_ADDRESS, PARAM_DESC_PROXY_ADDRESS) + .addPositionalParam(PARAM_SAFE_ADDRESS, PARAM_DESC_SAFE_ADDRESS) + .addOptionalParam(PARAM_IMPLEMENTATION, PARAM_DESC_IMPLEMENTATION) + .addFlag(PARAM_FLAG_LEDGER_WALLET, PARAM_DESC_FLAG_LEDGER_WALLET) .setAction(proposeUpgrade) diff --git a/tasks/upgrade.js b/tasks/upgrade.js index 9cac980..d2fe39a 100644 --- a/tasks/upgrade.js +++ b/tasks/upgrade.js @@ -1,14 +1,16 @@ const { task } = require('hardhat/config') +const { + TASKS: { PARAM_CONTRACT_FACTORY, PARAM_DESC_CONTRACT_FACTORY, PARAM_ADDRESS, PARAM_DESC_PROXY_ADDRESS } +} = require('../lib/constants') + const upgrade = async (_args, _hre) => { const factory = await _hre.ethers.getContractFactory(_args.factory) const address = _args.address - console.info('factory', factory) - console.info('address', address) await _hre.upgrades.upgradeProxy(address, factory) } task('upgrade:proxy', 'Upgrade proxy') .setAction(upgrade) - .addPositionalParam('factory', 'Contract name') - .addPositionalParam('address', 'Proxy address') + .addPositionalParam(PARAM_CONTRACT_FACTORY, PARAM_DESC_CONTRACT_FACTORY) + .addPositionalParam(PARAM_ADDRESS, PARAM_DESC_PROXY_ADDRESS) From 6b64a46b129909606d995b8de01f8a9869214ac5 Mon Sep 17 00:00:00 2001 From: Alain Olivier Date: Mon, 26 Feb 2024 18:41:55 +0100 Subject: [PATCH 04/15] feat(tasks): add task to force-import proxy into .openzeppelin --- tasks/force-import.js | 16 ++++++++++++++++ tasks/index.js | 1 + 2 files changed, 17 insertions(+) create mode 100644 tasks/force-import.js diff --git a/tasks/force-import.js b/tasks/force-import.js new file mode 100644 index 0000000..c6a3a15 --- /dev/null +++ b/tasks/force-import.js @@ -0,0 +1,16 @@ +const { types, task } = require('hardhat/config') + +const { + TASKS: { PARAM_CONTRACT_FACTORY, PARAM_DESC_CONTRACT_FACTORY, PARAM_PROXY_ADDRESS, PARAM_DESC_PROXY_ADDRESS } +} = require('../lib/constants') + +const forceImport = (_taskArgs, _hre) => + console.info('Forcing import for contract...') || + _hre.ethers + .getContractFactory(_taskArgs[PARAM_CONTRACT_FACTORY]) + .then((_contractFactory) => _hre.upgrades.forceImport(_taskArgs[PARAM_PROXY_ADDRESS], _contractFactory)) + .then((_) => console.info('Imported successfully!')) + +task('utils:force-import', 'Force import an already deployed proxy', forceImport) + .addPositionalParam(PARAM_PROXY_ADDRESS, PARAM_DESC_PROXY_ADDRESS, undefined, types.string) + .addPositionalParam(PARAM_CONTRACT_FACTORY, PARAM_DESC_CONTRACT_FACTORY, undefined, types.string) diff --git a/tasks/index.js b/tasks/index.js index 7def657..4f48a60 100644 --- a/tasks/index.js +++ b/tasks/index.js @@ -7,6 +7,7 @@ require('./deploy_forwarder_bsc') require('./deploy_forwarder_gnosis') require('./deploy_forwarder_mainnet') require('./deploy_forwarder_polygon') +require('./force-import') require('./get-roles') require('./set_permissions') require('./upgrade') From 15d0d9a4ad976cebf5bbe2036628a42ac72280ce Mon Sep 17 00:00:00 2001 From: Alain Olivier Date: Mon, 26 Feb 2024 18:43:41 +0100 Subject: [PATCH 05/15] test(fork): move checkInitialized() outside missingSteps() --- test/fork/dao.test.js | 69 ++++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/test/fork/dao.test.js b/test/fork/dao.test.js index 3770b35..8402e77 100644 --- a/test/fork/dao.test.js +++ b/test/fork/dao.test.js @@ -173,50 +173,30 @@ describe('Integration tests on Gnosis deployment', () => { await rewardsManager.connect(daoOwner).grantRole(DEPOSIT_REWARD_ROLE, DANDELION_VOTING_ADDRESS) } - const upgradeContracts = async () => { - await epochsManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) - await stakingManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) - await stakingManagerLm.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) - await stakingManagerRm.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) - await lendingManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) - await registrationManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) - await feesManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) - await rewardsManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) - - const currentEpoch = await epochsManager.currentEpoch() - await upgrades.upgradeProxy(epochsManager, EpochsManager) - expect(await await epochsManager.currentEpoch()).to.be.eq(currentEpoch) - await upgrades.upgradeProxy(stakingManager, StakingManager) - await upgrades.upgradeProxy(stakingManagerLm, StakingManagerPermissioned) - await upgrades.upgradeProxy(stakingManagerRm, StakingManagerPermissioned) - await upgrades.upgradeProxy(lendingManager, LendingManager) - await upgrades.upgradeProxy(registrationManager, RegistrationManager) - await upgrades.upgradeProxy(feesManager, FeesManager) - await upgrades.upgradeProxy(rewardsManager, RewardsManager) - + const checkInitialized = async () => { // check implementations cannot be initialized - const checkInitialized = async (_factory, _proxyAddress, _initArgs) => { + const _checkInitialized = async (_factory, _proxyAddress, _initArgs) => { const implAddress = await upgrades.erc1967.getImplementationAddress(_proxyAddress) const contract = _factory.attach(implAddress) await expect(contract.initialize(..._initArgs)).to.be.revertedWith( 'Initializable: contract is already initialized' ) } - await checkInitialized(EpochsManager, epochsManager.target, [0, 0]) - await checkInitialized(StakingManager, stakingManager.target, [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, 0]) - await checkInitialized(StakingManagerPermissioned, stakingManagerLm.target, [ + await _checkInitialized(EpochsManager, epochsManager.target, [0, 0]) + await _checkInitialized(StakingManager, stakingManager.target, [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, 0]) + await _checkInitialized(StakingManagerPermissioned, stakingManagerLm.target, [ ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, 0 ]) - await checkInitialized(StakingManagerPermissioned, stakingManagerRm.target, [ + await _checkInitialized(StakingManagerPermissioned, stakingManagerRm.target, [ ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, 0 ]) - await checkInitialized(LendingManager, lendingManager.target, [ + await _checkInitialized(LendingManager, lendingManager.target, [ ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, @@ -224,21 +204,48 @@ describe('Integration tests on Gnosis deployment', () => { ZERO_ADDRESS, 0 ]) - await checkInitialized(RegistrationManager, registrationManager.target, [ + await _checkInitialized(RegistrationManager, registrationManager.target, [ ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS ]) - await checkInitialized(FeesManager, feesManager.target, [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, 0]) - await checkInitialized(RewardsManager, rewardsManager.target, [ + await _checkInitialized(FeesManager, feesManager.target, [ ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, 0 ]) + await _checkInitialized(RewardsManager, rewardsManager.target, [ + ZERO_ADDRESS, + ZERO_ADDRESS, + ZERO_ADDRESS, + ZERO_ADDRESS, + 0 + ]) + } + const upgradeContracts = async () => { + await epochsManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) + await stakingManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) + await stakingManagerLm.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) + await stakingManagerRm.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) + await lendingManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) + await registrationManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) + await feesManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) + await rewardsManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) + + const currentEpoch = await epochsManager.currentEpoch() + await upgrades.upgradeProxy(epochsManager, EpochsManager) + expect(await await epochsManager.currentEpoch()).to.be.eq(currentEpoch) + await upgrades.upgradeProxy(stakingManager, StakingManager) + await upgrades.upgradeProxy(stakingManagerLm, StakingManagerPermissioned) + await upgrades.upgradeProxy(stakingManagerRm, StakingManagerPermissioned) + await upgrades.upgradeProxy(lendingManager, LendingManager) + await upgrades.upgradeProxy(registrationManager, RegistrationManager) + await upgrades.upgradeProxy(feesManager, FeesManager) + await upgrades.upgradeProxy(rewardsManager, RewardsManager) } beforeEach(async () => { @@ -276,6 +283,8 @@ describe('Integration tests on Gnosis deployment', () => { await missingSteps() + await checkInitialized() + await Promise.all(tokenHolders.map((_holder) => sendEth(ethers, faucet, _holder.address, '5'))) await Promise.all(tokenHolders.map((_holder) => mintPntOnGnosis(_holder.address, 10000n))) await Promise.all(tokenHolders.map((_holder) => stake(_holder, 5000))) From 9d80436c500c95367947763bdf212d6cdb3d8b01 Mon Sep 17 00:00:00 2001 From: Alain Olivier Date: Mon, 26 Feb 2024 18:46:10 +0100 Subject: [PATCH 06/15] test(fork): remove RewardsManager upgrade from missingSteps() --- .openzeppelin/unknown-100.json | 277 ++++++++++++++++++++++++++++++++- test/fork/dao.test.js | 2 - 2 files changed, 276 insertions(+), 3 deletions(-) diff --git a/.openzeppelin/unknown-100.json b/.openzeppelin/unknown-100.json index 6f9ace7..64d7369 100644 --- a/.openzeppelin/unknown-100.json +++ b/.openzeppelin/unknown-100.json @@ -73,7 +73,6 @@ }, { "address": "0x2ec44F9F31a55b52b3c1fF98647E38d63f829fb7", - "txHash": "0x1fcea19096ed58ac561fa31a188cc70df8661eef7dca3532e5cb0cf9f28741a2", "kind": "uups" } ], @@ -3410,6 +3409,282 @@ }, "namespaces": {} } + }, + "ea7091f0f1e8827d20faf131e1ba5c40168bdf97dbade3146916e27ea194e2d6": { + "address": "0xA422Af0aa8b0dc56552534Eeb43A0a0491DCA9f8", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_roles", + "offset": 0, + "slot": "201", + "type": "t_mapping(t_bytes32,t_struct(RoleData)169_storage)", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:57" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:260" + }, + { + "label": "_roleMembers", + "offset": 0, + "slot": "251", + "type": "t_mapping(t_bytes32,t_struct(AddressSet)3819_storage)", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:17" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:76" + }, + { + "label": "epochsManager", + "offset": 0, + "slot": "301", + "type": "t_address", + "contract": "RewardsManager", + "src": "contracts/core/RewardsManager.sol:20" + }, + { + "label": "dandelionVoting", + "offset": 0, + "slot": "302", + "type": "t_address", + "contract": "RewardsManager", + "src": "contracts/core/RewardsManager.sol:21" + }, + { + "label": "maxTotalSupply", + "offset": 0, + "slot": "303", + "type": "t_uint256", + "contract": "RewardsManager", + "src": "contracts/core/RewardsManager.sol:22" + }, + { + "label": "token", + "offset": 0, + "slot": "304", + "type": "t_address", + "contract": "RewardsManager", + "src": "contracts/core/RewardsManager.sol:23" + }, + { + "label": "tokenManager", + "offset": 0, + "slot": "305", + "type": "t_address", + "contract": "RewardsManager", + "src": "contracts/core/RewardsManager.sol:24" + }, + { + "label": "depositedAmountByEpoch", + "offset": 0, + "slot": "306", + "type": "t_mapping(t_uint16,t_uint256)", + "contract": "RewardsManager", + "src": "contracts/core/RewardsManager.sol:26" + }, + { + "label": "claimedAmountByEpoch", + "offset": 0, + "slot": "307", + "type": "t_mapping(t_uint16,t_uint256)", + "contract": "RewardsManager", + "src": "contracts/core/RewardsManager.sol:27" + }, + { + "label": "unclaimableAmountByEpoch", + "offset": 0, + "slot": "308", + "type": "t_mapping(t_uint16,t_uint256)", + "contract": "RewardsManager", + "src": "contracts/core/RewardsManager.sol:28" + }, + { + "label": "lockedRewardByEpoch", + "offset": 0, + "slot": "309", + "type": "t_mapping(t_uint16,t_mapping(t_address,t_uint256))", + "contract": "RewardsManager", + "src": "contracts/core/RewardsManager.sol:29" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(AddressSet)3819_storage)": { + "label": "mapping(bytes32 => struct EnumerableSetUpgradeable.AddressSet)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(RoleData)169_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint16,t_mapping(t_address,t_uint256))": { + "label": "mapping(uint16 => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_uint16,t_uint256)": { + "label": "mapping(uint16 => uint256)", + "numberOfBytes": "32" + }, + "t_struct(AddressSet)3819_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)3504_storage", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "64" + }, + "t_struct(RoleData)169_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_mapping(t_address,t_bool)", + "offset": 0, + "slot": "0" + }, + { + "label": "adminRole", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)3504_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } } } } diff --git a/test/fork/dao.test.js b/test/fork/dao.test.js index 8402e77..2274f67 100644 --- a/test/fork/dao.test.js +++ b/test/fork/dao.test.js @@ -234,7 +234,6 @@ describe('Integration tests on Gnosis deployment', () => { await lendingManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) await registrationManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) await feesManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) - await rewardsManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) const currentEpoch = await epochsManager.currentEpoch() await upgrades.upgradeProxy(epochsManager, EpochsManager) @@ -245,7 +244,6 @@ describe('Integration tests on Gnosis deployment', () => { await upgrades.upgradeProxy(lendingManager, LendingManager) await upgrades.upgradeProxy(registrationManager, RegistrationManager) await upgrades.upgradeProxy(feesManager, FeesManager) - await upgrades.upgradeProxy(rewardsManager, RewardsManager) } beforeEach(async () => { From 8578e80b226a19bf64abb0afbec8631f89956c36 Mon Sep 17 00:00:00 2001 From: Alain Olivier Date: Mon, 26 Feb 2024 19:10:48 +0100 Subject: [PATCH 07/15] test(fork): remove FeesManager upgrade from missingSteps() --- .openzeppelin/unknown-100.json | 317 ++++++++++++++++++++++++++++++++- test/fork/dao.test.js | 2 - 2 files changed, 314 insertions(+), 5 deletions(-) diff --git a/.openzeppelin/unknown-100.json b/.openzeppelin/unknown-100.json index 64d7369..301e54c 100644 --- a/.openzeppelin/unknown-100.json +++ b/.openzeppelin/unknown-100.json @@ -67,12 +67,11 @@ "kind": "uups" }, { - "address": "0x053b3d59F06601dF87D9EdD24CB2a81FAE93405f", - "txHash": "0x251d63ca89dc90f4062c7f9db269731bde99468c7107234390aec9497b2c0acd", + "address": "0x2ec44F9F31a55b52b3c1fF98647E38d63f829fb7", "kind": "uups" }, { - "address": "0x2ec44F9F31a55b52b3c1fF98647E38d63f829fb7", + "address": "0x053b3d59F06601dF87D9EdD24CB2a81FAE93405f", "kind": "uups" } ], @@ -3685,6 +3684,318 @@ }, "namespaces": {} } + }, + "3ebbca39d77385b82a8671ff5277fd0437174982106d9d85f49439c97e14a6d1": { + "address": "0x6b72FFdE7A1507Aff84Bab0bEE5d95D68aD21cbc", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_roles", + "offset": 0, + "slot": "201", + "type": "t_mapping(t_bytes32,t_struct(RoleData)169_storage)", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:57" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:260" + }, + { + "label": "_roleMembers", + "offset": 0, + "slot": "251", + "type": "t_mapping(t_bytes32,t_struct(AddressSet)3819_storage)", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:17" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:76" + }, + { + "label": "_forwarder", + "offset": 0, + "slot": "301", + "type": "t_address", + "contract": "ForwarderRecipientUpgradeable", + "src": "contracts/forwarder/ForwarderRecipientUpgradeable.sol:18" + }, + { + "label": "__gap", + "offset": 0, + "slot": "302", + "type": "t_array(t_uint256)49_storage", + "contract": "ForwarderRecipientUpgradeable", + "src": "contracts/forwarder/ForwarderRecipientUpgradeable.sol:53" + }, + { + "label": "_epochsSentinelsStakingAssetsFee", + "offset": 0, + "slot": "351", + "type": "t_mapping(t_uint256,t_mapping(t_address,t_uint256))", + "contract": "FeesManager", + "src": "contracts/core/FeesManager.sol:21" + }, + { + "label": "_epochsSentinelsBorrowingAssetsFee", + "offset": 0, + "slot": "352", + "type": "t_mapping(t_uint256,t_mapping(t_address,t_uint256))", + "contract": "FeesManager", + "src": "contracts/core/FeesManager.sol:22" + }, + { + "label": "_ownersEpochsAssetsClaim", + "offset": 0, + "slot": "353", + "type": "t_mapping(t_address,t_mapping(t_address,t_mapping(t_uint16,t_bool)))", + "contract": "FeesManager", + "src": "contracts/core/FeesManager.sol:23" + }, + { + "label": "_challengersEpochsClaimRedirect", + "offset": 0, + "slot": "354", + "type": "t_mapping(t_address,t_mapping(t_uint16,t_address))", + "contract": "FeesManager", + "src": "contracts/core/FeesManager.sol:24" + }, + { + "label": "_epochsGuardiansAssetsFee", + "offset": 0, + "slot": "355", + "type": "t_mapping(t_uint256,t_mapping(t_address,t_uint256))", + "contract": "FeesManager", + "src": "contracts/core/FeesManager.sol:25" + }, + { + "label": "minimumBorrowingFee", + "offset": 0, + "slot": "356", + "type": "t_uint32", + "contract": "FeesManager", + "src": "contracts/core/FeesManager.sol:27" + }, + { + "label": "epochsManager", + "offset": 4, + "slot": "356", + "type": "t_address", + "contract": "FeesManager", + "src": "contracts/core/FeesManager.sol:28" + }, + { + "label": "lendingManager", + "offset": 0, + "slot": "357", + "type": "t_address", + "contract": "FeesManager", + "src": "contracts/core/FeesManager.sol:29" + }, + { + "label": "registrationManager", + "offset": 0, + "slot": "358", + "type": "t_address", + "contract": "FeesManager", + "src": "contracts/core/FeesManager.sol:30" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_address,t_mapping(t_uint16,t_bool)))": { + "label": "mapping(address => mapping(address => mapping(uint16 => bool)))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_uint16,t_address))": { + "label": "mapping(address => mapping(uint16 => address))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_uint16,t_bool))": { + "label": "mapping(address => mapping(uint16 => bool))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(AddressSet)3819_storage)": { + "label": "mapping(bytes32 => struct EnumerableSetUpgradeable.AddressSet)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(RoleData)169_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint16,t_address)": { + "label": "mapping(uint16 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint16,t_bool)": { + "label": "mapping(uint16 => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_mapping(t_address,t_uint256))": { + "label": "mapping(uint256 => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_struct(AddressSet)3819_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)3504_storage", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "64" + }, + "t_struct(RoleData)169_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_mapping(t_address,t_bool)", + "offset": 0, + "slot": "0" + }, + { + "label": "adminRole", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)3504_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } } } } diff --git a/test/fork/dao.test.js b/test/fork/dao.test.js index 2274f67..0d8ce10 100644 --- a/test/fork/dao.test.js +++ b/test/fork/dao.test.js @@ -233,7 +233,6 @@ describe('Integration tests on Gnosis deployment', () => { await stakingManagerRm.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) await lendingManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) await registrationManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) - await feesManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) const currentEpoch = await epochsManager.currentEpoch() await upgrades.upgradeProxy(epochsManager, EpochsManager) @@ -243,7 +242,6 @@ describe('Integration tests on Gnosis deployment', () => { await upgrades.upgradeProxy(stakingManagerRm, StakingManagerPermissioned) await upgrades.upgradeProxy(lendingManager, LendingManager) await upgrades.upgradeProxy(registrationManager, RegistrationManager) - await upgrades.upgradeProxy(feesManager, FeesManager) } beforeEach(async () => { From c86cfd4341309edba415c3db6333f0a892bd45c1 Mon Sep 17 00:00:00 2001 From: Alain Olivier Date: Mon, 26 Feb 2024 19:36:05 +0100 Subject: [PATCH 08/15] test(fork): remove RegistrationManager upgrade from missingSteps() --- .openzeppelin/unknown-100.json | 421 ++++++++++++++++++++++++++++++++- test/fork/dao.test.js | 2 - 2 files changed, 417 insertions(+), 6 deletions(-) diff --git a/.openzeppelin/unknown-100.json b/.openzeppelin/unknown-100.json index 301e54c..c924dbb 100644 --- a/.openzeppelin/unknown-100.json +++ b/.openzeppelin/unknown-100.json @@ -62,16 +62,15 @@ "kind": "uups" }, { - "address": "0x08342a325630bE00F55A7Bc5dD64D342B1D3d23D", - "txHash": "0xf8a5a1eb5dd3f91bb7f94087ca3f4fecb28561d9c874d5ab9f6b0326a41d1e45", + "address": "0x2ec44F9F31a55b52b3c1fF98647E38d63f829fb7", "kind": "uups" }, { - "address": "0x2ec44F9F31a55b52b3c1fF98647E38d63f829fb7", + "address": "0x053b3d59F06601dF87D9EdD24CB2a81FAE93405f", "kind": "uups" }, { - "address": "0x053b3d59F06601dF87D9EdD24CB2a81FAE93405f", + "address": "0x08342a325630bE00F55A7Bc5dD64D342B1D3d23D", "kind": "uups" } ], @@ -3996,6 +3995,420 @@ }, "namespaces": {} } + }, + "b4396e369d2c1e259a8af176f354f469b0b424de31761556de2256f2e3574ab4": { + "address": "0xbDda9C5D491a72EAf878a7218D73FE94f435a758", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_roles", + "offset": 0, + "slot": "201", + "type": "t_mapping(t_bytes32,t_struct(RoleData)169_storage)", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:57" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:260" + }, + { + "label": "_roleMembers", + "offset": 0, + "slot": "251", + "type": "t_mapping(t_bytes32,t_struct(AddressSet)3819_storage)", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:17" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:76" + }, + { + "label": "_forwarder", + "offset": 0, + "slot": "301", + "type": "t_address", + "contract": "ForwarderRecipientUpgradeable", + "src": "contracts/forwarder/ForwarderRecipientUpgradeable.sol:18" + }, + { + "label": "__gap", + "offset": 0, + "slot": "302", + "type": "t_array(t_uint256)49_storage", + "contract": "ForwarderRecipientUpgradeable", + "src": "contracts/forwarder/ForwarderRecipientUpgradeable.sol:53" + }, + { + "label": "_registrations", + "offset": 0, + "slot": "351", + "type": "t_mapping(t_address,t_struct(Registration)17164_storage)", + "contract": "RegistrationManager", + "src": "contracts/core/RegistrationManager.sol:25" + }, + { + "label": "_ownersSentinel", + "offset": 0, + "slot": "352", + "type": "t_mapping(t_address,t_address)", + "contract": "RegistrationManager", + "src": "contracts/core/RegistrationManager.sol:26" + }, + { + "label": "_ownersGuardian", + "offset": 0, + "slot": "353", + "type": "t_mapping(t_address,t_address)", + "contract": "RegistrationManager", + "src": "contracts/core/RegistrationManager.sol:27" + }, + { + "label": "_ownersSignatureNonces", + "offset": 0, + "slot": "354", + "type": "t_mapping(t_address,t_uint256)", + "contract": "RegistrationManager", + "src": "contracts/core/RegistrationManager.sol:28" + }, + { + "label": "_sentinelsEpochsTotalStakedAmount", + "offset": 0, + "slot": "355", + "type": "t_array(t_uint32)dyn_storage", + "contract": "RegistrationManager", + "src": "contracts/core/RegistrationManager.sol:29" + }, + { + "label": "_sentinelsEpochsStakedAmount", + "offset": 0, + "slot": "356", + "type": "t_mapping(t_address,t_array(t_uint32)dyn_storage)", + "contract": "RegistrationManager", + "src": "contracts/core/RegistrationManager.sol:30" + }, + { + "label": "_epochsTotalNumberOfGuardians", + "offset": 0, + "slot": "357", + "type": "t_mapping(t_uint16,t_uint16)", + "contract": "RegistrationManager", + "src": "contracts/core/RegistrationManager.sol:31" + }, + { + "label": "_pendingLightResumes", + "offset": 0, + "slot": "358", + "type": "t_mapping(t_uint16,t_mapping(t_address,t_uint16))", + "contract": "RegistrationManager", + "src": "contracts/core/RegistrationManager.sol:32" + }, + { + "label": "_slashes", + "offset": 0, + "slot": "359", + "type": "t_mapping(t_uint16,t_mapping(t_address,t_uint16))", + "contract": "RegistrationManager", + "src": "contracts/core/RegistrationManager.sol:33" + }, + { + "label": "_lastSlashTimestamp", + "offset": 0, + "slot": "360", + "type": "t_mapping(t_address,t_uint256)", + "contract": "RegistrationManager", + "src": "contracts/core/RegistrationManager.sol:34" + }, + { + "label": "_lastResumeTimestamp", + "offset": 0, + "slot": "361", + "type": "t_mapping(t_address,t_uint256)", + "contract": "RegistrationManager", + "src": "contracts/core/RegistrationManager.sol:35" + }, + { + "label": "stakingManager", + "offset": 0, + "slot": "362", + "type": "t_address", + "contract": "RegistrationManager", + "src": "contracts/core/RegistrationManager.sol:37" + }, + { + "label": "token", + "offset": 0, + "slot": "363", + "type": "t_address", + "contract": "RegistrationManager", + "src": "contracts/core/RegistrationManager.sol:38" + }, + { + "label": "epochsManager", + "offset": 0, + "slot": "364", + "type": "t_address", + "contract": "RegistrationManager", + "src": "contracts/core/RegistrationManager.sol:39" + }, + { + "label": "lendingManager", + "offset": 0, + "slot": "365", + "type": "t_address", + "contract": "RegistrationManager", + "src": "contracts/core/RegistrationManager.sol:40" + }, + { + "label": "feesManager", + "offset": 0, + "slot": "366", + "type": "t_address", + "contract": "RegistrationManager", + "src": "contracts/core/RegistrationManager.sol:41" + }, + { + "label": "governanceMessageEmitter", + "offset": 0, + "slot": "367", + "type": "t_address", + "contract": "RegistrationManager", + "src": "contracts/core/RegistrationManager.sol:42" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_array(t_uint32)dyn_storage": { + "label": "uint32[]", + "numberOfBytes": "32" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes1": { + "label": "bytes1", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_address)": { + "label": "mapping(address => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_array(t_uint32)dyn_storage)": { + "label": "mapping(address => uint32[])", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_struct(Registration)17164_storage)": { + "label": "mapping(address => struct IRegistrationManager.Registration)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint16)": { + "label": "mapping(address => uint16)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(AddressSet)3819_storage)": { + "label": "mapping(bytes32 => struct EnumerableSetUpgradeable.AddressSet)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(RoleData)169_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint16,t_mapping(t_address,t_uint16))": { + "label": "mapping(uint16 => mapping(address => uint16))", + "numberOfBytes": "32" + }, + "t_mapping(t_uint16,t_uint16)": { + "label": "mapping(uint16 => uint16)", + "numberOfBytes": "32" + }, + "t_struct(AddressSet)3819_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)3504_storage", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Registration)17164_storage": { + "label": "struct IRegistrationManager.Registration", + "members": [ + { + "label": "owner", + "type": "t_address", + "offset": 0, + "slot": "0" + }, + { + "label": "startEpoch", + "type": "t_uint16", + "offset": 20, + "slot": "0" + }, + { + "label": "endEpoch", + "type": "t_uint16", + "offset": 22, + "slot": "0" + }, + { + "label": "kind", + "type": "t_bytes1", + "offset": 24, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(RoleData)169_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_mapping(t_address,t_bool)", + "offset": 0, + "slot": "0" + }, + { + "label": "adminRole", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)3504_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } } } } diff --git a/test/fork/dao.test.js b/test/fork/dao.test.js index 0d8ce10..59487a2 100644 --- a/test/fork/dao.test.js +++ b/test/fork/dao.test.js @@ -232,7 +232,6 @@ describe('Integration tests on Gnosis deployment', () => { await stakingManagerLm.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) await stakingManagerRm.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) await lendingManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) - await registrationManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) const currentEpoch = await epochsManager.currentEpoch() await upgrades.upgradeProxy(epochsManager, EpochsManager) @@ -241,7 +240,6 @@ describe('Integration tests on Gnosis deployment', () => { await upgrades.upgradeProxy(stakingManagerLm, StakingManagerPermissioned) await upgrades.upgradeProxy(stakingManagerRm, StakingManagerPermissioned) await upgrades.upgradeProxy(lendingManager, LendingManager) - await upgrades.upgradeProxy(registrationManager, RegistrationManager) } beforeEach(async () => { From 9fd2c3a86a0da9eee2434a5993896de4e3efe1e7 Mon Sep 17 00:00:00 2001 From: Alain Olivier Date: Mon, 26 Feb 2024 19:45:37 +0100 Subject: [PATCH 09/15] test(fork): remove LendingManager upgrade from missingSteps() --- .openzeppelin/unknown-100.json | 341 ++++++++++++++++++++++++++++++++- test/fork/dao.test.js | 2 - 2 files changed, 336 insertions(+), 7 deletions(-) diff --git a/.openzeppelin/unknown-100.json b/.openzeppelin/unknown-100.json index c924dbb..dbf0ba1 100644 --- a/.openzeppelin/unknown-100.json +++ b/.openzeppelin/unknown-100.json @@ -56,11 +56,6 @@ "txHash": "0xaf06d7128a1e5de4212b876205eb6d6fe3054730e41415c74840b62b557a0cbe", "kind": "uups" }, - { - "address": "0xEf3A54f764F58848e66BaDc427542b44C44b5553", - "txHash": "0x1bdc2ea435a073daf24c1575c67dae8ca6ebcaf8a2fccfd9b2c212c62e08c6da", - "kind": "uups" - }, { "address": "0x2ec44F9F31a55b52b3c1fF98647E38d63f829fb7", "kind": "uups" @@ -72,6 +67,10 @@ { "address": "0x08342a325630bE00F55A7Bc5dD64D342B1D3d23D", "kind": "uups" + }, + { + "address": "0xEf3A54f764F58848e66BaDc427542b44C44b5553", + "kind": "uups" } ], "impls": { @@ -4409,6 +4408,338 @@ }, "namespaces": {} } + }, + "da5fe9f886b1372fb1b82fa83623addf53f055797055f8ff2c1628b845874975": { + "address": "0x7422Ab390e76E39D95d8C7664FA66ee85f5b99a1", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_roles", + "offset": 0, + "slot": "201", + "type": "t_mapping(t_bytes32,t_struct(RoleData)169_storage)", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:57" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:260" + }, + { + "label": "_roleMembers", + "offset": 0, + "slot": "251", + "type": "t_mapping(t_bytes32,t_struct(AddressSet)3819_storage)", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:17" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:76" + }, + { + "label": "_forwarder", + "offset": 0, + "slot": "301", + "type": "t_address", + "contract": "ForwarderRecipientUpgradeable", + "src": "contracts/forwarder/ForwarderRecipientUpgradeable.sol:18" + }, + { + "label": "__gap", + "offset": 0, + "slot": "302", + "type": "t_array(t_uint256)49_storage", + "contract": "ForwarderRecipientUpgradeable", + "src": "contracts/forwarder/ForwarderRecipientUpgradeable.sol:53" + }, + { + "label": "_borrowersEpochsBorrowedAmount", + "offset": 0, + "slot": "351", + "type": "t_mapping(t_address,t_array(t_uint32)dyn_storage)", + "contract": "LendingManager", + "src": "contracts/core/LendingManager.sol:22" + }, + { + "label": "_lendersEpochsWeight", + "offset": 0, + "slot": "352", + "type": "t_mapping(t_address,t_array(t_uint32)dyn_storage)", + "contract": "LendingManager", + "src": "contracts/core/LendingManager.sol:23" + }, + { + "label": "_lendersEpochsAssetsRewardsClaim", + "offset": 0, + "slot": "353", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_mapping(t_address,t_bool)))", + "contract": "LendingManager", + "src": "contracts/core/LendingManager.sol:24" + }, + { + "label": "_totalEpochsAssetsRewardAmount", + "offset": 0, + "slot": "354", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))", + "contract": "LendingManager", + "src": "contracts/core/LendingManager.sol:25" + }, + { + "label": "_epochsTotalLendedAmount", + "offset": 0, + "slot": "355", + "type": "t_array(t_uint32)dyn_storage", + "contract": "LendingManager", + "src": "contracts/core/LendingManager.sol:27" + }, + { + "label": "_epochsTotalBorrowedAmount", + "offset": 0, + "slot": "356", + "type": "t_array(t_uint32)dyn_storage", + "contract": "LendingManager", + "src": "contracts/core/LendingManager.sol:28" + }, + { + "label": "_epochTotalWeight", + "offset": 0, + "slot": "357", + "type": "t_array(t_uint32)dyn_storage", + "contract": "LendingManager", + "src": "contracts/core/LendingManager.sol:29" + }, + { + "label": "stakingManager", + "offset": 0, + "slot": "358", + "type": "t_address", + "contract": "LendingManager", + "src": "contracts/core/LendingManager.sol:31" + }, + { + "label": "token", + "offset": 0, + "slot": "359", + "type": "t_address", + "contract": "LendingManager", + "src": "contracts/core/LendingManager.sol:32" + }, + { + "label": "epochsManager", + "offset": 0, + "slot": "360", + "type": "t_address", + "contract": "LendingManager", + "src": "contracts/core/LendingManager.sol:33" + }, + { + "label": "dandelionVoting", + "offset": 0, + "slot": "361", + "type": "t_address", + "contract": "LendingManager", + "src": "contracts/core/LendingManager.sol:34" + }, + { + "label": "lendMaxEpochs", + "offset": 20, + "slot": "361", + "type": "t_uint16", + "contract": "LendingManager", + "src": "contracts/core/LendingManager.sol:35" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_array(t_uint32)dyn_storage": { + "label": "uint32[]", + "numberOfBytes": "32" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_array(t_uint32)dyn_storage)": { + "label": "mapping(address => uint32[])", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_mapping(t_address,t_bool)))": { + "label": "mapping(address => mapping(uint256 => mapping(address => bool)))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_uint256))": { + "label": "mapping(address => mapping(uint256 => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(AddressSet)3819_storage)": { + "label": "mapping(bytes32 => struct EnumerableSetUpgradeable.AddressSet)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(RoleData)169_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_mapping(t_address,t_bool))": { + "label": "mapping(uint256 => mapping(address => bool))", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_uint256)": { + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32" + }, + "t_struct(AddressSet)3819_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)3504_storage", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "64" + }, + "t_struct(RoleData)169_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_mapping(t_address,t_bool)", + "offset": 0, + "slot": "0" + }, + { + "label": "adminRole", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)3504_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } } } } diff --git a/test/fork/dao.test.js b/test/fork/dao.test.js index 59487a2..1ad64fe 100644 --- a/test/fork/dao.test.js +++ b/test/fork/dao.test.js @@ -231,7 +231,6 @@ describe('Integration tests on Gnosis deployment', () => { await stakingManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) await stakingManagerLm.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) await stakingManagerRm.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) - await lendingManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) const currentEpoch = await epochsManager.currentEpoch() await upgrades.upgradeProxy(epochsManager, EpochsManager) @@ -239,7 +238,6 @@ describe('Integration tests on Gnosis deployment', () => { await upgrades.upgradeProxy(stakingManager, StakingManager) await upgrades.upgradeProxy(stakingManagerLm, StakingManagerPermissioned) await upgrades.upgradeProxy(stakingManagerRm, StakingManagerPermissioned) - await upgrades.upgradeProxy(lendingManager, LendingManager) } beforeEach(async () => { From 4098a0105328abc450e6134101b95cfaacaf354e Mon Sep 17 00:00:00 2001 From: Alain Olivier Date: Mon, 26 Feb 2024 21:18:10 +0100 Subject: [PATCH 10/15] test(fork): remove StakingManagerRm upgrade from missingSteps() --- .openzeppelin/unknown-100.json | 291 ++++++++++++++++++++++++++++++++- test/fork/dao.test.js | 2 - 2 files changed, 286 insertions(+), 7 deletions(-) diff --git a/.openzeppelin/unknown-100.json b/.openzeppelin/unknown-100.json index dbf0ba1..a7e6720 100644 --- a/.openzeppelin/unknown-100.json +++ b/.openzeppelin/unknown-100.json @@ -46,11 +46,6 @@ "txHash": "0x28c70f10662ac127cac3a6d22479e20e01613516a7538ca8b805433a17d11f70", "kind": "uups" }, - { - "address": "0x9ce64A5c880153CD15C097C8D90c39cB073aE945", - "txHash": "0x54fcd2dba89035c42de4fbde28b9d0171f900cde33b3f2396d6d86a5c5c9e0d7", - "kind": "uups" - }, { "address": "0xFDD7d2f23F771F05C6CEbFc9f9bC2A771FAE302e", "txHash": "0xaf06d7128a1e5de4212b876205eb6d6fe3054730e41415c74840b62b557a0cbe", @@ -71,6 +66,10 @@ { "address": "0xEf3A54f764F58848e66BaDc427542b44C44b5553", "kind": "uups" + }, + { + "address": "0x9ce64A5c880153CD15C097C8D90c39cB073aE945", + "kind": "uups" } ], "impls": { @@ -4740,6 +4739,288 @@ }, "namespaces": {} } + }, + "38a5cfe29ec38713b523a1d75ae89816096308bcb622f49654a6a175ac424e57": { + "address": "0x9c0375Ae42831D236d36B945976FA1B9B5862403", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_roles", + "offset": 0, + "slot": "201", + "type": "t_mapping(t_bytes32,t_struct(RoleData)169_storage)", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:57" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:260" + }, + { + "label": "_roleMembers", + "offset": 0, + "slot": "251", + "type": "t_mapping(t_bytes32,t_struct(AddressSet)3819_storage)", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:17" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:76" + }, + { + "label": "_forwarder", + "offset": 0, + "slot": "301", + "type": "t_address", + "contract": "ForwarderRecipientUpgradeable", + "src": "contracts/forwarder/ForwarderRecipientUpgradeable.sol:18" + }, + { + "label": "__gap", + "offset": 0, + "slot": "302", + "type": "t_array(t_uint256)49_storage", + "contract": "ForwarderRecipientUpgradeable", + "src": "contracts/forwarder/ForwarderRecipientUpgradeable.sol:53" + }, + { + "label": "_stakes", + "offset": 0, + "slot": "351", + "type": "t_mapping(t_address,t_struct(Stake)16587_storage)", + "contract": "BaseStakingManager", + "src": "contracts/core/BaseStakingManager.sol:20" + }, + { + "label": "token", + "offset": 0, + "slot": "352", + "type": "t_address", + "contract": "BaseStakingManager", + "src": "contracts/core/BaseStakingManager.sol:21" + }, + { + "label": "tokenManager", + "offset": 0, + "slot": "353", + "type": "t_address", + "contract": "BaseStakingManager", + "src": "contracts/core/BaseStakingManager.sol:22" + }, + { + "label": "maxTotalSupply", + "offset": 0, + "slot": "354", + "type": "t_uint256", + "contract": "BaseStakingManager", + "src": "contracts/core/BaseStakingManager.sol:23" + }, + { + "label": "__gap", + "offset": 0, + "slot": "355", + "type": "t_array(t_uint256)49_storage", + "contract": "BaseStakingManager", + "src": "contracts/core/BaseStakingManager.sol:215" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_struct(Stake)16587_storage)": { + "label": "mapping(address => struct IBaseStakingManager.Stake)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(AddressSet)3819_storage)": { + "label": "mapping(bytes32 => struct EnumerableSetUpgradeable.AddressSet)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(RoleData)169_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32" + }, + "t_struct(AddressSet)3819_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)3504_storage", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "64" + }, + "t_struct(RoleData)169_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_mapping(t_address,t_bool)", + "offset": 0, + "slot": "0" + }, + { + "label": "adminRole", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)3504_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Stake)16587_storage": { + "label": "struct IBaseStakingManager.Stake", + "members": [ + { + "label": "amount", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "startDate", + "type": "t_uint64", + "offset": 0, + "slot": "1" + }, + { + "label": "endDate", + "type": "t_uint64", + "offset": 8, + "slot": "1" + }, + { + "label": "token", + "type": "t_address", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } } } } diff --git a/test/fork/dao.test.js b/test/fork/dao.test.js index 1ad64fe..e85367b 100644 --- a/test/fork/dao.test.js +++ b/test/fork/dao.test.js @@ -230,14 +230,12 @@ describe('Integration tests on Gnosis deployment', () => { await epochsManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) await stakingManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) await stakingManagerLm.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) - await stakingManagerRm.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) const currentEpoch = await epochsManager.currentEpoch() await upgrades.upgradeProxy(epochsManager, EpochsManager) expect(await await epochsManager.currentEpoch()).to.be.eq(currentEpoch) await upgrades.upgradeProxy(stakingManager, StakingManager) await upgrades.upgradeProxy(stakingManagerLm, StakingManagerPermissioned) - await upgrades.upgradeProxy(stakingManagerRm, StakingManagerPermissioned) } beforeEach(async () => { From 077d3bf29396d0cfbbc891e2d5c655d267e9b100 Mon Sep 17 00:00:00 2001 From: Alain Olivier Date: Mon, 26 Feb 2024 21:20:39 +0100 Subject: [PATCH 11/15] refactor(tasks): check for implementation contract length in upgrade task --- tasks/upgrade-safe.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tasks/upgrade-safe.js b/tasks/upgrade-safe.js index 7875f9c..eacbf51 100644 --- a/tasks/upgrade-safe.js +++ b/tasks/upgrade-safe.js @@ -1,3 +1,4 @@ +const { assert } = require('chai') const { Confirm } = require('enquirer') const { task } = require('hardhat/config') @@ -40,6 +41,10 @@ const proposeUpgrade = async (_args, _hre) => { if (_args[PARAM_IMPLEMENTATION]) { newImplementation = _args[PARAM_IMPLEMENTATION] console.info(`✔ Using new implementation ${newImplementation}`) + // check for length equality, better than nothing + const code = await _hre.ethers.provider.getCode(newImplementation) + const expected = (await _hre.artifacts.readArtifact(factoryName)).deployedBytecode + assert(code.length === expected.length, 'Invalid bytecode!') } else { console.info('✘ No new implementation provided') const deployConfirm = new Confirm({ message: 'Deploying new implementation?' }) From 7c951542a07cae959967e4060da3731b205c57e0 Mon Sep 17 00:00:00 2001 From: Alain Olivier Date: Mon, 26 Feb 2024 21:29:06 +0100 Subject: [PATCH 12/15] test(fork): remove StakingManagerLm upgrade from missingSteps() --- .openzeppelin/unknown-100.json | 14 ++++++++------ test/fork/dao.test.js | 2 -- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.openzeppelin/unknown-100.json b/.openzeppelin/unknown-100.json index a7e6720..94d31f3 100644 --- a/.openzeppelin/unknown-100.json +++ b/.openzeppelin/unknown-100.json @@ -41,11 +41,6 @@ "txHash": "0x77a4e4cdd936b1a769676255a02afe2a80181fef5c4ccbe0fb1d7d6fa4fd45e5", "kind": "uups" }, - { - "address": "0x74107f07765A918890c7a0E9d420Dc587539aD42", - "txHash": "0x28c70f10662ac127cac3a6d22479e20e01613516a7538ca8b805433a17d11f70", - "kind": "uups" - }, { "address": "0xFDD7d2f23F771F05C6CEbFc9f9bC2A771FAE302e", "txHash": "0xaf06d7128a1e5de4212b876205eb6d6fe3054730e41415c74840b62b557a0cbe", @@ -70,6 +65,10 @@ { "address": "0x9ce64A5c880153CD15C097C8D90c39cB073aE945", "kind": "uups" + }, + { + "address": "0x74107f07765A918890c7a0E9d420Dc587539aD42", + "kind": "uups" } ], "impls": { @@ -5020,7 +5019,10 @@ } }, "namespaces": {} - } + }, + "allAddresses": [ + "0x9c0375Ae42831D236d36B945976FA1B9B5862403" + ] } } } diff --git a/test/fork/dao.test.js b/test/fork/dao.test.js index e85367b..e1add0f 100644 --- a/test/fork/dao.test.js +++ b/test/fork/dao.test.js @@ -229,13 +229,11 @@ describe('Integration tests on Gnosis deployment', () => { const upgradeContracts = async () => { await epochsManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) await stakingManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) - await stakingManagerLm.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) const currentEpoch = await epochsManager.currentEpoch() await upgrades.upgradeProxy(epochsManager, EpochsManager) expect(await await epochsManager.currentEpoch()).to.be.eq(currentEpoch) await upgrades.upgradeProxy(stakingManager, StakingManager) - await upgrades.upgradeProxy(stakingManagerLm, StakingManagerPermissioned) } beforeEach(async () => { From 999159a25f2135b50f1692caeacab60a90e65b7f Mon Sep 17 00:00:00 2001 From: Alain Olivier Date: Mon, 26 Feb 2024 21:34:07 +0100 Subject: [PATCH 13/15] test(fork): remove StakingManager upgrade from missingSteps() --- .openzeppelin/unknown-100.json | 291 ++++++++++++++++++++++++++++++++- test/fork/dao.test.js | 2 - 2 files changed, 286 insertions(+), 7 deletions(-) diff --git a/.openzeppelin/unknown-100.json b/.openzeppelin/unknown-100.json index 94d31f3..23917f8 100644 --- a/.openzeppelin/unknown-100.json +++ b/.openzeppelin/unknown-100.json @@ -36,11 +36,6 @@ "txHash": "0xced7cd7a7e735b894adcabdf8a79933df2b2fbcad616f8ad1bbeff855dddc66e", "kind": "uups" }, - { - "address": "0xdEE8ebE2b7152ECCd935fd67134BF1bad55302BC", - "txHash": "0x77a4e4cdd936b1a769676255a02afe2a80181fef5c4ccbe0fb1d7d6fa4fd45e5", - "kind": "uups" - }, { "address": "0xFDD7d2f23F771F05C6CEbFc9f9bC2A771FAE302e", "txHash": "0xaf06d7128a1e5de4212b876205eb6d6fe3054730e41415c74840b62b557a0cbe", @@ -69,6 +64,10 @@ { "address": "0x74107f07765A918890c7a0E9d420Dc587539aD42", "kind": "uups" + }, + { + "address": "0xdEE8ebE2b7152ECCd935fd67134BF1bad55302BC", + "kind": "uups" } ], "impls": { @@ -5023,6 +5022,288 @@ "allAddresses": [ "0x9c0375Ae42831D236d36B945976FA1B9B5862403" ] + }, + "cd8fe72ecc83c695ed7175e20ce593cd8827e645a364bd01baf61f78a0d4ba78": { + "address": "0x54aeE97A68E626081A4F2193396Ed95741d217Da", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_roles", + "offset": 0, + "slot": "201", + "type": "t_mapping(t_bytes32,t_struct(RoleData)169_storage)", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:57" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:260" + }, + { + "label": "_roleMembers", + "offset": 0, + "slot": "251", + "type": "t_mapping(t_bytes32,t_struct(AddressSet)3819_storage)", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:17" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:76" + }, + { + "label": "_forwarder", + "offset": 0, + "slot": "301", + "type": "t_address", + "contract": "ForwarderRecipientUpgradeable", + "src": "contracts/forwarder/ForwarderRecipientUpgradeable.sol:18" + }, + { + "label": "__gap", + "offset": 0, + "slot": "302", + "type": "t_array(t_uint256)49_storage", + "contract": "ForwarderRecipientUpgradeable", + "src": "contracts/forwarder/ForwarderRecipientUpgradeable.sol:53" + }, + { + "label": "_stakes", + "offset": 0, + "slot": "351", + "type": "t_mapping(t_address,t_struct(Stake)16587_storage)", + "contract": "BaseStakingManager", + "src": "contracts/core/BaseStakingManager.sol:20" + }, + { + "label": "token", + "offset": 0, + "slot": "352", + "type": "t_address", + "contract": "BaseStakingManager", + "src": "contracts/core/BaseStakingManager.sol:21" + }, + { + "label": "tokenManager", + "offset": 0, + "slot": "353", + "type": "t_address", + "contract": "BaseStakingManager", + "src": "contracts/core/BaseStakingManager.sol:22" + }, + { + "label": "maxTotalSupply", + "offset": 0, + "slot": "354", + "type": "t_uint256", + "contract": "BaseStakingManager", + "src": "contracts/core/BaseStakingManager.sol:23" + }, + { + "label": "__gap", + "offset": 0, + "slot": "355", + "type": "t_array(t_uint256)49_storage", + "contract": "BaseStakingManager", + "src": "contracts/core/BaseStakingManager.sol:215" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_struct(Stake)16587_storage)": { + "label": "mapping(address => struct IBaseStakingManager.Stake)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(AddressSet)3819_storage)": { + "label": "mapping(bytes32 => struct EnumerableSetUpgradeable.AddressSet)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(RoleData)169_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32" + }, + "t_struct(AddressSet)3819_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)3504_storage", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "64" + }, + "t_struct(RoleData)169_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_mapping(t_address,t_bool)", + "offset": 0, + "slot": "0" + }, + { + "label": "adminRole", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)3504_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Stake)16587_storage": { + "label": "struct IBaseStakingManager.Stake", + "members": [ + { + "label": "amount", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "startDate", + "type": "t_uint64", + "offset": 0, + "slot": "1" + }, + { + "label": "endDate", + "type": "t_uint64", + "offset": 8, + "slot": "1" + }, + { + "label": "token", + "type": "t_address", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } } } } diff --git a/test/fork/dao.test.js b/test/fork/dao.test.js index e1add0f..a234bee 100644 --- a/test/fork/dao.test.js +++ b/test/fork/dao.test.js @@ -228,12 +228,10 @@ describe('Integration tests on Gnosis deployment', () => { } const upgradeContracts = async () => { await epochsManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) - await stakingManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) const currentEpoch = await epochsManager.currentEpoch() await upgrades.upgradeProxy(epochsManager, EpochsManager) expect(await await epochsManager.currentEpoch()).to.be.eq(currentEpoch) - await upgrades.upgradeProxy(stakingManager, StakingManager) } beforeEach(async () => { From 665916a0ae5ec2cfb3da43ddabb0af18bbd0a950 Mon Sep 17 00:00:00 2001 From: Alain Olivier Date: Mon, 26 Feb 2024 21:43:01 +0100 Subject: [PATCH 14/15] test(fork): remove EpochsManager upgrade from missingSteps() --- .openzeppelin/unknown-100.json | 213 ++++++++++++++++++++++++++++++++- test/fork/dao.test.js | 11 +- 2 files changed, 209 insertions(+), 15 deletions(-) diff --git a/.openzeppelin/unknown-100.json b/.openzeppelin/unknown-100.json index 23917f8..250c01d 100644 --- a/.openzeppelin/unknown-100.json +++ b/.openzeppelin/unknown-100.json @@ -36,11 +36,6 @@ "txHash": "0xced7cd7a7e735b894adcabdf8a79933df2b2fbcad616f8ad1bbeff855dddc66e", "kind": "uups" }, - { - "address": "0xFDD7d2f23F771F05C6CEbFc9f9bC2A771FAE302e", - "txHash": "0xaf06d7128a1e5de4212b876205eb6d6fe3054730e41415c74840b62b557a0cbe", - "kind": "uups" - }, { "address": "0x2ec44F9F31a55b52b3c1fF98647E38d63f829fb7", "kind": "uups" @@ -68,6 +63,10 @@ { "address": "0xdEE8ebE2b7152ECCd935fd67134BF1bad55302BC", "kind": "uups" + }, + { + "address": "0xFDD7d2f23F771F05C6CEbFc9f9bC2A771FAE302e", + "kind": "uups" } ], "impls": { @@ -5304,6 +5303,210 @@ }, "namespaces": {} } + }, + "0c726d335a8e72a5d5b99b4bdadce87a246834950a31f6b4acf896f4fc5ff9be": { + "address": "0x80E60ff08DA71B39E40C5089106650995891eb16", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_roles", + "offset": 0, + "slot": "201", + "type": "t_mapping(t_bytes32,t_struct(RoleData)169_storage)", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:57" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:260" + }, + { + "label": "_roleMembers", + "offset": 0, + "slot": "251", + "type": "t_mapping(t_bytes32,t_struct(AddressSet)3819_storage)", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:17" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "AccessControlEnumerableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol:76" + }, + { + "label": "_epochDuration", + "offset": 0, + "slot": "301", + "type": "t_uint256", + "contract": "EpochsManager", + "src": "contracts/core/EpochsManager.sol:12" + }, + { + "label": "_startFirstEpochTimestamp", + "offset": 0, + "slot": "302", + "type": "t_uint256", + "contract": "EpochsManager", + "src": "contracts/core/EpochsManager.sol:13" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(AddressSet)3819_storage)": { + "label": "mapping(bytes32 => struct EnumerableSetUpgradeable.AddressSet)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(RoleData)169_storage)": { + "label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32" + }, + "t_struct(AddressSet)3819_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)3504_storage", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "64" + }, + "t_struct(RoleData)169_storage": { + "label": "struct AccessControlUpgradeable.RoleData", + "members": [ + { + "label": "members", + "type": "t_mapping(t_address,t_bool)", + "offset": 0, + "slot": "0" + }, + { + "label": "adminRole", + "type": "t_bytes32", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)3504_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } } } } diff --git a/test/fork/dao.test.js b/test/fork/dao.test.js index a234bee..6c51429 100644 --- a/test/fork/dao.test.js +++ b/test/fork/dao.test.js @@ -48,8 +48,7 @@ const { hardhatReset } = require('../utils/hardhat-reset') const { mintPToken, pegoutToken } = require('../utils/pnetwork') const { sendEth } = require('../utils/send-eth') -const { CHANGE_TOKEN_ROLE, CREATE_VOTES_ROLE, CREATE_PAYMENTS_ROLE, DEPOSIT_REWARD_ROLE, UPGRADE_ROLE } = - getAllRoles(ethers) +const { CHANGE_TOKEN_ROLE, CREATE_VOTES_ROLE, CREATE_PAYMENTS_ROLE, DEPOSIT_REWARD_ROLE } = getAllRoles(ethers) const USER_ADDRESS = '0xdDb5f4535123DAa5aE343c24006F4075aBAF5F7B' const ADDRESS_PLACEHOLDER = '0x0123456789012345678901234567890123456789' @@ -155,7 +154,6 @@ describe('Integration tests on Gnosis deployment', () => { ] const missingSteps = async () => { - await upgradeContracts() const MockPToken = await ethers.getContractFactory('MockPTokenERC20') pntOnGnosis = await MockPToken.deploy('Host Token (pToken)', 'HTKN', pntMinter.address, PNETWORK_NETWORK_IDS.GNOSIS) await stakingManager.connect(daoOwner).grantRole(CHANGE_TOKEN_ROLE, SAFE_ADDRESS) @@ -226,13 +224,6 @@ describe('Integration tests on Gnosis deployment', () => { 0 ]) } - const upgradeContracts = async () => { - await epochsManager.connect(daoOwner).grantRole(UPGRADE_ROLE, faucet.address) - - const currentEpoch = await epochsManager.currentEpoch() - await upgrades.upgradeProxy(epochsManager, EpochsManager) - expect(await await epochsManager.currentEpoch()).to.be.eq(currentEpoch) - } beforeEach(async () => { const rpc = config.networks.hardhat.forking.url From eb0b6a5b7929ef4124f30e5e4f8690557540ef7f Mon Sep 17 00:00:00 2001 From: Alain Olivier Date: Mon, 26 Feb 2024 21:54:12 +0100 Subject: [PATCH 15/15] test(fork): update missingSteps() --- test/fork/dao.test.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/fork/dao.test.js b/test/fork/dao.test.js index 6c51429..3a8bfdb 100644 --- a/test/fork/dao.test.js +++ b/test/fork/dao.test.js @@ -48,7 +48,7 @@ const { hardhatReset } = require('../utils/hardhat-reset') const { mintPToken, pegoutToken } = require('../utils/pnetwork') const { sendEth } = require('../utils/send-eth') -const { CHANGE_TOKEN_ROLE, CREATE_VOTES_ROLE, CREATE_PAYMENTS_ROLE, DEPOSIT_REWARD_ROLE } = getAllRoles(ethers) +const { CHANGE_TOKEN_ROLE, CREATE_VOTES_ROLE, CREATE_PAYMENTS_ROLE } = getAllRoles(ethers) const USER_ADDRESS = '0xdDb5f4535123DAa5aE343c24006F4075aBAF5F7B' const ADDRESS_PLACEHOLDER = '0x0123456789012345678901234567890123456789' @@ -168,7 +168,6 @@ describe('Integration tests on Gnosis deployment', () => { await lendingManager.connect(daoOwner).changeToken(pntOnGnosis.target) await registrationManager.connect(daoOwner).changeToken(pntOnGnosis.target) await rewardsManager.connect(daoOwner).changeToken(pntOnGnosis.target) - await rewardsManager.connect(daoOwner).grantRole(DEPOSIT_REWARD_ROLE, DANDELION_VOTING_ADDRESS) } const checkInitialized = async () => {