Repository navigation
test(security): add parameterized fuzz invariants for non-custodial zero balance, nonce replay, and venue gates (fixes #156) - #160
Open
arifrhm wants to merge 1 commit into
Conversation
…ero balance, nonce replay, and venue gates (fixes decipherhub#156) Signed-off-by: Arif Rahman <arif.rahman.rhm@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #156
Summary
Adds parameterized fuzz invariants to
test/integration/Invariants.t.solto provide automated production release gates and property-based verification beyond fixed-amount unit tests:testFuzz_unregisteredVenue_adapterNotRegistered:Errors.AdapterNotRegisteredbefore dispatching or mutating any state.testFuzz_nonceReplay_nonceUsed:1 etherto100 ether) and arbitraryuint64nonce, the initial swap succeeds and replaying the identical caller + nonce tuple strictly reverts withErrors.NonceUsed.testFuzz_nonCustodial_zeroBalancesAfterSwap:ExecutionRouterandExecutionAdapterhold strictly zero balances of both the incoming quote token and outgoing RWA token.testFuzz_suspendedVenue_blocks:setVenueSuspended), all subsequent execution attempts across any arbitrary amount strictly revert withErrors.VenueSuspended.Verification & Quality Checks
InvariantsTestpass (forge test --match-contract InvariantsTest -vv): 256 fuzz runs each, 0 reverts/failures.forge test).forge fmt.test/integration/Invariants.t.solmodified.