Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/memory-merkle #104

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions contracts/access/MerkleWhitelisted.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ 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"
);
_;
}

modifier onlyWhitelistedUser(address user_, bytes32[] calldata merkleProof_) {
modifier onlyWhitelistedUser(address user_, bytes32[] memory merkleProof_) {
require(isWhitelistedUser(user_, merkleProof_), "MerkleWhitelisted: not whitelisted");
_;
}
Expand All @@ -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_);
}

/**
Expand All @@ -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_);
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@solarity/solidity-lib",
"version": "2.7.7",
"version": "2.7.8",
"license": "MIT",
"author": "Distributed Lab",
"readme": "README.md",
Expand Down
Loading