Repository navigation
Conversation
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.
Summary
Resolves #198 by implementing a comprehensive
THREAT_MODEL-driven negative test suite for authorization, privileged role enforcement, and admin-bypass paths across the Zenith protocol contracts (test_fixtures/tests/threat_model_negative.rs).Every test validates live contract instances and asserts concrete, typed contract error codes (
Err(Ok(Error::...))) without relying on generic panics or untyped execution errors.Threat Model Coverage Mapping
vaulttransfer_adminvaulttransfer_admin_via_multisig,pause_via_multisig,unpause_via_multisig,sweep_untagged_via_multisig)Err(Ok(vault::Error::Unauthorized))(Error #6)price_oracleadd_feeder_via_multisig,set_min_reports_via_multisig,set_max_staleness_via_multisig,transfer_admin_via_multisig)Err(Ok(price_oracle::Error::Unauthorized))(Error #9)timelockErr(Ok(timelock::Error::Unauthorized))(Error #2)vault/options_market#[ignore])#[ignore])GUARDIAN,ORACLE_ADMIN,FEE_MANAGER,EMERGENCY_SETTLER)#[ignore])price_oraclemin_reports >= 2None(no price produced without quorum)price_oracleErr(Ok(price_oracle::Error::NotAFeeder))(Error #4)price_oraclevaultErr(Ok(vault::Error::InsufficientEscrowBalance))(Error #3)vaultErr(Ok(vault::Error::UnregisteredIntegrator))(Error #8)vaultsafe_inbound_transfer) credits only arrived tokensmultisigErr(Ok(multisig::Error::NotASigner))(Error #4)multisigErr(Ok(multisig::Error::NotYetApproved))(Error #6)multisigErr(Ok(multisig::Error::AlreadyApproved))(Error #5)multisig#[ignore])timelockErr(Ok(timelock::Error::NotReady))(Error #5)timelockmin_delayErr(Ok(timelock::Error::InsufficientDelay))(Error #3)timelockErr(Ok(timelock::Error::PredecessorNotDone))(Error #6)Test Verification
All other workspace test suites pass with 0 failures:
zenith-multisig: 88 passed, 0 failedzenith-timelock: 23 passed, 0 failedzenith-vault: 69 passed, 0 failedzenith-price-oracle: 146 passed, 0 failedzenith-test-fixtures: 13 passed, 0 failedPayout Wallet (Base / Polygon / EVM):
0xC345C07229307d4f1c7935aD2cAe48e390215808