diff --git a/packages/plugin-hardhat/CHANGELOG.md b/packages/plugin-hardhat/CHANGELOG.md index 0a3689000..906b2a5e3 100644 --- a/packages/plugin-hardhat/CHANGELOG.md +++ b/packages/plugin-hardhat/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased + +- Update dependency on undici. ([#948](https://github.com/OpenZeppelin/openzeppelin-upgrades/pull/948)) + ## 3.0.0 (2023-12-11) - Deploy proxies from OpenZeppelin Contracts 5.0. ([#919](https://github.com/OpenZeppelin/openzeppelin-upgrades/pull/919)) diff --git a/packages/plugin-hardhat/package.json b/packages/plugin-hardhat/package.json index 9f4b01f06..08f171dcc 100644 --- a/packages/plugin-hardhat/package.json +++ b/packages/plugin-hardhat/package.json @@ -44,7 +44,7 @@ "debug": "^4.1.1", "ethereumjs-util": "^7.1.5", "proper-lockfile": "^4.1.1", - "undici": "^5.14.0" + "undici": "^5.28.2" }, "peerDependencies": { "@nomicfoundation/hardhat-ethers": "^3.0.0", diff --git a/packages/plugin-hardhat/src/utils/etherscan-api.ts b/packages/plugin-hardhat/src/utils/etherscan-api.ts index 33b510fa2..fe4843027 100644 --- a/packages/plugin-hardhat/src/utils/etherscan-api.ts +++ b/packages/plugin-hardhat/src/utils/etherscan-api.ts @@ -32,7 +32,7 @@ export async function callEtherscanApi(etherscan: Etherscan, params: any): Promi const responseBodyJson = await response.body.json(); debug('Etherscan response', JSON.stringify(responseBodyJson)); - return responseBodyJson; + return responseBodyJson as EtherscanResponseBody; } /** @@ -64,7 +64,7 @@ interface EtherscanConfig { interface EtherscanResponseBody { status: string; message: string; - result: any; + result: unknown; } export const RESPONSE_OK = '1'; diff --git a/packages/plugin-hardhat/src/verify-proxy.ts b/packages/plugin-hardhat/src/verify-proxy.ts index 773572b42..7e117c2bc 100644 --- a/packages/plugin-hardhat/src/verify-proxy.ts +++ b/packages/plugin-hardhat/src/verify-proxy.ts @@ -640,7 +640,7 @@ async function getEventResponse( const responseBody = await callEtherscanApi(etherscan, params); if (responseBody.status === RESPONSE_OK) { - const result = responseBody.result; + const result = responseBody.result as EtherscanEventResponse[]; return result[0]; } else if (responseBody.message === 'No records found' || responseBody.message === 'No logs found') { debug(`no result found for event topic ${topic} at address ${address}`); @@ -697,7 +697,7 @@ async function linkProxyWithImplementationAbi( if (responseBody.status === RESPONSE_OK) { // initial call was OK, but need to send a status request using the returned guid to get the actual verification status - const guid = responseBody.result; + const guid = responseBody.result as string; responseBody = await checkProxyVerificationStatus(etherscan, guid); while (responseBody.result === 'Pending in queue') { diff --git a/yarn.lock b/yarn.lock index fb64bd349..9757abdb0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -891,6 +891,11 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" +"@fastify/busboy@^2.0.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.0.tgz#0709e9f4cb252351c609c6e6d8d6779a8d25edff" + integrity sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA== + "@frangio/servbot@^0.2.5": version "0.2.5" resolved "https://registry.yarnpkg.com/@frangio/servbot/-/servbot-0.2.5.tgz#d4524c15c8a34fcdde36037b84407c4c60b4cf16" @@ -12506,6 +12511,13 @@ undici@^5.14.0: dependencies: busboy "^1.6.0" +undici@^5.28.2: + version "5.28.2" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.2.tgz#fea200eac65fc7ecaff80a023d1a0543423b4c91" + integrity sha512-wh1pHJHnUeQV5Xa8/kyQhO7WFa8M34l026L5P/+2TYiakvGy5Rdc8jWZVyG7ieht/0WgJLEd3kcU5gKx+6GC8w== + dependencies: + "@fastify/busboy" "^2.0.0" + unfetch@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.2.0.tgz#7e21b0ef7d363d8d9af0fb929a5555f6ef97a3be"