Skip to content

Commit

Permalink
fix: lint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
rymnc committed Feb 22, 2024
1 parent 4761115 commit ec8040d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
31 changes: 16 additions & 15 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
RlnTest:test__Constants() (gas: 8619)
RlnTest:test__InvalidRegistration__DuplicateCommitment(uint256) (runs: 1000, μ: 144113, ~: 144113)
RlnTest:test__InvalidRegistration__FullSet() (gas: 1433224)
RlnTest:test__InvalidRegistration__InsufficientDeposit(uint256) (runs: 1000, μ: 17440, ~: 17440)
RlnTest:test__InvalidRegistration__InvalidIdCommitment(uint256) (runs: 1000, μ: 17053, ~: 17058)
RlnTest:test__InvalidRegistration__InvalidUserMessageLimit() (gas: 17055)
RlnTest:test__InvalidRegistration__MaxUserMessageLimit() (gas: 17203)
RlnTest:test__InvalidSlash__InvalidProof() (gas: 1081919)
RlnTest:test__InvalidSlash__MemberNotRegistered(uint256) (runs: 1000, μ: 32521, ~: 32521)
RlnTest:test__InvalidSlash__NoStake(uint256,address) (runs: 1000, μ: 319630, ~: 319682)
RlnTest:test__InvalidSlash__ToRlnAddress() (gas: 151034)
RlnTest:test__InvalidSlash__ToZeroAddress() (gas: 150939)
RlnTest:test__InvalidWithdraw__InsufficientContractBalance() (gas: 145224)
RlnTest:test__InvalidRegistration__DuplicateCommitment(uint256) (runs: 1000, μ: 144283, ~: 144283)
RlnTest:test__InvalidRegistration__FullSet() (gas: 1576547)
RlnTest:test__InvalidRegistration__InsufficientDeposit(uint256) (runs: 1000, μ: 17525, ~: 17525)
RlnTest:test__InvalidRegistration__InvalidIdCommitment(uint256) (runs: 1000, μ: 17098, ~: 17103)
RlnTest:test__InvalidRegistration__InvalidUserMessageLimit() (gas: 17100)
RlnTest:test__InvalidRegistration__MaxUserMessageLimit() (gas: 17248)
RlnTest:test__InvalidSlash__InvalidProof() (gas: 1224746)
RlnTest:test__InvalidSlash__MemberNotRegistered(uint256) (runs: 1000, μ: 30343, ~: 30343)
RlnTest:test__InvalidSlash__NoStake(uint256,address) (runs: 1000, μ: 319489, ~: 319497)
RlnTest:test__InvalidSlash__ToRlnAddress() (gas: 151119)
RlnTest:test__InvalidSlash__ToZeroAddress() (gas: 151024)
RlnTest:test__InvalidWithdraw__InsufficientContractBalance() (gas: 145148)
RlnTest:test__InvalidWithdraw__InsufficientWithdrawalBalance() (gas: 10538)
RlnTest:test__ValidRegistration(uint256) (runs: 1000, μ: 135760, ~: 135760)
RlnTest:test__ValidSlash(uint256,address) (runs: 1000, μ: 203402, ~: 203412)
RlnTest:test__ValidWithdraw(address) (runs: 1000, μ: 202120, ~: 202108)
RlnTest:test__ValidRegistration(uint256) (runs: 1000, μ: 135845, ~: 135845)
RlnTest:test__ValidSlash(uint256,address) (runs: 1000, μ: 203288, ~: 203297)
RlnTest:test__ValidWithdraw(address) (runs: 1000, μ: 202042, ~: 202032)
RlnTest:test__root() (gas: 8178268)
4 changes: 3 additions & 1 deletion src/BinaryIMTMemory.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
pragma solidity ^0.8.19;

import { PoseidonT3 } from "poseidon-solidity/PoseidonT3.sol";

// stripped down version of
// solhint-disable-next-line max-line-length
// https://github.com/privacy-scaling-explorations/zk-kit/blob/718a5c2fa0f6cd577cee3fd08373609ac985d3bb/packages/imt.sol/contracts/internal/InternalBinaryIMT.sol
// that allows getting the root of the rln tree without expensive storage reads/writes
struct BinaryIMTMemoryData {
Expand Down Expand Up @@ -61,6 +62,7 @@ library BinaryIMTMemory {
uint256 public constant Z_20 =
15_019_797_232_609_675_441_998_260_052_101_280_400_536_945_603_062_888_308_240_081_994_073_687_793_470;

// solhint-disable-next-line code-complexity
function defaultZero(uint256 index) public pure returns (uint256) {
if (index == 0) return Z_0;
if (index == 1) return Z_1;
Expand Down

0 comments on commit ec8040d

Please sign in to comment.