From 676a5c7b09565ca55dc8aec6ada76cc37b6653e7 Mon Sep 17 00:00:00 2001 From: dovgopoly <69435717+dovgopoly@users.noreply.github.com> Date: Tue, 11 Jun 2024 19:59:06 +0300 Subject: [PATCH] Made merkle proof memory & bumped version (#104) --- contracts/access/MerkleWhitelisted.sol | 10 +++++----- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/contracts/access/MerkleWhitelisted.sol b/contracts/access/MerkleWhitelisted.sol index 9c1dfed2..b386c92b 100644 --- a/contracts/access/MerkleWhitelisted.sol +++ b/contracts/access/MerkleWhitelisted.sol @@ -22,7 +22,7 @@ abstract contract MerkleWhitelisted { bytes32 private _merkleRoot; - modifier onlyWhitelisted(bytes memory data_, bytes32[] calldata merkleProof_) { + modifier onlyWhitelisted(bytes memory data_, bytes32[] memory merkleProof_) { require( isWhitelisted(keccak256(data_), merkleProof_), "MerkleWhitelisted: not whitelisted" @@ -30,7 +30,7 @@ abstract contract MerkleWhitelisted { _; } - modifier onlyWhitelistedUser(address user_, bytes32[] calldata merkleProof_) { + modifier onlyWhitelistedUser(address user_, bytes32[] memory merkleProof_) { require(isWhitelistedUser(user_, merkleProof_), "MerkleWhitelisted: not whitelisted"); _; } @@ -43,9 +43,9 @@ abstract contract MerkleWhitelisted { */ function isWhitelisted( bytes32 leaf_, - bytes32[] calldata merkleProof_ + bytes32[] memory merkleProof_ ) public view returns (bool) { - return merkleProof_.verifyCalldata(_merkleRoot, leaf_); + return merkleProof_.verify(_merkleRoot, leaf_); } /** @@ -56,7 +56,7 @@ abstract contract MerkleWhitelisted { */ function isWhitelistedUser( address user_, - bytes32[] calldata merkleProof_ + bytes32[] memory merkleProof_ ) public view returns (bool) { return isWhitelisted(keccak256(abi.encodePacked(user_)), merkleProof_); } diff --git a/package-lock.json b/package-lock.json index 46ec3008..1d0624ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@solarity/solidity-lib", - "version": "2.7.7", + "version": "2.7.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@solarity/solidity-lib", - "version": "2.7.7", + "version": "2.7.8", "license": "MIT", "dependencies": { "@openzeppelin/contracts": "4.9.5", diff --git a/package.json b/package.json index b0b52671..980709b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@solarity/solidity-lib", - "version": "2.7.7", + "version": "2.7.8", "license": "MIT", "author": "Distributed Lab", "readme": "README.md",