From 96809eb5c9317dd46bcaa3f9003b602e36c48baf Mon Sep 17 00:00:00 2001 From: Andres Martin Aiello <50411235+andresaiello@users.noreply.github.com> Date: Mon, 2 Sep 2024 12:38:46 -0300 Subject: [PATCH] feat: Instant Rewards contract audit suggestions (#177) * feat: Instant Rewards contract audit suggestions * update to solidity 8.20 --- package.json | 6 +- .../instant-rewards/InstantRewards.sol | 58 +++---- .../contracts/xp-nft/test/xpNFTV2.sol | 2 +- .../contracts/xp-nft/xpNFT.sol | 14 +- packages/zevm-app-contracts/package.json | 3 +- .../test/instant-rewards/instant-rewards.ts | 107 ++++++++++-- .../test/instant-rewards/test.helpers.ts | 47 ++++-- yarn.lock | 157 ++++++++++++------ 8 files changed, 261 insertions(+), 133 deletions(-) diff --git a/package.json b/package.json index 1090d77b..199933ff 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "devDependencies": { "@changesets/cli": "^2.23.1", "@nomicfoundation/hardhat-verify": "2.0.3", - "@nomiclabs/hardhat-ethers": "^2.0.5", + "@nomiclabs/hardhat-ethers": "^2.2.3", "@nomiclabs/hardhat-waffle": "^2.0.3", "@typechain/ethers-v5": "^10.0.0", "@typechain/hardhat": "^6.0.0", @@ -55,8 +55,8 @@ "eslint-plugin-typescript-sort-keys": "2.1.0", "ethereum-waffle": "^4.0.9", "ethereumjs-utils": "^5.2.5", - "ethers": "5.6.8", - "hardhat": "2.12.6", + "ethers": "5.7.2", + "hardhat": "2.22.6", "inquirer": "^8.2.4", "mocha": "^10.2.0", "ts-mocha": "^10.0.0", diff --git a/packages/zevm-app-contracts/contracts/instant-rewards/InstantRewards.sol b/packages/zevm-app-contracts/contracts/instant-rewards/InstantRewards.sol index 8b3c80b9..f06efe6b 100644 --- a/packages/zevm-app-contracts/contracts/instant-rewards/InstantRewards.sol +++ b/packages/zevm-app-contracts/contracts/instant-rewards/InstantRewards.sol @@ -1,22 +1,19 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.7; +pragma solidity ^0.8.20; import "@openzeppelin/contracts/security/Pausable.sol"; -import "@openzeppelin/contracts/access/Ownable.sol"; -import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import "@openzeppelin/contracts/access/Ownable2Step.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; +import "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; +import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; -contract InstantRewards is Ownable, Pausable, ReentrancyGuard { - /* An ECDSA signature. */ - struct Signature { - uint8 v; - bytes32 r; - bytes32 s; - } +contract InstantRewards is Ownable2Step, Pausable, ReentrancyGuard, EIP712 { + bytes32 private constant CLAIM_TYPEHASH = + keccak256("Claim(address to,uint256 sigExpiration,bytes32 taskId,uint256 amount)"); struct ClaimData { address to; - Signature signature; + bytes signature; uint256 sigExpiration; bytes32 taskId; uint256 amount; @@ -26,6 +23,7 @@ contract InstantRewards is Ownable, Pausable, ReentrancyGuard { address public signerAddress; + event SignerUpdated(address indexed signerAddress); event Claimed(address indexed to, bytes32 indexed taskId, uint256 amount); event Withdrawn(address indexed wallet, uint256 amount); @@ -35,41 +33,26 @@ contract InstantRewards is Ownable, Pausable, ReentrancyGuard { error TaskAlreadyClaimed(); error TransferFailed(); - constructor(address signerAddress_, address owner) Ownable() { + constructor(address signerAddress_, address owner) Ownable() EIP712("InstantRewards", "1") { if (signerAddress_ == address(0)) revert InvalidAddress(); transferOwnership(owner); signerAddress = signerAddress_; } function _verify(ClaimData memory claimData) private view { - bytes32 payloadHash = _calculateHash(claimData); - - bytes32 messageHash = ECDSA.toEthSignedMessageHash(payloadHash); - - address messageSigner = ECDSA.recover( - messageHash, - claimData.signature.v, - claimData.signature.r, - claimData.signature.s + bytes32 structHash = keccak256( + abi.encode(CLAIM_TYPEHASH, claimData.to, claimData.sigExpiration, claimData.taskId, claimData.amount) ); + bytes32 constructedHash = _hashTypedDataV4(structHash); - if (signerAddress != messageSigner) revert InvalidSigner(); - if (block.timestamp > claimData.sigExpiration) revert SignatureExpired(); - } - - // Function to compute the hash of the data and tasks for a token - function _calculateHash(ClaimData memory claimData) private pure returns (bytes32) { - bytes memory encodedData = abi.encode( - claimData.to, - claimData.sigExpiration, - claimData.taskId, - claimData.amount - ); + if (!SignatureChecker.isValidSignatureNow(signerAddress, constructedHash, claimData.signature)) { + revert InvalidSigner(); + } - return keccak256(encodedData); + if (block.timestamp > claimData.sigExpiration) revert SignatureExpired(); } - function claim(ClaimData memory claimData) external whenNotPaused nonReentrant { + function claim(ClaimData memory claimData) external nonReentrant whenNotPaused { claimData.to = msg.sender; _verify(claimData); @@ -86,12 +69,15 @@ contract InstantRewards is Ownable, Pausable, ReentrancyGuard { function setSignerAddress(address signerAddress_) external onlyOwner { if (signerAddress_ == address(0)) revert InvalidAddress(); signerAddress = signerAddress_; + emit SignerUpdated(signerAddress_); } function withdraw(address wallet, uint256 amount) external onlyOwner { if (wallet == address(0)) revert InvalidAddress(); if (amount > address(this).balance) revert TransferFailed(); - payable(wallet).transfer(amount); + (bool success, ) = wallet.call{value: amount}(""); + if (!success) revert TransferFailed(); + emit Withdrawn(wallet, amount); } diff --git a/packages/zevm-app-contracts/contracts/xp-nft/test/xpNFTV2.sol b/packages/zevm-app-contracts/contracts/xp-nft/test/xpNFTV2.sol index 37f76e93..5114c94e 100644 --- a/packages/zevm-app-contracts/contracts/xp-nft/test/xpNFTV2.sol +++ b/packages/zevm-app-contracts/contracts/xp-nft/test/xpNFTV2.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.9; +pragma solidity ^0.8.20; import "../xpNFT.sol"; diff --git a/packages/zevm-app-contracts/contracts/xp-nft/xpNFT.sol b/packages/zevm-app-contracts/contracts/xp-nft/xpNFT.sol index 69bcf3c9..e72c79dc 100644 --- a/packages/zevm-app-contracts/contracts/xp-nft/xpNFT.sol +++ b/packages/zevm-app-contracts/contracts/xp-nft/xpNFT.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.9; +pragma solidity ^0.8.20; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; @@ -117,18 +117,6 @@ contract ZetaXP is ERC721Upgradeable, Ownable2StepUpgradeable, EIP712Upgradeable if (updateData.sigTimestamp <= lastUpdateTimestampByTokenId[tokenId]) revert OutdatedSignature(); } - // Function to compute the hash of the data and tasks for a token - function _calculateHash(UpdateData memory updateData) private pure returns (bytes32) { - bytes memory encodedData = abi.encode( - updateData.to, - updateData.signatureExpiration, - updateData.sigTimestamp, - updateData.tag - ); - - return keccak256(encodedData); - } - function _updateNFT(uint256 tokenId, UpdateData memory updateData) internal { _verify(tokenId, updateData); lastUpdateTimestampByTokenId[tokenId] = updateData.sigTimestamp; diff --git a/packages/zevm-app-contracts/package.json b/packages/zevm-app-contracts/package.json index 4069bf6e..1cb0e2e7 100644 --- a/packages/zevm-app-contracts/package.json +++ b/packages/zevm-app-contracts/package.json @@ -39,7 +39,6 @@ "@openzeppelin/hardhat-upgrades": "^1.7.0-rc.0", "@uniswap/v2-periphery": "1.1.0-beta.0", "@zetachain/networks": "^4.0.0", - "@zetachain/protocol-contracts": "^4.0.1", - "ethers": "5.6.8" + "@zetachain/protocol-contracts": "^4.0.1" } } diff --git a/packages/zevm-app-contracts/test/instant-rewards/instant-rewards.ts b/packages/zevm-app-contracts/test/instant-rewards/instant-rewards.ts index 27ff9018..b1f338ff 100644 --- a/packages/zevm-app-contracts/test/instant-rewards/instant-rewards.ts +++ b/packages/zevm-app-contracts/test/instant-rewards/instant-rewards.ts @@ -7,6 +7,8 @@ import { ethers } from "hardhat"; import { InstantRewards } from "../../typechain-types"; import { ClaimData, getSignature } from "./test.helpers"; +const HARDHAT_CHAIN_ID = 1337; + describe("Instant Rewards Contract test", () => { let instantRewards: InstantRewards, owner: SignerWithAddress, @@ -17,6 +19,8 @@ describe("Instant Rewards Contract test", () => { const encodeTaskId = (taskId: string) => utils.keccak256(utils.defaultAbiCoder.encode(["string"], [taskId])); const getClaimDataSigned = async ( + chainId: number, + verifyingContract: string, signer: SignerWithAddress, amount: BigNumber, sigExpiration: number, @@ -30,7 +34,7 @@ describe("Instant Rewards Contract test", () => { to, }; - const signature = await getSignature(signer, claimData); + const signature = await getSignature(chainId, verifyingContract, signer, claimData); return { ...claimData, signature, @@ -59,7 +63,15 @@ describe("Instant Rewards Contract test", () => { value: amount, }); - const claimDataSigned = await getClaimDataSigned(signer, amount, sigExpiration, taskId, to); + const claimDataSigned = await getClaimDataSigned( + HARDHAT_CHAIN_ID, + instantRewards.address, + signer, + amount, + sigExpiration, + taskId, + to + ); const tx = instantRewards.claim(claimDataSigned); await expect(tx).to.emit(instantRewards, "Claimed").withArgs(owner.address, taskId, amount); @@ -81,7 +93,15 @@ describe("Instant Rewards Contract test", () => { value: amount, }); - const claimDataSigned = await getClaimDataSigned(signer, amount, sigExpiration, taskId, to); + const claimDataSigned = await getClaimDataSigned( + HARDHAT_CHAIN_ID, + instantRewards.address, + signer, + amount, + sigExpiration, + taskId, + to + ); const tx = instantRewards.claim(claimDataSigned); await expect(tx).to.emit(instantRewards, "Claimed").withArgs(owner.address, taskId, amount); @@ -94,7 +114,15 @@ describe("Instant Rewards Contract test", () => { const taskId = encodeTaskId("WALLET/TASK/EPOC"); const to = user.address; - const claimDataSigned = await getClaimDataSigned(signer, amount, sigExpiration, taskId, to); + const claimDataSigned = await getClaimDataSigned( + HARDHAT_CHAIN_ID, + instantRewards.address, + signer, + amount, + sigExpiration, + taskId, + to + ); const tx = instantRewards.claim(claimDataSigned); await expect(tx).to.revertedWith("InvalidSigner"); @@ -107,7 +135,15 @@ describe("Instant Rewards Contract test", () => { const taskId = encodeTaskId("WALLET/TASK/EPOC"); const to = owner.address; - const claimDataSigned = await getClaimDataSigned(signer, amount, sigExpiration, taskId, to); + const claimDataSigned = await getClaimDataSigned( + HARDHAT_CHAIN_ID, + instantRewards.address, + signer, + amount, + sigExpiration, + taskId, + to + ); const tx = instantRewards.claim(claimDataSigned); await expect(tx).to.revertedWith("SignatureExpired"); @@ -122,7 +158,15 @@ describe("Instant Rewards Contract test", () => { await instantRewards.pause(); - const claimDataSigned = await getClaimDataSigned(signer, amount, sigExpiration, taskId, to); + const claimDataSigned = await getClaimDataSigned( + HARDHAT_CHAIN_ID, + instantRewards.address, + signer, + amount, + sigExpiration, + taskId, + to + ); const tx = instantRewards.claim(claimDataSigned); await expect(tx).to.revertedWith("Pausable: paused"); @@ -141,7 +185,15 @@ describe("Instant Rewards Contract test", () => { value: amount, }); - const claimDataSigned = await getClaimDataSigned(signer, amount, sigExpiration, taskId, to); + const claimDataSigned = await getClaimDataSigned( + HARDHAT_CHAIN_ID, + instantRewards.address, + signer, + amount, + sigExpiration, + taskId, + to + ); instantRewards.claim(claimDataSigned); @@ -163,10 +215,26 @@ describe("Instant Rewards Contract test", () => { }); { - const claimDataSigned = await getClaimDataSigned(signer, amount, sigExpiration, taskId, to); + const claimDataSigned = await getClaimDataSigned( + HARDHAT_CHAIN_ID, + instantRewards.address, + signer, + amount, + sigExpiration, + taskId, + to + ); instantRewards.claim(claimDataSigned); } - const claimDataSigned = await getClaimDataSigned(signer, amount.add(parseEther("1")), sigExpiration, taskId, to); + const claimDataSigned = await getClaimDataSigned( + HARDHAT_CHAIN_ID, + instantRewards.address, + signer, + amount.add(parseEther("1")), + sigExpiration, + taskId, + to + ); const tx = instantRewards.claim(claimDataSigned); await expect(tx).to.revertedWith("TaskAlreadyClaimed"); }); @@ -184,9 +252,25 @@ describe("Instant Rewards Contract test", () => { value: amount, }); - const claimDataSigned = await getClaimDataSigned(signer, amount, sigExpiration, taskId, to); + const claimDataSigned = await getClaimDataSigned( + HARDHAT_CHAIN_ID, + instantRewards.address, + signer, + amount, + sigExpiration, + taskId, + to + ); - const newClaimDataSigned = await getClaimDataSigned(signer, amount, sigExpiration + 1000, taskId, to); + const newClaimDataSigned = await getClaimDataSigned( + HARDHAT_CHAIN_ID, + instantRewards.address, + signer, + amount, + sigExpiration + 1000, + taskId, + to + ); instantRewards.claim(newClaimDataSigned); @@ -205,6 +289,7 @@ describe("Instant Rewards Contract test", () => { expect(ownerAddr).to.be.eq(owner.address); } await instantRewards.transferOwnership(user.address); + await instantRewards.connect(user).acceptOwnership(); { const ownerAddr = await instantRewards.owner(); expect(ownerAddr).to.be.eq(user.address); diff --git a/packages/zevm-app-contracts/test/instant-rewards/test.helpers.ts b/packages/zevm-app-contracts/test/instant-rewards/test.helpers.ts index 4eba66d2..3c2cb28b 100644 --- a/packages/zevm-app-contracts/test/instant-rewards/test.helpers.ts +++ b/packages/zevm-app-contracts/test/instant-rewards/test.helpers.ts @@ -1,12 +1,5 @@ import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { BigNumber } from "ethers"; -import { ethers } from "hardhat"; - -export interface Signature { - r: string; - s: string; - v: number; -} export interface ClaimData { amount: BigNumber; @@ -16,18 +9,38 @@ export interface ClaimData { } export interface ClaimDataSigned extends ClaimData { - signature: Signature; + signature: string; } -export const getSignature = async (signer: SignerWithAddress, claimData: ClaimData) => { - let payload = ethers.utils.defaultAbiCoder.encode( - ["address", "uint256", "bytes32", "uint256"], - [claimData.to, claimData.sigExpiration, claimData.taskId, claimData.amount] - ); +export const getSignature = async ( + chainId: number, + verifyingContract: string, + signer: SignerWithAddress, + claimData: ClaimData +) => { + const domain = { + chainId: chainId, + name: "InstantRewards", + verifyingContract: verifyingContract, + version: "1", + }; - const payloadHash = ethers.utils.keccak256(payload); + const types = { + Claim: [ + { name: "to", type: "address" }, + { name: "sigExpiration", type: "uint256" }, + { name: "taskId", type: "bytes32" }, + { name: "amount", type: "uint256" }, + ], + }; - // This adds the message prefix - const signature = await signer.signMessage(ethers.utils.arrayify(payloadHash)); - return ethers.utils.splitSignature(signature); + const value = { + amount: claimData.amount, + sigExpiration: claimData.sigExpiration, + taskId: claimData.taskId, + to: claimData.to, + }; + // Signing the data + const signature = await signer._signTypedData(domain, types, value); + return signature; }; diff --git a/yarn.lock b/yarn.lock index c86a0c5e..59a0bf33 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2266,6 +2266,13 @@ __metadata: languageName: node linkType: hard +"@nomicfoundation/edr-darwin-arm64@npm:0.4.2": + version: 0.4.2 + resolution: "@nomicfoundation/edr-darwin-arm64@npm:0.4.2" + checksum: 7835e998c2ef83924efac0694bb4392f6abf770dc7f935dd28abc1a291f830cade14750d83a46a3205338e4ddff943dda60a9849317cf42edd38d7a2ce843588 + languageName: node + linkType: hard + "@nomicfoundation/edr-darwin-x64@npm:0.2.1": version: 0.2.1 resolution: "@nomicfoundation/edr-darwin-x64@npm:0.2.1" @@ -2273,6 +2280,13 @@ __metadata: languageName: node linkType: hard +"@nomicfoundation/edr-darwin-x64@npm:0.4.2": + version: 0.4.2 + resolution: "@nomicfoundation/edr-darwin-x64@npm:0.4.2" + checksum: 94daa26610621e85cb025feb37bb93e9b89c59f908bf3eae70720d2b86632dbb1236420ae3ae6f685d563ba52519d5f860e68ccd898fa1fced831961dea2c08a + languageName: node + linkType: hard + "@nomicfoundation/edr-linux-arm64-gnu@npm:0.2.1": version: 0.2.1 resolution: "@nomicfoundation/edr-linux-arm64-gnu@npm:0.2.1" @@ -2280,6 +2294,13 @@ __metadata: languageName: node linkType: hard +"@nomicfoundation/edr-linux-arm64-gnu@npm:0.4.2": + version: 0.4.2 + resolution: "@nomicfoundation/edr-linux-arm64-gnu@npm:0.4.2" + checksum: a7181e237f6ece8bd97e0f75972044dbf584c506bbac5bef586d9f7d627a2c07a279a2d892837bbedc80ea3dfb39fa66becc297238b5d715a942eed2a50745cd + languageName: node + linkType: hard + "@nomicfoundation/edr-linux-arm64-musl@npm:0.2.1": version: 0.2.1 resolution: "@nomicfoundation/edr-linux-arm64-musl@npm:0.2.1" @@ -2287,6 +2308,13 @@ __metadata: languageName: node linkType: hard +"@nomicfoundation/edr-linux-arm64-musl@npm:0.4.2": + version: 0.4.2 + resolution: "@nomicfoundation/edr-linux-arm64-musl@npm:0.4.2" + checksum: 5a849484b7a104a7e1497774c4117afc58f64d57d30889d4f6f676dddb5c695192c0789b8be0b71171a2af770167a28aa301ae3ece7a2a156d82d94388639b66 + languageName: node + linkType: hard + "@nomicfoundation/edr-linux-x64-gnu@npm:0.2.1": version: 0.2.1 resolution: "@nomicfoundation/edr-linux-x64-gnu@npm:0.2.1" @@ -2294,6 +2322,13 @@ __metadata: languageName: node linkType: hard +"@nomicfoundation/edr-linux-x64-gnu@npm:0.4.2": + version: 0.4.2 + resolution: "@nomicfoundation/edr-linux-x64-gnu@npm:0.4.2" + checksum: 0520dd9a583976fd0f49dfe6c23227f03cd811a395dc5eed1a2922b4358d7c71fdcfea8f389d4a0e23b4ec53e1435959a544380f94e48122a75f94a42b177ac7 + languageName: node + linkType: hard + "@nomicfoundation/edr-linux-x64-musl@npm:0.2.1": version: 0.2.1 resolution: "@nomicfoundation/edr-linux-x64-musl@npm:0.2.1" @@ -2301,6 +2336,13 @@ __metadata: languageName: node linkType: hard +"@nomicfoundation/edr-linux-x64-musl@npm:0.4.2": + version: 0.4.2 + resolution: "@nomicfoundation/edr-linux-x64-musl@npm:0.4.2" + checksum: 80c3b4346d8c27539bc005b09db233dedd8930310d1a049827661e69a8e03be9cbac27eb620a6ae9bfd46a2fbe22f83cee5af8d9e63178925d74d9c656246708 + languageName: node + linkType: hard + "@nomicfoundation/edr-win32-arm64-msvc@npm:0.2.1": version: 0.2.1 resolution: "@nomicfoundation/edr-win32-arm64-msvc@npm:0.2.1" @@ -2322,6 +2364,13 @@ __metadata: languageName: node linkType: hard +"@nomicfoundation/edr-win32-x64-msvc@npm:0.4.2": + version: 0.4.2 + resolution: "@nomicfoundation/edr-win32-x64-msvc@npm:0.4.2" + checksum: 736fb866fd5c2708560cbd5ae72815b5fc96e650cd74bc8bab0a1cb0e8baede4f595fdceb445c159814a6a7e8e691de227a5db49f61b3cd0ddfafd5715b397ab + languageName: node + linkType: hard + "@nomicfoundation/edr@npm:^0.2.0": version: 0.2.1 resolution: "@nomicfoundation/edr@npm:0.2.1" @@ -2358,7 +2407,22 @@ __metadata: languageName: node linkType: hard -"@nomicfoundation/ethereumjs-block@npm:4.2.2, @nomicfoundation/ethereumjs-block@npm:^4.0.0": +"@nomicfoundation/edr@npm:^0.4.1": + version: 0.4.2 + resolution: "@nomicfoundation/edr@npm:0.4.2" + dependencies: + "@nomicfoundation/edr-darwin-arm64": 0.4.2 + "@nomicfoundation/edr-darwin-x64": 0.4.2 + "@nomicfoundation/edr-linux-arm64-gnu": 0.4.2 + "@nomicfoundation/edr-linux-arm64-musl": 0.4.2 + "@nomicfoundation/edr-linux-x64-gnu": 0.4.2 + "@nomicfoundation/edr-linux-x64-musl": 0.4.2 + "@nomicfoundation/edr-win32-x64-msvc": 0.4.2 + checksum: 8c8457257b59ed9a29d88b7492e98e974d24e8318903e876a14dc0f6d5dc77948cd9053937d9730f54f920ba82ce3d244cab518d068359bcc20df88623f171ef + languageName: node + linkType: hard + +"@nomicfoundation/ethereumjs-block@npm:4.2.2": version: 4.2.2 resolution: "@nomicfoundation/ethereumjs-block@npm:4.2.2" dependencies: @@ -2372,7 +2436,7 @@ __metadata: languageName: node linkType: hard -"@nomicfoundation/ethereumjs-blockchain@npm:6.2.2, @nomicfoundation/ethereumjs-blockchain@npm:^6.0.0": +"@nomicfoundation/ethereumjs-blockchain@npm:6.2.2": version: 6.2.2 resolution: "@nomicfoundation/ethereumjs-blockchain@npm:6.2.2" dependencies: @@ -2392,7 +2456,7 @@ __metadata: languageName: node linkType: hard -"@nomicfoundation/ethereumjs-common@npm:3.1.2, @nomicfoundation/ethereumjs-common@npm:^3.0.0": +"@nomicfoundation/ethereumjs-common@npm:3.1.2": version: 3.1.2 resolution: "@nomicfoundation/ethereumjs-common@npm:3.1.2" dependencies: @@ -2425,7 +2489,7 @@ __metadata: languageName: node linkType: hard -"@nomicfoundation/ethereumjs-evm@npm:1.3.2, @nomicfoundation/ethereumjs-evm@npm:^1.0.0, @nomicfoundation/ethereumjs-evm@npm:^1.0.0-rc.3": +"@nomicfoundation/ethereumjs-evm@npm:1.3.2, @nomicfoundation/ethereumjs-evm@npm:^1.0.0-rc.3": version: 1.3.2 resolution: "@nomicfoundation/ethereumjs-evm@npm:1.3.2" dependencies: @@ -2441,7 +2505,7 @@ __metadata: languageName: node linkType: hard -"@nomicfoundation/ethereumjs-rlp@npm:4.0.3, @nomicfoundation/ethereumjs-rlp@npm:^4.0.0": +"@nomicfoundation/ethereumjs-rlp@npm:4.0.3": version: 4.0.3 resolution: "@nomicfoundation/ethereumjs-rlp@npm:4.0.3" bin: @@ -2459,7 +2523,7 @@ __metadata: languageName: node linkType: hard -"@nomicfoundation/ethereumjs-statemanager@npm:1.0.5, @nomicfoundation/ethereumjs-statemanager@npm:^1.0.0": +"@nomicfoundation/ethereumjs-statemanager@npm:1.0.5": version: 1.0.5 resolution: "@nomicfoundation/ethereumjs-statemanager@npm:1.0.5" dependencies: @@ -2474,7 +2538,7 @@ __metadata: languageName: node linkType: hard -"@nomicfoundation/ethereumjs-trie@npm:5.0.5, @nomicfoundation/ethereumjs-trie@npm:^5.0.0": +"@nomicfoundation/ethereumjs-trie@npm:5.0.5": version: 5.0.5 resolution: "@nomicfoundation/ethereumjs-trie@npm:5.0.5" dependencies: @@ -2486,7 +2550,7 @@ __metadata: languageName: node linkType: hard -"@nomicfoundation/ethereumjs-tx@npm:4.1.2, @nomicfoundation/ethereumjs-tx@npm:^4.0.0": +"@nomicfoundation/ethereumjs-tx@npm:4.1.2": version: 4.1.2 resolution: "@nomicfoundation/ethereumjs-tx@npm:4.1.2" dependencies: @@ -2515,7 +2579,7 @@ __metadata: languageName: node linkType: hard -"@nomicfoundation/ethereumjs-util@npm:8.0.6, @nomicfoundation/ethereumjs-util@npm:^8.0.0, @nomicfoundation/ethereumjs-util@npm:^8.0.0-rc.3": +"@nomicfoundation/ethereumjs-util@npm:8.0.6, @nomicfoundation/ethereumjs-util@npm:^8.0.0-rc.3": version: 8.0.6 resolution: "@nomicfoundation/ethereumjs-util@npm:8.0.6" dependencies: @@ -2540,7 +2604,7 @@ __metadata: languageName: node linkType: hard -"@nomicfoundation/ethereumjs-vm@npm:^6.0.0, @nomicfoundation/ethereumjs-vm@npm:^6.0.0-rc.3": +"@nomicfoundation/ethereumjs-vm@npm:^6.0.0-rc.3": version: 6.4.2 resolution: "@nomicfoundation/ethereumjs-vm@npm:6.4.2" dependencies: @@ -2692,7 +2756,7 @@ __metadata: languageName: node linkType: hard -"@nomiclabs/hardhat-ethers@npm:^2.0.5, @nomiclabs/hardhat-ethers@npm:^2.2.3": +"@nomiclabs/hardhat-ethers@npm:^2.2.3": version: 2.2.3 resolution: "@nomiclabs/hardhat-ethers@npm:2.2.3" peerDependencies: @@ -3793,7 +3857,6 @@ __metadata: "@uniswap/v2-periphery": 1.1.0-beta.0 "@zetachain/networks": ^4.0.0 "@zetachain/protocol-contracts": ^4.0.1 - ethers: 5.6.8 hardhat-gas-reporter: ^1.0.8 solidity-coverage: ^0.7.20 tsconfig-paths: ^3.14.1 @@ -3821,15 +3884,6 @@ __metadata: languageName: node linkType: hard -"abort-controller@npm:^3.0.0": - version: 3.0.0 - resolution: "abort-controller@npm:3.0.0" - dependencies: - event-target-shim: ^5.0.0 - checksum: 170bdba9b47b7e65906a28c8ce4f38a7a369d78e2271706f020849c1bfe0ee2067d4261df8bbb66eb84f79208fd5b710df759d64191db58cfba7ce8ef9c54b75 - languageName: node - linkType: hard - "abortcontroller-polyfill@npm:^1.7.3": version: 1.7.5 resolution: "abortcontroller-polyfill@npm:1.7.5" @@ -7261,13 +7315,6 @@ __metadata: languageName: node linkType: hard -"event-target-shim@npm:^5.0.0": - version: 5.0.1 - resolution: "event-target-shim@npm:5.0.1" - checksum: 1ffe3bb22a6d51bdeb6bf6f7cf97d2ff4a74b017ad12284cc9e6a279e727dc30a5de6bb613e5596ff4dc3e517841339ad09a7eec44266eccb1aa201a30448166 - languageName: node - linkType: hard - "eventemitter3@npm:4.0.4": version: 4.0.4 resolution: "eventemitter3@npm:4.0.4" @@ -8326,30 +8373,24 @@ __metadata: languageName: node linkType: hard -"hardhat@npm:2.12.6": - version: 2.12.6 - resolution: "hardhat@npm:2.12.6" +"hardhat@npm:2.22.6": + version: 2.22.6 + resolution: "hardhat@npm:2.22.6" dependencies: "@ethersproject/abi": ^5.1.2 "@metamask/eth-sig-util": ^4.0.0 - "@nomicfoundation/ethereumjs-block": ^4.0.0 - "@nomicfoundation/ethereumjs-blockchain": ^6.0.0 - "@nomicfoundation/ethereumjs-common": ^3.0.0 - "@nomicfoundation/ethereumjs-evm": ^1.0.0 - "@nomicfoundation/ethereumjs-rlp": ^4.0.0 - "@nomicfoundation/ethereumjs-statemanager": ^1.0.0 - "@nomicfoundation/ethereumjs-trie": ^5.0.0 - "@nomicfoundation/ethereumjs-tx": ^4.0.0 - "@nomicfoundation/ethereumjs-util": ^8.0.0 - "@nomicfoundation/ethereumjs-vm": ^6.0.0 + "@nomicfoundation/edr": ^0.4.1 + "@nomicfoundation/ethereumjs-common": 4.0.4 + "@nomicfoundation/ethereumjs-tx": 5.0.4 + "@nomicfoundation/ethereumjs-util": 9.0.4 "@nomicfoundation/solidity-analyzer": ^0.1.0 "@sentry/node": ^5.18.1 "@types/bn.js": ^5.1.0 "@types/lru-cache": ^5.1.0 - abort-controller: ^3.0.0 adm-zip: ^0.4.16 aggregate-error: ^3.0.0 ansi-escapes: ^4.3.0 + boxen: ^5.1.2 chalk: ^2.4.2 chokidar: ^3.4.0 ci-info: ^2.0.0 @@ -8369,11 +8410,10 @@ __metadata: mnemonist: ^0.38.0 mocha: ^10.0.0 p-map: ^4.0.0 - qs: ^6.7.0 raw-body: ^2.4.1 resolve: 1.17.0 semver: ^6.3.0 - solc: 0.7.3 + solc: 0.8.26 source-map-support: ^0.5.13 stacktrace-parser: ^0.1.10 tsort: 0.0.1 @@ -8389,8 +8429,8 @@ __metadata: typescript: optional: true bin: - hardhat: internal/cli/cli.js - checksum: c97c5ed2336541e8b0a3034dc5c94319cffbf93fa1b6385091858f8eefb392129c6109cbaca0837fd4dff4d627b3e3ccb931706257a5d0bee71fc7f7fe90a536 + hardhat: internal/cli/bootstrap.js + checksum: 5aec1824db3575d63754de18c2629bcd820bc836d836f8a6346bcd9aa2ae4c397e090c43ea482ee765b704e018001015b5c84c5ded301a6a1144129c1a4c509b languageName: node linkType: hard @@ -11503,7 +11543,7 @@ __metadata: languageName: node linkType: hard -"qs@npm:^6.11.2, qs@npm:^6.4.0, qs@npm:^6.7.0": +"qs@npm:^6.11.2, qs@npm:^6.4.0": version: 6.11.2 resolution: "qs@npm:6.11.2" dependencies: @@ -12592,6 +12632,23 @@ __metadata: languageName: node linkType: hard +"solc@npm:0.8.26": + version: 0.8.26 + resolution: "solc@npm:0.8.26" + dependencies: + command-exists: ^1.2.8 + commander: ^8.1.0 + follow-redirects: ^1.12.1 + js-sha3: 0.8.0 + memorystream: ^0.3.1 + semver: ^5.5.0 + tmp: 0.0.33 + bin: + solcjs: solc.js + checksum: e3eaeac76e60676377b357af8f3919d4c8c6a74b74112b49279fe8c74a3dfa1de8afe4788689fc307453bde336edc8572988d2cf9e909f84d870420eb640400c + languageName: node + linkType: hard + "solc@npm:0.8.7": version: 0.8.7 resolution: "solc@npm:0.8.7" @@ -15080,7 +15137,7 @@ __metadata: dependencies: "@changesets/cli": ^2.23.1 "@nomicfoundation/hardhat-verify": 2.0.3 - "@nomiclabs/hardhat-ethers": ^2.0.5 + "@nomiclabs/hardhat-ethers": ^2.2.3 "@nomiclabs/hardhat-waffle": ^2.0.3 "@typechain/ethers-v5": ^10.0.0 "@typechain/hardhat": ^6.0.0 @@ -15106,8 +15163,8 @@ __metadata: eslint-plugin-typescript-sort-keys: 2.1.0 ethereum-waffle: ^4.0.9 ethereumjs-utils: ^5.2.5 - ethers: 5.6.8 - hardhat: 2.12.6 + ethers: 5.7.2 + hardhat: 2.22.6 inquirer: ^8.2.4 mocha: ^10.2.0 solc: 0.8.7