mirror of
https://github.com/vacp2p/rln-contract.git
synced 2025-01-23 21:09:37 +00:00
fix(rln): add mod on input pk
This commit is contained in:
parent
b8d0a298c7
commit
769505e96f
@ -3,6 +3,7 @@ pragma solidity 0.8.15;
|
|||||||
import { IPoseidonHasher } from "./PoseidonHasher.sol";
|
import { IPoseidonHasher } from "./PoseidonHasher.sol";
|
||||||
|
|
||||||
contract RLN {
|
contract RLN {
|
||||||
|
uint256 constant Q = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||||
uint256 public immutable MEMBERSHIP_DEPOSIT;
|
uint256 public immutable MEMBERSHIP_DEPOSIT;
|
||||||
uint256 public immutable DEPTH;
|
uint256 public immutable DEPTH;
|
||||||
uint256 public immutable SET_SIZE;
|
uint256 public immutable SET_SIZE;
|
||||||
@ -42,7 +43,7 @@ contract RLN {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _register(uint256 pubkey) internal {
|
function _register(uint256 pubkey) internal {
|
||||||
members[pubkeyIndex] = pubkey;
|
members[pubkeyIndex] = mod(pubkey,Q);
|
||||||
emit MemberRegistered(pubkey, pubkeyIndex);
|
emit MemberRegistered(pubkey, pubkeyIndex);
|
||||||
pubkeyIndex += 1;
|
pubkeyIndex += 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user