mirror of
https://github.com/vacp2p/rln-contract.git
synced 2025-01-24 21:39:15 +00:00
Fix: access the pubkey array length once
This commit is contained in:
parent
2abc054713
commit
dc2a1393ef
@ -33,9 +33,10 @@ contract RLN {
|
||||
}
|
||||
|
||||
function registerBatch(uint256[] calldata pubkeys) external payable {
|
||||
require(pubkeyIndex + pubkeys.length <= SET_SIZE, "RLN, registerBatch: set is full");
|
||||
require(msg.value == MEMBERSHIP_DEPOSIT * pubkeys.length, "RLN, registerBatch: membership deposit is not satisfied");
|
||||
for (uint256 i = 0; i < pubkeys.length; i++) {
|
||||
uint256 pubkeylen = pubkeys.length;
|
||||
require(pubkeyIndex + pubkeylen <= SET_SIZE, "RLN, registerBatch: set is full");
|
||||
require(msg.value == MEMBERSHIP_DEPOSIT * pubkeylen, "RLN, registerBatch: membership deposit is not satisfied");
|
||||
for (uint256 i = 0; i < pubkeylen; i++) {
|
||||
_register(pubkeys[i]);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user