From 20d98afcdad0665377e2a93bf651885cfbb5fffd Mon Sep 17 00:00:00 2001 From: s1fr0 <28568419+s1fr0@users.noreply.github.com> Date: Tue, 4 Oct 2022 01:16:33 +0200 Subject: [PATCH] fix(rln): no need to expose hash in Rln.sol --- contracts/Rln.sol | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/contracts/Rln.sol b/contracts/Rln.sol index 4c772fd..4df5fcc 100644 --- a/contracts/Rln.sol +++ b/contracts/Rln.sol @@ -79,7 +79,7 @@ contract RLN { require(receiver != address(0), "RLN, _withdraw: empty receiver address"); // derive public key - uint256 pubkey = _hash(secret); + uint256 pubkey = hash(secret); require(members[_pubkeyIndex] == pubkey, "RLN, _withdraw: not verified"); // delete member @@ -92,13 +92,7 @@ contract RLN { emit MemberWithdrawn(pubkey, _pubkeyIndex); } - function hash( - uint256 value - ) external returns (uint256) { - return poseidonHasher.hash(value); - } - - function _hash(uint256 input) internal view returns (uint256) { + function hash(uint256 input) internal view returns (uint256) { return poseidonHasher.hash(input); } } \ No newline at end of file