function benchmark1Mapping() external {
require(allowList[msg.sender] == 1, "not allowed");
// business logic
}
function benchmark2PublicSignature(bytes calldata _signature) external {
require(
allowListSigningAddress ==
keccak256(
abi.encodePacked(
"\x19Ethereum Signed Message:\n32",
bytes32(uint256(uint160(msg.sender)))
)
).recover(_signature),
"not allowed"
);
// business logic
}
function benchmark3MerkleTree(bytes32[] calldata merkleProof) external {
require(
MerkleProof.verify(merkleProof,
merkleRoot,
keccak256(
abi.encodePacked(msg.sender))),
"not allowed");
// business logic
}
Last active
June 29, 2022 08:46
-
-
Save DonkeVerse/6a0af987dbd15181fdeaef12564ca7ac to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment