12 Commits

Author SHA1 Message Date
Roman Zajic
65f9e58df9
chore: adversarial tests (#42)
* test: malicious upgrade drains funds

* fix: formatting

* test: show success when unauthorized upgrade after malicious

* test: offchain proof post lazy erase
- multi-user erase reuse race

* fix: line length

* fix: remove offchain lazy erase test - rate limit still applies

* test: timestamp manipulation

* fix: rename tests

* test: front running for registration

* fix: unused variables

* test: register during spam conditions

* fix: delete failing tests
- test_MaliciousUpgradeDrainsFunds
- testFrontrunning_RegistrationRevertsForVictim
- testFrontrunning_SetFillingSpam

* fix: delete MaliciousImplementation

* fix: formatting with a new Foundry version

* test: testEraseAndReuse with Echidna

* fix: remove limit check

* fix: remove test_MultiUserEraseReuseRace
- test_TimestampManipulationRaces

* fix: skip Echidna contract during forge test

* test: Echidna contract with invariants
- registerMembership
- attemptExtensionRace
- attemptErasureRace

* fix: tune config file

* fix: run and cleanup scripts for echidna

* test: Echidna test replay

* fix: Solidity version

* fix: test_attemptExtensionRace_WakuRLN

* fix: invalid commitment in test_attemptExtensionRace_WakuRLN

* fix: invalid commitments in
test_attemptErasureRace_WakuRLN

* fix: line length

* fix: skip all Echidna tests in CI

* chore: fuzz test expansion (#40)

* test: register invalid

* test: multiple registers

* fix: increase max rejects

* test: erasure with fullErase idCommitments

* fix: reduce cyclomatic complexity

* fix: reduce complexity one step less

* fix: run tests in parallel

* fix: undo run tests in parallel - default already

* test: invalid extension with extreme values

* fix: line length

* test: set MaxTotalRateLimit

* test: set ActiveDuration

* test: Merkle inserts

* test: Merkle erasures

* test: GetRateCommitmentsRange

* test: GetMerkleProof

* fix: optimized MerkleInsert MerkleErasures

* fix: update gas snapshot

* test: malicious upgrade drains funds

* fix: formatting

* test: show success when unauthorized upgrade after malicious

* test: offchain proof post lazy erase
- multi-user erase reuse race

* fix: line length

* fix: remove offchain lazy erase test - rate limit still applies

* fix: remove fuzz tests from CI run

* fix: formatting

* fix: formatting coverage

* test: timestamp manipulation

* fix: rename tests

* test: front running for registration

* fix: unused variables

* test: register during spam conditions

* fix: delete failing tests
- test_MaliciousUpgradeDrainsFunds
- testFrontrunning_RegistrationRevertsForVictim
- testFrontrunning_SetFillingSpam

* fix: delete MaliciousImplementation

* fix: formatting with a new Foundry version

* test: testEraseAndReuse with Echidna

* fix: remove limit check

* fix: remove test_MultiUserEraseReuseRace
- test_TimestampManipulationRaces

* fix: skip Echidna contract during forge test

* test: Echidna contract with invariants
- registerMembership
- attemptExtensionRace
- attemptErasureRace

* fix: tune config file

* fix: run and cleanup scripts for echidna

* test: Echidna test replay

* fix: Solidity version

* fix: test_attemptExtensionRace_WakuRLN

* fix: invalid commitment in test_attemptExtensionRace_WakuRLN

* fix: invalid commitments in
test_attemptErasureRace_WakuRLN

* fix: line length

* fix: skip all Echidna tests in CI

* test: register invalid

* test: multiple registers

* fix: increase max rejects

* test: erasure with fullErase idCommitments

* fix: reduce cyclomatic complexity

* fix: reduce complexity one step less

* test: invalid extension with extreme values

* fix: line length

* test: set MaxTotalRateLimit

* test: set ActiveDuration

* test: Merkle inserts

* test: Merkle erasures

* test: GetRateCommitmentsRange

* test: GetMerkleProof

* fix: optimized MerkleInsert MerkleErasures

* fix: update gas snapshot

* fix: formatting

* fix: remove tests with high overlap

* fix: remove all tests originally meant for fuzzing

* fix: rename merged Echidna tests

* fix: formatting

* test: fuzzing for essential invariants

* test: EchidnaTest contract

* fix: remove unnecessary imports

* fix: remove unnecessary helpers

* fix: remove bounds from invariants

* fix: change test mode to property

* fix: update run script

* fix: max_test_rejects back to the original value

* fix: remove unused local variables

* test: malicious upgrade drains funds

* fix: formatting

* test: show success when unauthorized upgrade after malicious

* test: offchain proof post lazy erase
- multi-user erase reuse race

* fix: line length

* fix: remove offchain lazy erase test - rate limit still applies

* test: timestamp manipulation

* fix: rename tests

* test: front running for registration

* fix: unused variables

* test: register during spam conditions

* fix: delete failing tests
- test_MaliciousUpgradeDrainsFunds
- testFrontrunning_RegistrationRevertsForVictim
- testFrontrunning_SetFillingSpam

* fix: delete MaliciousImplementation

* fix: remove test_MultiUserEraseReuseRace
- test_TimestampManipulationRaces

* test: Echidna test replay

* fix: Solidity version

* fix: test_attemptExtensionRace_WakuRLN

* fix: invalid commitment in test_attemptExtensionRace_WakuRLN

* fix: invalid commitments in
test_attemptErasureRace_WakuRLN

* fix: line length

* fix: cleanup after rebase

* fix: remove redundant file

* fix: formatting

* fix: formatting

* fix: adorno + archive EchidnaReplayRaces.t.sol

* test: focus on erasures with timestamps

* fix: remove isolated test

* test: Echidna tests for races
- add dynamic assertions before operation
- untrack erased IDs

* fix: remove unused replay test
2025-11-14 19:16:11 +08:00
Roman Zajic
f5fff5cdc2
chore: fuzz test expansion (#40)
* test: register invalid

* test: multiple registers

* fix: increase max rejects

* test: erasure with fullErase idCommitments

* fix: reduce cyclomatic complexity

* fix: reduce complexity one step less

* fix: run tests in parallel

* fix: undo run tests in parallel - default already

* test: invalid extension with extreme values

* fix: line length

* test: set MaxTotalRateLimit

* test: set ActiveDuration

* test: Merkle inserts

* test: Merkle erasures

* test: GetRateCommitmentsRange

* test: GetMerkleProof

* fix: optimized MerkleInsert MerkleErasures

* fix: update gas snapshot

* test: malicious upgrade drains funds

* fix: formatting

* test: show success when unauthorized upgrade after malicious

* test: offchain proof post lazy erase
- multi-user erase reuse race

* fix: line length

* fix: remove offchain lazy erase test - rate limit still applies

* fix: remove fuzz tests from CI run

* fix: formatting

* fix: formatting coverage

* test: timestamp manipulation

* fix: rename tests

* test: front running for registration

* fix: unused variables

* test: register during spam conditions

* fix: delete failing tests
- test_MaliciousUpgradeDrainsFunds
- testFrontrunning_RegistrationRevertsForVictim
- testFrontrunning_SetFillingSpam

* fix: delete MaliciousImplementation

* fix: formatting with a new Foundry version

* test: testEraseAndReuse with Echidna

* fix: remove limit check

* fix: remove test_MultiUserEraseReuseRace
- test_TimestampManipulationRaces

* fix: skip Echidna contract during forge test

* test: Echidna contract with invariants
- registerMembership
- attemptExtensionRace
- attemptErasureRace

* fix: tune config file

* fix: run and cleanup scripts for echidna

* test: Echidna test replay

* fix: Solidity version

* fix: test_attemptExtensionRace_WakuRLN

* fix: invalid commitment in test_attemptExtensionRace_WakuRLN

* fix: invalid commitments in
test_attemptErasureRace_WakuRLN

* fix: line length

* fix: skip all Echidna tests in CI

* test: register invalid

* test: multiple registers

* fix: increase max rejects

* test: erasure with fullErase idCommitments

* fix: reduce cyclomatic complexity

* fix: reduce complexity one step less

* test: invalid extension with extreme values

* fix: line length

* test: set MaxTotalRateLimit

* test: set ActiveDuration

* test: Merkle inserts

* test: Merkle erasures

* test: GetRateCommitmentsRange

* test: GetMerkleProof

* fix: optimized MerkleInsert MerkleErasures

* fix: update gas snapshot

* fix: formatting

* fix: remove tests with high overlap

* fix: remove all tests originally meant for fuzzing

* fix: rename merged Echidna tests

* fix: formatting

* test: fuzzing for essential invariants

* test: EchidnaTest contract

* fix: remove unnecessary imports

* fix: remove unnecessary helpers

* fix: remove bounds from invariants

* fix: change test mode to property

* fix: update run script

* fix: max_test_rejects back to the original value

* fix: remove unused local variables
2025-11-07 09:20:49 +08:00
Roman Zajic
e75ac913e5
chore: RLN contract unit test expansion 2 (#39)
* test: mass registration and erasure
- warning cleanup

* test: large pagination query

* test: empty range pagination query

* test: impact of duration changes

* test: upgrade with invalid implementation

* test: unauthorized merkle tree modifications

* test: owner configuration updates

* fix: update gas-snapshot
2025-09-30 09:15:30 +10:00
Roman Zajic
c9f6ae5d8e
chore: RLN contract unit test expansion (#31)
* test: erasing non-existent membership

* test: grace period extension edge cases

* test: max total rate limit edge cases

* test: Merkle Tree update after erasure and reuse

* fix: indent

* test: contract wit zero grace period

* test: full cleanup erasure

* test: token transfer failures
- reentrancy protection

* test: WakuRlnV2 with ReentrancyGuard

* fix: line length

* fix: revert to original WakuRlnV2

* test: reinitialization protection - debug

* test: reinitialization protection - non debug

* test: simplify test reinitialization protection

* fix: MaliciousToken and split reentrancy test
- test__ReentrancyProtectionRegister
- test__ReentrancyProtectionWithdraw

* fix: add more logging to
- test__ReentrancyProtectionWithdraw

* fix: reinitialization protection test

* fix: price calculator reconfiguration

* test: zero price edge case
- add MockPriceCalculator

* fix: calculate impl for MockPriceCalculator

* fix: remove reentrancy tests

* fix: remove ReentrancyGuard import

* fix: recover original comment

* fix: update gas-snapshot

* fix: add revert reason to test reinitialization protection

* fix: cleanup MaliciousToken

* fix: line length

* fix: remove owner transfer in setup

* fix: line length
2025-09-12 22:54:13 +10:00
richΛrd
afb8585f62
feat: membership (#13) 2024-10-23 12:22:32 -04:00
Aaryamann Challani
a576a8949c
chore: emit rate commitment instead of idcommitment (#9)
chore: emit rate commitment instead of idcommitment

chore

chore

forge install: openzeppelin-contracts

v4.9.6

forge install: openzeppelin-contracts-upgradeable

v4.9.6

fix: use oz v4.9.6
2024-06-03 21:09:11 +05:30
Aaryamann Challani
48542f3f04
chore: integrate proxy (#8)
* forge install: openzeppelin-foundry-upgrades

v0.3.1

* forge install: openzeppelin-contracts-upgradeable

v5.0.2

* test: integrate transparent proxy

* test: patch

* fix 

* fix: adorno

* fix: add cardona deployment

* fix: broken test for upgrade

* fix: cleanup

* fix: cleanup

* fix: lint

* fix: remove upgrade from Deploy.s.sol

* fix: envCheck
2024-05-30 19:21:55 +05:30
Aaryamann Challani
5f0d62d52e
chore(tests): add kats test for merkle proof (#7)
* chore(tests): add kats test for merkle proof

fix: cleanup, snapshot

* fix: fixed size return for proof

* fix: remove redundant size check
2024-05-28 18:51:01 +05:30
Aaryamann Challani
834cdbf5bb
chore(deployments): update deployments script (#6) 2024-05-28 17:56:10 +05:30
Aaryamann Challani
4c6b8fb253
chore: tests (#5)
* chore: tests

* fix: add helper to get all metadata from idCommitment

* fix: max runs

* fix: full tree test

* fix: refactor, reuse function for memberExists

* fix: getCommitments range and cut scope from other tests

* fix: range for assert on pagination

* fix: duped conditionals
2024-05-28 15:33:16 +05:30
Aaryamann Challani
6d028a1308
chore: add the initial contract after few optimizations (#4)
* chore: add deps

* fix: fmt in package.json

* chore: add the initial contract after few optimizations

* fix: lint

* chore: more optimizations

* chore: adorno

* fix: test getCommitments too

* chore: add kats

* fix: adorno

* fix: install deps before running build

* ci: add pnpm install before other jobs

* fix: remove magic number

* fix: remove unused errors,events and hardcode depth
2024-05-23 18:33:41 +05:30
rymnc
284cc38916 feat: initial commit 2024-05-21 00:46:20 +00:00