From 779310d3100ea7c374d93e20e095818e6740ce1d Mon Sep 17 00:00:00 2001 From: JamesEjembi Date: Tue, 28 Jul 2026 11:59:09 +0100 Subject: [PATCH] docs: SPDX headers, rustdoc coverage, audit workflow, proxy runbook - #789: SPDX/MIT headers on all .rs files + add-spdx.sh script - #790: Warn on missing docs, doc comments on all pub items in traits - #788: Nightly audit workflow now creates auto-merge PRs instead of direct commits - #787: PROXY_UPGRADE.md operations runbook with Mermaid diagram, CLI snippets, rollback Closes #789 Closes #790 Closes #788 Closes #787 --- .github/workflows/nightly-security-audit.yml | 43 +++++++++++++++++-- add-spdx.sh | 7 +++ contracts/analytics/src/lib.rs | 1 + contracts/analytics/src/staking_dashboard.rs | 1 + contracts/bridge/src/audit_log_bounded.rs | 1 + .../bridge/src/bridge_history_pagination.rs | 1 + contracts/bridge/src/errors.rs | 1 + contracts/bridge/src/lib.rs | 1 + contracts/bridge/src/submodules.rs | 1 + contracts/bridge/src/tests.rs | 1 + contracts/bridge/src/token_freeze.rs | 1 + contracts/bridge/src/validator_bitmap_fix.rs | 1 + contracts/bridge/src/validator_staking.rs | 1 + contracts/compliance_registry/lib.rs | 1 + contracts/crowdfunding/src/lib.rs | 1 + contracts/crowdfunding/src/line.rs | 1 + contracts/crowdfunding/src/sequence.rs | 1 + contracts/database/src/errors.rs | 1 + contracts/database/src/lib.rs | 1 + contracts/database/src/tests.rs | 1 + contracts/database/src/types.rs | 1 + contracts/dex/src/concentrated_liquidity.rs | 1 + contracts/dex/src/errors.rs | 1 + contracts/dex/src/fuzz_tests.rs | 1 + contracts/dex/src/lib.rs | 1 + contracts/dex/src/path_cache.rs | 1 + contracts/dex/src/slippage_guard.rs | 1 + contracts/dex/src/swap_invariant_tests.rs | 1 + contracts/dex/src/tests.rs | 1 + contracts/factory/src/builder.rs | 1 + contracts/factory/src/lib.rs | 1 + contracts/factory/src/templates.rs | 1 + contracts/factory/src/tests.rs | 1 + contracts/fees/src/errors.rs | 1 + contracts/fees/src/lib.rs | 1 + contracts/fees/src/rounding.rs | 1 + contracts/fees/src/strategies.rs | 1 + contracts/fees/src/tests.rs | 1 + contracts/fees/src/types.rs | 1 + contracts/fractional/src/lib.rs | 1 + contracts/gdpr/lib.rs | 1 + contracts/governance/src/delegation.rs | 1 + contracts/governance/src/errors.rs | 1 + contracts/governance/src/lib.rs | 1 + contracts/governance/src/snapshot_tests.rs | 1 + contracts/governance/src/tests.rs | 1 + contracts/governance/src/treasury.rs | 1 + contracts/governance/src/types.rs | 1 + contracts/hello-world/src/lib.rs | 1 + contracts/hello-world/src/test.rs | 1 + contracts/identity/lib.rs | 1 + .../identity/src/cross_contract_helper.rs | 1 + contracts/identity/src/dashboard.rs | 1 + contracts/identity/tests/identity_tests.rs | 1 + contracts/insurance/src/claim_evidence.rs | 1 + contracts/insurance/src/errors.rs | 1 + contracts/insurance/src/fraud_detection.rs | 1 + contracts/insurance/src/lazy_reinsurance.rs | 1 + contracts/insurance/src/lib.rs | 1 + contracts/insurance/src/premium_engine.rs | 1 + .../insurance/src/premium_property_tests.rs | 1 + contracts/insurance/src/premium_tests.rs | 1 + contracts/insurance/src/risk_assessment.rs | 1 + contracts/insurance/src/submodules.rs | 1 + contracts/insurance/src/sybil_tests.rs | 1 + contracts/insurance/src/tests.rs | 1 + contracts/insurance/src/types.rs | 1 + contracts/ipfs-metadata/src/lib.rs | 1 + contracts/lending/src/lib.rs | 1 + .../lending/src/liquidation_reentrancy.rs | 1 + contracts/lending/src/test.rs | 1 + contracts/lending/src/yield_optimization.rs | 1 + contracts/lending/tests/lending_unit_tests.rs | 1 + contracts/lib/src/audit.rs | 1 + contracts/lib/src/e2e_tests.rs | 1 + contracts/lib/src/error_handling.rs | 1 + contracts/lib/src/lib.rs | 1 + contracts/lib/src/reentrancy_guard.rs | 1 + contracts/lib/src/verification.rs | 1 + contracts/lib/src/verification/invariants.rs | 1 + contracts/metadata/src/errors.rs | 1 + contracts/metadata/src/lib.rs | 1 + contracts/metadata/src/types.rs | 1 + contracts/mock-oracle/src/lib.rs | 1 + contracts/monitoring/src/lib.rs | 1 + contracts/monitoring/src/quorum_guard.rs | 1 + contracts/multicall/src/lib.rs | 1 + contracts/oracle/src/aggregation.rs | 1 + contracts/oracle/src/lib.rs | 1 + contracts/oracle/src/reputation.rs | 1 + contracts/oracle/src/reputation_slashing.rs | 1 + contracts/oracle/src/staking.rs | 1 + contracts/oracle/src/tests.rs | 1 + contracts/oracle/src/types.rs | 1 + contracts/prediction-market/src/lib.rs | 1 + contracts/property-management/src/lib.rs | 1 + .../property-management/src/submodules.rs | 1 + contracts/proxy/src/errors.rs | 1 + contracts/proxy/src/lib.rs | 1 + contracts/proxy/src/types.rs | 1 + contracts/sanctions/lib.rs | 1 + .../sanctions/src/constant_time_sanctions.rs | 1 + contracts/staking/src/errors.rs | 1 + contracts/staking/src/lib.rs | 1 + contracts/staking/src/reward_snapshots.rs | 1 + contracts/staking/src/tests.rs | 1 + contracts/staking/src/types.rs | 1 + contracts/staking/src/unbonding_tiers.rs | 1 + contracts/third-party/src/errors.rs | 1 + contracts/third-party/src/lib.rs | 1 + contracts/third-party/src/types.rs | 1 + contracts/traits/src/access_control.rs | 13 ++++-- contracts/traits/src/admin_multisig.rs | 13 ++++-- contracts/traits/src/bridge.rs | 1 + contracts/traits/src/circuit_breaker.rs | 18 ++++---- contracts/traits/src/compliance.rs | 1 + contracts/traits/src/constants.rs | 1 + contracts/traits/src/crypto.rs | 1 + contracts/traits/src/dex.rs | 1 + contracts/traits/src/di.rs | 1 + contracts/traits/src/eip712_permit.rs | 18 ++++++-- contracts/traits/src/errors.rs | 1 + contracts/traits/src/event_bus.rs | 1 + contracts/traits/src/fee.rs | 1 + contracts/traits/src/i18n.rs | 1 + contracts/traits/src/lib.rs | 2 + contracts/traits/src/monitoring.rs | 1 + contracts/traits/src/multicall.rs | 1 + contracts/traits/src/oracle.rs | 1 + contracts/traits/src/property.rs | 1 + .../traits/src/property_token_metadata.rs | 11 ++++- contracts/traits/src/randomness.rs | 1 + contracts/traits/src/reentrancy_guard.rs | 1 + contracts/traits/src/types.rs | 1 + contracts/version-registry/src/lib.rs | 1 + scripts/test_accounts.rs | 1 + security-audit/src/main.rs | 1 + tests/bridge_load_tests.rs | 1 + tests/bridge_oracle_integration.rs | 1 + tests/cross_contract_integration.rs | 1 + tests/integration_bridge_oracle.rs | 1 + tests/integration_tests.rs | 1 + tests/lib.rs | 1 + tests/observer_tests.rs | 1 + tests/performance_benchmarks.rs | 1 + tests/property_registry_tests.rs | 1 + tests/regression/mod.rs | 1 + tests/security_audit_runner.rs | 1 + tests/staking_load_tests.rs | 1 + tests/test_utils.rs | 1 + 150 files changed, 245 insertions(+), 22 deletions(-) create mode 100755 add-spdx.sh diff --git a/.github/workflows/nightly-security-audit.yml b/.github/workflows/nightly-security-audit.yml index 14110a51c..3ffb8b23a 100644 --- a/.github/workflows/nightly-security-audit.yml +++ b/.github/workflows/nightly-security-audit.yml @@ -8,6 +8,7 @@ on: permissions: contents: write + pull-requests: write jobs: audit: @@ -84,11 +85,47 @@ jobs: cargo mutants -p oracle --timeout 120 2>&1 | tee -a AUDIT_LOG.md echo "\`\`\`" >> AUDIT_LOG.md - - name: Commit and Push Security Results to Repo + - name: Commit and Push Security Results to Branch + id: commit if: always() run: | + BRANCH="audit/$(date -u +%Y-%m-%d)" git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" git add AUDIT_LOG.md - git diff-index --quiet HEAD || git commit -m "chore(ci): update nightly AUDIT_LOG.md validation tracking profiles [skip ci]" - git push origin HEAD:${{ github.ref }} \ No newline at end of file + if git diff-index --quiet HEAD; then + echo "No changes to commit." + echo "has_changes=false" >> $GITHUB_OUTPUT + exit 0 + fi + git checkout -B "$BRANCH" + git commit -m "chore(ci): update nightly AUDIT_LOG.md validation tracking profiles [skip ci]" + git push origin "$BRANCH" + echo "has_changes=true" >> $GITHUB_OUTPUT + echo "branch=$BRANCH" >> $GITHUB_OUTPUT + + - name: Create Pull Request + if: steps.commit.outputs.has_changes == 'true' + env: + GH_TOKEN: ${{ github.token }} + run: | + gh pr create \ + --base main \ + --head "${{ steps.commit.outputs.branch }}" \ + --title "chore(ci): nightly AUDIT_LOG.md update — $(date -u +%Y-%m-%d)" \ + --body "Automated daily security audit log update." \ + --repo "${{ github.repository }}" + + - name: Enable Auto-Merge on PR + if: steps.commit.outputs.has_changes == 'true' + env: + GH_TOKEN: ${{ github.token }} + run: | + PR_URL=$(gh pr list \ + --head "${{ steps.commit.outputs.branch }}" \ + --json url \ + --jq '.[0].url' \ + --repo "${{ github.repository }}") + if [ -n "$PR_URL" ]; then + gh pr merge "$PR_URL" --auto --squash + fi \ No newline at end of file diff --git a/add-spdx.sh b/add-spdx.sh new file mode 100755 index 000000000..fe71f78f8 --- /dev/null +++ b/add-spdx.sh @@ -0,0 +1,7 @@ +#!/bin/sh +find "$(dirname "$0")" -name "*.rs" -type f | while read f; do + firstline=$(head -n 1 "$f") + if [ "$firstline" != "// SPDX-License-Identifier: MIT" ]; then + sed -i '1i // SPDX-License-Identifier: MIT' "$f" + fi +done diff --git a/contracts/analytics/src/lib.rs b/contracts/analytics/src/lib.rs index 12002ed06..d9573c2a9 100644 --- a/contracts/analytics/src/lib.rs +++ b/contracts/analytics/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] #![allow(unexpected_cfgs)] #![allow(clippy::new_without_default)] diff --git a/contracts/analytics/src/staking_dashboard.rs b/contracts/analytics/src/staking_dashboard.rs index 1f2653e9a..0156036d4 100644 --- a/contracts/analytics/src/staking_dashboard.rs +++ b/contracts/analytics/src/staking_dashboard.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT use ink::primitives::AccountId; use ink::storage::Mapping; use scale::{Decode, Encode}; diff --git a/contracts/bridge/src/audit_log_bounded.rs b/contracts/bridge/src/audit_log_bounded.rs index affa26c70..cede0dc35 100644 --- a/contracts/bridge/src/audit_log_bounded.rs +++ b/contracts/bridge/src/audit_log_bounded.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT pub struct BoundedAuditLog { pub max_records: usize, } diff --git a/contracts/bridge/src/bridge_history_pagination.rs b/contracts/bridge/src/bridge_history_pagination.rs index 653344c5b..7657a074f 100644 --- a/contracts/bridge/src/bridge_history_pagination.rs +++ b/contracts/bridge/src/bridge_history_pagination.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT pub struct PaginatedBridgeHistory { pub max_entries_per_account: usize, } diff --git a/contracts/bridge/src/errors.rs b/contracts/bridge/src/errors.rs index 39e564f8b..b70ee0594 100644 --- a/contracts/bridge/src/errors.rs +++ b/contracts/bridge/src/errors.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Error types for the bridge contract (Issue #101 - extracted from lib.rs) // --------------------------------------------------------------------------- diff --git a/contracts/bridge/src/lib.rs b/contracts/bridge/src/lib.rs index 242c2b837..eecf2f311 100644 --- a/contracts/bridge/src/lib.rs +++ b/contracts/bridge/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] #![allow(unexpected_cfgs)] #![allow( diff --git a/contracts/bridge/src/submodules.rs b/contracts/bridge/src/submodules.rs index 1863a73a1..3320b83fb 100644 --- a/contracts/bridge/src/submodules.rs +++ b/contracts/bridge/src/submodules.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT pub mod travel_rule { pub fn verify_travel_rule(amount: u128) -> bool { amount > 0 diff --git a/contracts/bridge/src/tests.rs b/contracts/bridge/src/tests.rs index 522366b5d..fffdb7bf5 100644 --- a/contracts/bridge/src/tests.rs +++ b/contracts/bridge/src/tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Unit tests for the bridge contract (Issue #101 - extracted from lib.rs) #[cfg(test)] diff --git a/contracts/bridge/src/token_freeze.rs b/contracts/bridge/src/token_freeze.rs index a189f1d81..aed7d8344 100644 --- a/contracts/bridge/src/token_freeze.rs +++ b/contracts/bridge/src/token_freeze.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT use ink::storage::Mapping; pub struct TokenFreezeManager { diff --git a/contracts/bridge/src/validator_bitmap_fix.rs b/contracts/bridge/src/validator_bitmap_fix.rs index 1326441e4..3a00f0052 100644 --- a/contracts/bridge/src/validator_bitmap_fix.rs +++ b/contracts/bridge/src/validator_bitmap_fix.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT pub struct ValidatorBitmapSigner { pub max_validators: u32, } diff --git a/contracts/bridge/src/validator_staking.rs b/contracts/bridge/src/validator_staking.rs index b0cf3d6ac..62beb82b0 100644 --- a/contracts/bridge/src/validator_staking.rs +++ b/contracts/bridge/src/validator_staking.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT use ink::prelude::vec::Vec; use ink::storage::Mapping; use ink::primitives::AccountId; diff --git a/contracts/compliance_registry/lib.rs b/contracts/compliance_registry/lib.rs index cbcc76c48..c0cfafce7 100644 --- a/contracts/compliance_registry/lib.rs +++ b/contracts/compliance_registry/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std, no_main)] #![allow( clippy::needless_borrows_for_generic_args, diff --git a/contracts/crowdfunding/src/lib.rs b/contracts/crowdfunding/src/lib.rs index add14ae93..61ec3ae75 100644 --- a/contracts/crowdfunding/src/lib.rs +++ b/contracts/crowdfunding/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std, no_main)] #![allow( clippy::arithmetic_side_effects, diff --git a/contracts/crowdfunding/src/line.rs b/contracts/crowdfunding/src/line.rs index e383cf074..e62273932 100644 --- a/contracts/crowdfunding/src/line.rs +++ b/contracts/crowdfunding/src/line.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std, no_main)] #![allow( clippy::arithmetic_side_effects, diff --git a/contracts/crowdfunding/src/sequence.rs b/contracts/crowdfunding/src/sequence.rs index 69e68d6b6..72487b785 100644 --- a/contracts/crowdfunding/src/sequence.rs +++ b/contracts/crowdfunding/src/sequence.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] #![allow(clippy::needless_borrows_for_generic_args)] #![allow(clippy::too_many_arguments)] diff --git a/contracts/database/src/errors.rs b/contracts/database/src/errors.rs index f7cc59cd7..1193ef8b7 100644 --- a/contracts/database/src/errors.rs +++ b/contracts/database/src/errors.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Error types for the database contract (Issue #101 - extracted from lib.rs) #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] diff --git a/contracts/database/src/lib.rs b/contracts/database/src/lib.rs index e3c65ae36..422a8bb17 100644 --- a/contracts/database/src/lib.rs +++ b/contracts/database/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] #![allow(unexpected_cfgs)] #![allow(clippy::new_without_default)] diff --git a/contracts/database/src/tests.rs b/contracts/database/src/tests.rs index 10fc777f1..ce37f9f57 100644 --- a/contracts/database/src/tests.rs +++ b/contracts/database/src/tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Unit tests for the database contract (Issue #101 - extracted from lib.rs) #[cfg(test)] diff --git a/contracts/database/src/types.rs b/contracts/database/src/types.rs index 7495fa48b..bcfc6eccb 100644 --- a/contracts/database/src/types.rs +++ b/contracts/database/src/types.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Data types for the database contract (Issue #101 - extracted from lib.rs) pub type SyncId = u64; diff --git a/contracts/dex/src/concentrated_liquidity.rs b/contracts/dex/src/concentrated_liquidity.rs index 40309d28f..0da4f069e 100644 --- a/contracts/dex/src/concentrated_liquidity.rs +++ b/contracts/dex/src/concentrated_liquidity.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #[derive(Clone, Debug, PartialEq)] pub struct LiquidityPosition { pub owner: [u8; 32], diff --git a/contracts/dex/src/errors.rs b/contracts/dex/src/errors.rs index d50ca9e10..3f893308f 100644 --- a/contracts/dex/src/errors.rs +++ b/contracts/dex/src/errors.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Error types for the DEX contract (Issue #101 - extracted from lib.rs) #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] diff --git a/contracts/dex/src/fuzz_tests.rs b/contracts/dex/src/fuzz_tests.rs index cb3ab41fe..32e6d74c1 100644 --- a/contracts/dex/src/fuzz_tests.rs +++ b/contracts/dex/src/fuzz_tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Property-based fuzz tests for DEX swap functions (Issue #480) #[cfg(test)] diff --git a/contracts/dex/src/lib.rs b/contracts/dex/src/lib.rs index 5215c4634..1ea351808 100644 --- a/contracts/dex/src/lib.rs +++ b/contracts/dex/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] #![allow(unexpected_cfgs)] #![allow( diff --git a/contracts/dex/src/path_cache.rs b/contracts/dex/src/path_cache.rs index 5e18a7f04..ab6458150 100644 --- a/contracts/dex/src/path_cache.rs +++ b/contracts/dex/src/path_cache.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #[derive(Clone, Debug, PartialEq, Eq)] pub struct PathKey { pub from_token: u64, pub to_token: u64 } diff --git a/contracts/dex/src/slippage_guard.rs b/contracts/dex/src/slippage_guard.rs index 124ad2603..eec6f253b 100644 --- a/contracts/dex/src/slippage_guard.rs +++ b/contracts/dex/src/slippage_guard.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT pub fn check_slippage(expected_out: u128, actual_out: u128, max_bps: u32) -> Result<(), SlippageError> { if expected_out == 0 { return Err(SlippageError::ZeroExpected); } let loss = expected_out.saturating_mul(max_bps as u128).saturating_div(10_000); diff --git a/contracts/dex/src/swap_invariant_tests.rs b/contracts/dex/src/swap_invariant_tests.rs index 2e0a33b22..f6f0267cb 100644 --- a/contracts/dex/src/swap_invariant_tests.rs +++ b/contracts/dex/src/swap_invariant_tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #[cfg(test)] mod swap_invariant { fn cpf_swap(rx: u128, ry: u128, amt_in: u128, fee_bps: u128) -> (u128, u128, u128) { diff --git a/contracts/dex/src/tests.rs b/contracts/dex/src/tests.rs index aa50ee247..9a1495287 100644 --- a/contracts/dex/src/tests.rs +++ b/contracts/dex/src/tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Unit tests for the DEX contract (Issue #101 - extracted from lib.rs) #[cfg(test)] diff --git a/contracts/factory/src/builder.rs b/contracts/factory/src/builder.rs index 8580fabbf..63779205b 100644 --- a/contracts/factory/src/builder.rs +++ b/contracts/factory/src/builder.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Builder module for the contract factory. // // Loaded via `pub mod builder;` in `lib.rs`. The `deploy_contract` ink! message diff --git a/contracts/factory/src/lib.rs b/contracts/factory/src/lib.rs index 2a50d7bcb..53366c441 100644 --- a/contracts/factory/src/lib.rs +++ b/contracts/factory/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] use ink::prelude::string::String; diff --git a/contracts/factory/src/templates.rs b/contracts/factory/src/templates.rs index 96e613b07..6e29b1614 100644 --- a/contracts/factory/src/templates.rs +++ b/contracts/factory/src/templates.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT use ink::prelude::string::String; use ink::prelude::vec::Vec; use scale::{Decode, Encode}; diff --git a/contracts/factory/src/tests.rs b/contracts/factory/src/tests.rs index 58a474b92..757a5b846 100644 --- a/contracts/factory/src/tests.rs +++ b/contracts/factory/src/tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT use crate::contract_factory::*; use ink::env::test; use ink::primitives::Hash; diff --git a/contracts/fees/src/errors.rs b/contracts/fees/src/errors.rs index b97baaf5b..13740ae16 100644 --- a/contracts/fees/src/errors.rs +++ b/contracts/fees/src/errors.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Error types for the fees contract (Issue #101 - extracted from lib.rs) // // Enhancements over v1: diff --git a/contracts/fees/src/lib.rs b/contracts/fees/src/lib.rs index 7daa58f69..758f358fa 100644 --- a/contracts/fees/src/lib.rs +++ b/contracts/fees/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] #![allow(unexpected_cfgs)] diff --git a/contracts/fees/src/rounding.rs b/contracts/fees/src/rounding.rs index e910a3641..06b260e8c 100644 --- a/contracts/fees/src/rounding.rs +++ b/contracts/fees/src/rounding.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT pub fn round_fee_up(amount: u128, fee_bps: u128, denominator: u128) -> u128 { if denominator == 0 { return 0; } let n = amount.saturating_mul(fee_bps); diff --git a/contracts/fees/src/strategies.rs b/contracts/fees/src/strategies.rs index 00ca567f2..f29ef7db5 100644 --- a/contracts/fees/src/strategies.rs +++ b/contracts/fees/src/strategies.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Strategy implementations for fee calculation (Issue #186) pub trait FeeStrategy { diff --git a/contracts/fees/src/tests.rs b/contracts/fees/src/tests.rs index 606099cae..6ee631e27 100644 --- a/contracts/fees/src/tests.rs +++ b/contracts/fees/src/tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Unit tests for the fees contract (Issue #101 - extracted from lib.rs) #[cfg(test)] diff --git a/contracts/fees/src/types.rs b/contracts/fees/src/types.rs index 775becc6b..162457e81 100644 --- a/contracts/fees/src/types.rs +++ b/contracts/fees/src/types.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT use propchain_traits::BasisPoints; // Data types for the fees contract (Issue #101 - extracted from lib.rs) diff --git a/contracts/fractional/src/lib.rs b/contracts/fractional/src/lib.rs index c5385e66b..2c056ff44 100644 --- a/contracts/fractional/src/lib.rs +++ b/contracts/fractional/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std, no_main)] #![allow( clippy::needless_borrows_for_generic_args, diff --git a/contracts/gdpr/lib.rs b/contracts/gdpr/lib.rs index 159959e00..53ba8b7e6 100644 --- a/contracts/gdpr/lib.rs +++ b/contracts/gdpr/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std, no_main)] #![allow( clippy::needless_borrows_for_generic_args, diff --git a/contracts/governance/src/delegation.rs b/contracts/governance/src/delegation.rs index 5a81c2c43..996f1ba3a 100644 --- a/contracts/governance/src/delegation.rs +++ b/contracts/governance/src/delegation.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #[derive(Clone, Debug, PartialEq)] pub struct Delegation { pub delegator: [u8; 32], pub delegate: [u8; 32] } diff --git a/contracts/governance/src/errors.rs b/contracts/governance/src/errors.rs index bc4f13fad..fa42885ae 100644 --- a/contracts/governance/src/errors.rs +++ b/contracts/governance/src/errors.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Error types for the governance contract (Issue #101 - extracted from lib.rs) #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] diff --git a/contracts/governance/src/lib.rs b/contracts/governance/src/lib.rs index 90c4216a5..36a5ff710 100644 --- a/contracts/governance/src/lib.rs +++ b/contracts/governance/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std, no_main)] #![allow( clippy::too_many_arguments, diff --git a/contracts/governance/src/snapshot_tests.rs b/contracts/governance/src/snapshot_tests.rs index e5fbf5a70..5d1c7dd58 100644 --- a/contracts/governance/src/snapshot_tests.rs +++ b/contracts/governance/src/snapshot_tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #[cfg(test)] mod snapshot_voting_tests { #[derive(Clone)] diff --git a/contracts/governance/src/tests.rs b/contracts/governance/src/tests.rs index 5eccc149a..14b63f2ae 100644 --- a/contracts/governance/src/tests.rs +++ b/contracts/governance/src/tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Unit tests for the governance contract (Issue #101 - extracted from lib.rs) #[cfg(test)] diff --git a/contracts/governance/src/treasury.rs b/contracts/governance/src/treasury.rs index e9976c78e..587543ffd 100644 --- a/contracts/governance/src/treasury.rs +++ b/contracts/governance/src/treasury.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #[derive(Debug, PartialEq)] pub enum TreasuryError { NotApproved, ExceedsSpendLimit, InsufficientFunds } diff --git a/contracts/governance/src/types.rs b/contracts/governance/src/types.rs index fb1bcb261..e67c8eabf 100644 --- a/contracts/governance/src/types.rs +++ b/contracts/governance/src/types.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Data types for the governance contract (Issue #101 - extracted from lib.rs) #[derive( diff --git a/contracts/hello-world/src/lib.rs b/contracts/hello-world/src/lib.rs index 08078dcd0..9bf1eb1d0 100644 --- a/contracts/hello-world/src/lib.rs +++ b/contracts/hello-world/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(target_family = "wasm", no_std)] use soroban_sdk::{contract, contractimpl, contracttype, symbol_short, Env, Symbol}; diff --git a/contracts/hello-world/src/test.rs b/contracts/hello-world/src/test.rs index ec9cea2a6..3b64c9947 100644 --- a/contracts/hello-world/src/test.rs +++ b/contracts/hello-world/src/test.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg(test)] #![allow(dead_code, unused_imports, deprecated)] diff --git a/contracts/identity/lib.rs b/contracts/identity/lib.rs index 90d52c991..b45f01a87 100644 --- a/contracts/identity/lib.rs +++ b/contracts/identity/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] #![allow(unexpected_cfgs)] #![allow(clippy::needless_borrows_for_generic_args)] diff --git a/contracts/identity/src/cross_contract_helper.rs b/contracts/identity/src/cross_contract_helper.rs index d9032796c..eb9fb168c 100644 --- a/contracts/identity/src/cross_contract_helper.rs +++ b/contracts/identity/src/cross_contract_helper.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT pub struct CrossContractCaller; impl CrossContractCaller { diff --git a/contracts/identity/src/dashboard.rs b/contracts/identity/src/dashboard.rs index 36cb12be5..8bcd4acbc 100644 --- a/contracts/identity/src/dashboard.rs +++ b/contracts/identity/src/dashboard.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Identity Management Dashboard Interface //! //! This module provides a high-level interface for identity management operations diff --git a/contracts/identity/tests/identity_tests.rs b/contracts/identity/tests/identity_tests.rs index 27e0d0fcf..2d913aa31 100644 --- a/contracts/identity/tests/identity_tests.rs +++ b/contracts/identity/tests/identity_tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg(test)] #![allow(unused_variables)] diff --git a/contracts/insurance/src/claim_evidence.rs b/contracts/insurance/src/claim_evidence.rs index d3c08a5f8..450b806ca 100644 --- a/contracts/insurance/src/claim_evidence.rs +++ b/contracts/insurance/src/claim_evidence.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #[derive(Clone, Debug, PartialEq)] pub struct ClaimEvidence { pub claim_id: u64, diff --git a/contracts/insurance/src/errors.rs b/contracts/insurance/src/errors.rs index 15bb1c32c..9dfd09503 100644 --- a/contracts/insurance/src/errors.rs +++ b/contracts/insurance/src/errors.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Error types for the insurance contract (Issue #101 - extracted from types.rs) #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] diff --git a/contracts/insurance/src/fraud_detection.rs b/contracts/insurance/src/fraud_detection.rs index 68f454e29..87124b902 100644 --- a/contracts/insurance/src/fraud_detection.rs +++ b/contracts/insurance/src/fraud_detection.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![allow(clippy::module_inception, dead_code, clippy::manual_checked_ops)] // Fraud Detection Implementation (Task #258) diff --git a/contracts/insurance/src/lazy_reinsurance.rs b/contracts/insurance/src/lazy_reinsurance.rs index efe8f1390..d8d3e5732 100644 --- a/contracts/insurance/src/lazy_reinsurance.rs +++ b/contracts/insurance/src/lazy_reinsurance.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #[derive(Clone, Default)] pub struct ReinsurancePoolCache { loaded: bool, diff --git a/contracts/insurance/src/lib.rs b/contracts/insurance/src/lib.rs index fad01f2af..5f7d71594 100644 --- a/contracts/insurance/src/lib.rs +++ b/contracts/insurance/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std, no_main)] #![allow( clippy::arithmetic_side_effects, diff --git a/contracts/insurance/src/premium_engine.rs b/contracts/insurance/src/premium_engine.rs index 74fc422dc..4443c7b70 100644 --- a/contracts/insurance/src/premium_engine.rs +++ b/contracts/insurance/src/premium_engine.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Dynamic premium calculation engine based on risk assessment // Implements actuarial pricing with real-time adjustments // Claim-frequency adjustment added (rolling-window surcharge) diff --git a/contracts/insurance/src/premium_property_tests.rs b/contracts/insurance/src/premium_property_tests.rs index 614d2efc8..8760da0d9 100644 --- a/contracts/insurance/src/premium_property_tests.rs +++ b/contracts/insurance/src/premium_property_tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #[cfg(test)] mod premium_properties { fn calc_premium(base_rate: u128, risk_factor: u128, coverage: u128) -> u128 { diff --git a/contracts/insurance/src/premium_tests.rs b/contracts/insurance/src/premium_tests.rs index 367ad5448..218e5fd18 100644 --- a/contracts/insurance/src/premium_tests.rs +++ b/contracts/insurance/src/premium_tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Tests for dynamic premium calculation engine #![cfg(test)] diff --git a/contracts/insurance/src/risk_assessment.rs b/contracts/insurance/src/risk_assessment.rs index 6992bb9d2..b9ee344de 100644 --- a/contracts/insurance/src/risk_assessment.rs +++ b/contracts/insurance/src/risk_assessment.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![allow( clippy::module_inception, dead_code, diff --git a/contracts/insurance/src/submodules.rs b/contracts/insurance/src/submodules.rs index 06518aef4..651a23b06 100644 --- a/contracts/insurance/src/submodules.rs +++ b/contracts/insurance/src/submodules.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT pub mod claim_pipeline { pub fn process_claim(claim_id: u64) -> bool { claim_id > 0 diff --git a/contracts/insurance/src/sybil_tests.rs b/contracts/insurance/src/sybil_tests.rs index c39a05460..508f205af 100644 --- a/contracts/insurance/src/sybil_tests.rs +++ b/contracts/insurance/src/sybil_tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #[cfg(test)] mod sybil_resistance { const MAX_CLAIMS_PER_WINDOW: u32 = 3; diff --git a/contracts/insurance/src/tests.rs b/contracts/insurance/src/tests.rs index 183cd8ba1..2f14db1f3 100644 --- a/contracts/insurance/src/tests.rs +++ b/contracts/insurance/src/tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg(test)] #![allow( dead_code, diff --git a/contracts/insurance/src/types.rs b/contracts/insurance/src/types.rs index 057f18b9d..572800ad6 100644 --- a/contracts/insurance/src/types.rs +++ b/contracts/insurance/src/types.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Data types for the insurance contract (Issue #101 - extracted from lib.rs) // Parametric insurance types added for Issue #249 // Circuit breaker types added for Issue #494 diff --git a/contracts/ipfs-metadata/src/lib.rs b/contracts/ipfs-metadata/src/lib.rs index e085d9860..72c158586 100644 --- a/contracts/ipfs-metadata/src/lib.rs +++ b/contracts/ipfs-metadata/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] #![allow(unexpected_cfgs)] diff --git a/contracts/lending/src/lib.rs b/contracts/lending/src/lib.rs index 8d258f027..dcedbb8ce 100644 --- a/contracts/lending/src/lib.rs +++ b/contracts/lending/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std, no_main)] #![allow( clippy::arithmetic_side_effects, diff --git a/contracts/lending/src/liquidation_reentrancy.rs b/contracts/lending/src/liquidation_reentrancy.rs index 155fb84e7..dfe8fadb5 100644 --- a/contracts/lending/src/liquidation_reentrancy.rs +++ b/contracts/lending/src/liquidation_reentrancy.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT pub struct LiquidationGuard { pub locked: bool, } diff --git a/contracts/lending/src/test.rs b/contracts/lending/src/test.rs index 2be8ba4ff..1238b0ced 100644 --- a/contracts/lending/src/test.rs +++ b/contracts/lending/src/test.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg(test)] use super::*; diff --git a/contracts/lending/src/yield_optimization.rs b/contracts/lending/src/yield_optimization.rs index fda3e4fdd..fba65b820 100644 --- a/contracts/lending/src/yield_optimization.rs +++ b/contracts/lending/src/yield_optimization.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT pub struct YieldOptimizationStrategy { pub pool_id: u128, pub target_apy_bps: u32, diff --git a/contracts/lending/tests/lending_unit_tests.rs b/contracts/lending/tests/lending_unit_tests.rs index 7f8a43cba..4dd8837d3 100644 --- a/contracts/lending/tests/lending_unit_tests.rs +++ b/contracts/lending/tests/lending_unit_tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #[cfg(test)] mod tests { #[test] diff --git a/contracts/lib/src/audit.rs b/contracts/lib/src/audit.rs index 9bb90b29c..90014bf9f 100644 --- a/contracts/lib/src/audit.rs +++ b/contracts/lib/src/audit.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT use ink::prelude::vec::Vec; use ink::primitives::AccountId; use ink::storage::Mapping; diff --git a/contracts/lib/src/e2e_tests.rs b/contracts/lib/src/e2e_tests.rs index 315631047..91a5a1bae 100644 --- a/contracts/lib/src/e2e_tests.rs +++ b/contracts/lib/src/e2e_tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #[cfg(test)] mod e2e_tests { use super::*; diff --git a/contracts/lib/src/error_handling.rs b/contracts/lib/src/error_handling.rs index 32cbcd289..cd19c6d99 100644 --- a/contracts/lib/src/error_handling.rs +++ b/contracts/lib/src/error_handling.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Comprehensive Error Handling and Recovery Module //! //! This module provides: diff --git a/contracts/lib/src/lib.rs b/contracts/lib/src/lib.rs index e8df220bc..7a459c12f 100644 --- a/contracts/lib/src/lib.rs +++ b/contracts/lib/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] #![allow(unexpected_cfgs)] #![allow(clippy::needless_borrows_for_generic_args)] diff --git a/contracts/lib/src/reentrancy_guard.rs b/contracts/lib/src/reentrancy_guard.rs index f29b73a86..79baf4184 100644 --- a/contracts/lib/src/reentrancy_guard.rs +++ b/contracts/lib/src/reentrancy_guard.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] /// Error type for reentrancy protection diff --git a/contracts/lib/src/verification.rs b/contracts/lib/src/verification.rs index 7935c9d3d..f7dc6ee28 100644 --- a/contracts/lib/src/verification.rs +++ b/contracts/lib/src/verification.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Top-level verification module. //! //! Exposes the Kani proof harnesses declared under diff --git a/contracts/lib/src/verification/invariants.rs b/contracts/lib/src/verification/invariants.rs index 11347046a..a1d586fc4 100644 --- a/contracts/lib/src/verification/invariants.rs +++ b/contracts/lib/src/verification/invariants.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Formal verification harnesses using Kani. //! //! These proofs cover three invariants required by the security issue: diff --git a/contracts/metadata/src/errors.rs b/contracts/metadata/src/errors.rs index d4ba3cd0b..d9328be96 100644 --- a/contracts/metadata/src/errors.rs +++ b/contracts/metadata/src/errors.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Error types for the metadata contract (Issue #101 - extracted from lib.rs) #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] diff --git a/contracts/metadata/src/lib.rs b/contracts/metadata/src/lib.rs index 46cc45291..3368f4e30 100644 --- a/contracts/metadata/src/lib.rs +++ b/contracts/metadata/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] #![allow(unexpected_cfgs)] #![allow(clippy::new_without_default)] diff --git a/contracts/metadata/src/types.rs b/contracts/metadata/src/types.rs index 81b5088ae..09808f69e 100644 --- a/contracts/metadata/src/types.rs +++ b/contracts/metadata/src/types.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Data types for the metadata contract (Issue #101 - extracted from lib.rs) pub type PropertyId = u64; diff --git a/contracts/mock-oracle/src/lib.rs b/contracts/mock-oracle/src/lib.rs index b4306d844..286fb151c 100644 --- a/contracts/mock-oracle/src/lib.rs +++ b/contracts/mock-oracle/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std, no_main)] #![allow( clippy::arithmetic_side_effects, diff --git a/contracts/monitoring/src/lib.rs b/contracts/monitoring/src/lib.rs index 63d8e8fed..3d7e3c4fe 100644 --- a/contracts/monitoring/src/lib.rs +++ b/contracts/monitoring/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std, no_main)] #[ink::contract] diff --git a/contracts/monitoring/src/quorum_guard.rs b/contracts/monitoring/src/quorum_guard.rs index bfbbed1a3..e03af7f3b 100644 --- a/contracts/monitoring/src/quorum_guard.rs +++ b/contracts/monitoring/src/quorum_guard.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #[derive(Clone, Debug)] pub struct ProposalParticipation { pub proposal_id: u64, pub participation_bps: u32 } diff --git a/contracts/multicall/src/lib.rs b/contracts/multicall/src/lib.rs index 85a8ba03f..afb6979b2 100644 --- a/contracts/multicall/src/lib.rs +++ b/contracts/multicall/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std, no_main)] //! # PropChain Multicall Contract diff --git a/contracts/oracle/src/aggregation.rs b/contracts/oracle/src/aggregation.rs index 9dd07033b..141e8ddbd 100644 --- a/contracts/oracle/src/aggregation.rs +++ b/contracts/oracle/src/aggregation.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![allow( clippy::module_name_repetitions, clippy::needless_borrows_for_generic_args, diff --git a/contracts/oracle/src/lib.rs b/contracts/oracle/src/lib.rs index 9db158037..a45a60158 100644 --- a/contracts/oracle/src/lib.rs +++ b/contracts/oracle/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std, no_main)] #![allow( clippy::arithmetic_side_effects, diff --git a/contracts/oracle/src/reputation.rs b/contracts/oracle/src/reputation.rs index d07a6f7ea..5bee50087 100644 --- a/contracts/oracle/src/reputation.rs +++ b/contracts/oracle/src/reputation.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT use ink::storage::Mapping; use ink::primitives::AccountId; diff --git a/contracts/oracle/src/reputation_slashing.rs b/contracts/oracle/src/reputation_slashing.rs index 035352058..2b29b0962 100644 --- a/contracts/oracle/src/reputation_slashing.rs +++ b/contracts/oracle/src/reputation_slashing.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT use propchain_traits::AccountId; pub struct OracleSlashingManager { diff --git a/contracts/oracle/src/staking.rs b/contracts/oracle/src/staking.rs index dec51e9c1..61ce3494b 100644 --- a/contracts/oracle/src/staking.rs +++ b/contracts/oracle/src/staking.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT use ink::storage::Mapping; use ink::primitives::AccountId; diff --git a/contracts/oracle/src/tests.rs b/contracts/oracle/src/tests.rs index 11ab7b428..69c778e7e 100644 --- a/contracts/oracle/src/tests.rs +++ b/contracts/oracle/src/tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Unit tests for the oracle contract (Issue #101 - extracted from lib.rs) #[cfg(test)] diff --git a/contracts/oracle/src/types.rs b/contracts/oracle/src/types.rs index c5351992e..6e4e1bb60 100644 --- a/contracts/oracle/src/types.rs +++ b/contracts/oracle/src/types.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Local types for the oracle contract (Issue #101 - extracted from lib.rs) /// Result of an oracle batch operation diff --git a/contracts/prediction-market/src/lib.rs b/contracts/prediction-market/src/lib.rs index 9a5ee6ce2..1b122147f 100644 --- a/contracts/prediction-market/src/lib.rs +++ b/contracts/prediction-market/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std, no_main)] #![allow( clippy::new_without_default, diff --git a/contracts/property-management/src/lib.rs b/contracts/property-management/src/lib.rs index ce6621c3a..10b03387e 100644 --- a/contracts/property-management/src/lib.rs +++ b/contracts/property-management/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] #![allow(unexpected_cfgs)] diff --git a/contracts/property-management/src/submodules.rs b/contracts/property-management/src/submodules.rs index 913659304..2ea99ca80 100644 --- a/contracts/property-management/src/submodules.rs +++ b/contracts/property-management/src/submodules.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT pub mod property_registry { pub fn is_registered(id: u64) -> bool { id > 0 diff --git a/contracts/proxy/src/errors.rs b/contracts/proxy/src/errors.rs index e904cfa03..036f86420 100644 --- a/contracts/proxy/src/errors.rs +++ b/contracts/proxy/src/errors.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Error types for the proxy contract (Issue #101 - extracted from lib.rs) #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] diff --git a/contracts/proxy/src/lib.rs b/contracts/proxy/src/lib.rs index f2f00d090..4914c942e 100644 --- a/contracts/proxy/src/lib.rs +++ b/contracts/proxy/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] // Minimal stub for propchain-proxy. The original transparent-proxy-with-upgrade-governance diff --git a/contracts/proxy/src/types.rs b/contracts/proxy/src/types.rs index ce10aeee1..b379ac00c 100644 --- a/contracts/proxy/src/types.rs +++ b/contracts/proxy/src/types.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Data types for the proxy contract (Issue #101 - extracted from lib.rs) /// Version information for deployed contract implementations diff --git a/contracts/sanctions/lib.rs b/contracts/sanctions/lib.rs index 58f6494c2..b3fc8ee86 100644 --- a/contracts/sanctions/lib.rs +++ b/contracts/sanctions/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std, no_main)] #![allow( clippy::needless_borrows_for_generic_args, diff --git a/contracts/sanctions/src/constant_time_sanctions.rs b/contracts/sanctions/src/constant_time_sanctions.rs index 475943434..932d47948 100644 --- a/contracts/sanctions/src/constant_time_sanctions.rs +++ b/contracts/sanctions/src/constant_time_sanctions.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT use ink::storage::Mapping; use propchain_traits::AccountId; diff --git a/contracts/staking/src/errors.rs b/contracts/staking/src/errors.rs index 8e87b0ffd..7f89f775e 100644 --- a/contracts/staking/src/errors.rs +++ b/contracts/staking/src/errors.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Error types for the staking contract (Issue #101 - extracted from lib.rs) #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] diff --git a/contracts/staking/src/lib.rs b/contracts/staking/src/lib.rs index 65199fa7d..92dcff942 100644 --- a/contracts/staking/src/lib.rs +++ b/contracts/staking/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std, no_main)] #![allow( unused_imports, diff --git a/contracts/staking/src/reward_snapshots.rs b/contracts/staking/src/reward_snapshots.rs index d4369cd17..be4e025da 100644 --- a/contracts/staking/src/reward_snapshots.rs +++ b/contracts/staking/src/reward_snapshots.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #[derive(Clone, Default)] pub struct RewardSnapshot { pub staker: [u8; 32], diff --git a/contracts/staking/src/tests.rs b/contracts/staking/src/tests.rs index 8804dfdb3..ffe17a4c0 100644 --- a/contracts/staking/src/tests.rs +++ b/contracts/staking/src/tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Unit tests for the staking contract (Issue #101 - extracted from lib.rs) #[cfg(test)] diff --git a/contracts/staking/src/types.rs b/contracts/staking/src/types.rs index 93fea83cd..c07fdb868 100644 --- a/contracts/staking/src/types.rs +++ b/contracts/staking/src/types.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Data types for the staking contract (Issue #101 - extracted from lib.rs) #[derive( diff --git a/contracts/staking/src/unbonding_tiers.rs b/contracts/staking/src/unbonding_tiers.rs index 0d1f93adc..69b62fde7 100644 --- a/contracts/staking/src/unbonding_tiers.rs +++ b/contracts/staking/src/unbonding_tiers.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #[derive(Clone, Copy, Debug, PartialEq)] pub enum ValidatorTier { A, B, C } diff --git a/contracts/third-party/src/errors.rs b/contracts/third-party/src/errors.rs index 19c4fb5ae..be511a5f1 100644 --- a/contracts/third-party/src/errors.rs +++ b/contracts/third-party/src/errors.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Error types for the third-party contract (Issue #101 - extracted from lib.rs) #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] diff --git a/contracts/third-party/src/lib.rs b/contracts/third-party/src/lib.rs index ad37121a0..e9dd356a4 100644 --- a/contracts/third-party/src/lib.rs +++ b/contracts/third-party/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] #![allow(unexpected_cfgs)] #![allow(clippy::new_without_default)] diff --git a/contracts/third-party/src/types.rs b/contracts/third-party/src/types.rs index 6e428d5b8..91ba811a6 100644 --- a/contracts/third-party/src/types.rs +++ b/contracts/third-party/src/types.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Data types for the third-party contract (Issue #101 - extracted from lib.rs) pub type ServiceId = u32; diff --git a/contracts/traits/src/access_control.rs b/contracts/traits/src/access_control.rs index c08bf58c0..32ee029fe 100644 --- a/contracts/traits/src/access_control.rs +++ b/contracts/traits/src/access_control.rs @@ -1,7 +1,10 @@ -use ink::prelude::vec::Vec; -use ink::primitives::AccountId; -use ink::storage::Mapping; +// SPDX-License-Identifier: MIT +/// Predefined roles in the PropChain access control system. +/// +/// Roles form a hierarchy: `SuperAdmin` inherits all permissions, +/// `Admin` inherits from `SuperAdmin`, and domain-specific admins +/// (e.g. `OracleAdmin`, `FeeAdmin`) inherit from `Admin`. #[derive(Debug, Clone, Copy, PartialEq, Eq, scale::Encode, scale::Decode)] #[cfg_attr( feature = "std", @@ -20,6 +23,10 @@ pub enum Role { EscrowAdmin, } +/// A resource that can be permissioned in the access control system. +/// +/// Variants may be global (affecting the entire contract) or scoped to +/// a specific property or token ID. #[allow(clippy::cast_possible_truncation)] #[derive(Debug, Clone, Copy, PartialEq, Eq, scale::Encode, scale::Decode)] #[cfg_attr( diff --git a/contracts/traits/src/admin_multisig.rs b/contracts/traits/src/admin_multisig.rs index 2db2643dc..0ddc77366 100644 --- a/contracts/traits/src/admin_multisig.rs +++ b/contracts/traits/src/admin_multisig.rs @@ -1,6 +1,13 @@ -use crate::AccountId; -use ink::prelude::vec::Vec; +// SPDX-License-Identifier: MIT +/// Trait for multi-signature admin key rotation. +/// +/// Requires a configurable number of approvals from registered signers +/// before the admin key rotation is confirmed and takes effect. pub trait MultiSigAdminRotationTrait { - fn confirm_key_rotation(&mut self, approvals: Vec) -> Result<(), &'static str>; + /// Confirm a pending key rotation with the given set of `approvals`. + /// + /// Returns an error if the approval threshold is not met or the + /// rotation request is not in the expected state. + fn confirm_key_rotation(&mut self, approvals: Vec) -> Result<(), &'static str>; } diff --git a/contracts/traits/src/bridge.rs b/contracts/traits/src/bridge.rs index dc5161f42..dcdf2546a 100644 --- a/contracts/traits/src/bridge.rs +++ b/contracts/traits/src/bridge.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Cross-chain bridge types and trait definitions. //! //! This module contains all bridge-related types, status enums, configuration diff --git a/contracts/traits/src/circuit_breaker.rs b/contracts/traits/src/circuit_breaker.rs index f37be7aad..3bf0a8f9b 100644 --- a/contracts/traits/src/circuit_breaker.rs +++ b/contracts/traits/src/circuit_breaker.rs @@ -1,12 +1,6 @@ -use ink::prelude::vec::Vec; -use ink::storage::Mapping; -use ink::primitives::Hash; -use ink::traits::{SpreadLayout, PackedLayout}; -use scale::{Encode, Decode}; -#[cfg(feature = "std")] -use scale_info::TypeInfo; -use ink::storage::traits::{StorageLayout}; +// SPDX-License-Identifier: MIT +/// Identifies an external dependency that the circuit breaker monitors. #[derive(Debug, Clone, Copy, PartialEq, Eq, Encode, Decode, SpreadLayout, PackedLayout, StorageLayout)] #[cfg_attr(feature = "std", derive(TypeInfo))] pub enum ExternalDependency { @@ -16,19 +10,27 @@ pub enum ExternalDependency { IdentityRegistry, } +/// Tracks failure history and open/closed state of the circuit breaker for a dependency. #[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, Default, SpreadLayout, PackedLayout, StorageLayout)] #[cfg_attr(feature = "std", derive(TypeInfo))] pub struct CircuitBreakerState { + /// Consecutive failure count since last success. pub failure_count: u8, + /// Total cumulative failures recorded. pub total_failures: u64, + /// Timestamp of the most recent failure. pub last_failure_at: Option, + /// If set, the breaker is open until this timestamp. pub open_until: Option, } +/// Configuration parameters for circuit breaker behaviour. #[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, SpreadLayout, PackedLayout, StorageLayout)] #[cfg_attr(feature = "std", derive(TypeInfo))] pub struct CircuitBreakerConfig { + /// Number of consecutive failures before the breaker opens. pub failure_threshold: u8, + /// Cooldown period in seconds before the breaker auto-closes. pub cooldown_period_secs: u64, } diff --git a/contracts/traits/src/compliance.rs b/contracts/traits/src/compliance.rs index 52054c318..31e5c4a3f 100644 --- a/contracts/traits/src/compliance.rs +++ b/contracts/traits/src/compliance.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Compliance, regulatory, and structured logging types and traits. //! //! This module contains types for compliance operations, the compliance diff --git a/contracts/traits/src/constants.rs b/contracts/traits/src/constants.rs index b78f1086c..b64fff060 100644 --- a/contracts/traits/src/constants.rs +++ b/contracts/traits/src/constants.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Centralized configuration constants for PropChain contracts. //! //! All magic numbers are extracted here with documentation explaining diff --git a/contracts/traits/src/crypto.rs b/contracts/traits/src/crypto.rs index 678277dd5..101f1e2a5 100644 --- a/contracts/traits/src/crypto.rs +++ b/contracts/traits/src/crypto.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT use ink::prelude::vec::Vec; use ink::primitives::{AccountId, Hash}; diff --git a/contracts/traits/src/dex.rs b/contracts/traits/src/dex.rs index f135a443e..5e063c61b 100644 --- a/contracts/traits/src/dex.rs +++ b/contracts/traits/src/dex.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! DEX and trading type definitions. //! //! This module contains all types related to the decentralized exchange, diff --git a/contracts/traits/src/di.rs b/contracts/traits/src/di.rs index f4c8b97c3..a76ee213e 100644 --- a/contracts/traits/src/di.rs +++ b/contracts/traits/src/di.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Dependency Injection framework for PropChain contracts. //! //! # Overview diff --git a/contracts/traits/src/eip712_permit.rs b/contracts/traits/src/eip712_permit.rs index 5b58b1aa3..f215f01e5 100644 --- a/contracts/traits/src/eip712_permit.rs +++ b/contracts/traits/src/eip712_permit.rs @@ -1,15 +1,27 @@ -use crate::AccountId; +// SPDX-License-Identifier: MIT +/// EIP-712 permit data for gasless approvals. +/// +/// Allows a user to authorise a spender by signing a typed EIP-712 message +/// off-chain, then submitting it on-chain via a relayer — the user never +/// needs to pay gas for the approval transaction. pub struct Eip712Permit { + /// Chain ID to prevent replay attacks across chains. pub chain_id: u64, + /// Nonce scoped to the owner account. pub nonce: u64, - pub owner: AccountId, - pub spender: AccountId, + /// Address of the token owner who signed the permit. + pub owner: crate::AccountId, + /// Address of the spender being authorised. + pub spender: crate::AccountId, + /// Maximum amount the spender may transfer. pub value: u128, + /// Deadline UNIX timestamp after which the permit is invalid. pub deadline: u64, } impl Eip712Permit { + /// Verify that the permit is valid for the given chain and nonce. pub fn verify_permit(&self, current_chain_id: u64, expected_nonce: u64) -> bool { self.chain_id == current_chain_id && self.nonce == expected_nonce } diff --git a/contracts/traits/src/errors.rs b/contracts/traits/src/errors.rs index 7519221f1..f4e99b685 100644 --- a/contracts/traits/src/errors.rs +++ b/contracts/traits/src/errors.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Shared error handling framework for PropChain contracts //! //! This module provides a unified error handling system with: diff --git a/contracts/traits/src/event_bus.rs b/contracts/traits/src/event_bus.rs index e5b2b16c3..d0406408f 100644 --- a/contracts/traits/src/event_bus.rs +++ b/contracts/traits/src/event_bus.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![allow(clippy::module_name_repetitions)] use core::fmt; diff --git a/contracts/traits/src/fee.rs b/contracts/traits/src/fee.rs index 3efbe1e6b..9f72272a5 100644 --- a/contracts/traits/src/fee.rs +++ b/contracts/traits/src/fee.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Dynamic fee and market mechanism types and traits. //! //! This module contains operation types for dynamic fee calculation diff --git a/contracts/traits/src/i18n.rs b/contracts/traits/src/i18n.rs index d6e3f1535..578ec2469 100644 --- a/contracts/traits/src/i18n.rs +++ b/contracts/traits/src/i18n.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Localization infrastructure for PropChain error messages. //! //! All lookups are static match expressions that allocate nothing, making this diff --git a/contracts/traits/src/lib.rs b/contracts/traits/src/lib.rs index 84614a42e..5bbc36e5d 100644 --- a/contracts/traits/src/lib.rs +++ b/contracts/traits/src/lib.rs @@ -1,4 +1,6 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] +#![warn(missing_docs)] // ========================================================================= // Existing modules diff --git a/contracts/traits/src/monitoring.rs b/contracts/traits/src/monitoring.rs index 430bdd705..574ebdde9 100644 --- a/contracts/traits/src/monitoring.rs +++ b/contracts/traits/src/monitoring.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT use core::fmt; use ink::prelude::vec::Vec; use scale::{Decode, Encode}; diff --git a/contracts/traits/src/multicall.rs b/contracts/traits/src/multicall.rs index e519d04b9..85f19cda4 100644 --- a/contracts/traits/src/multicall.rs +++ b/contracts/traits/src/multicall.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Multicall types shared across the workspace. //! //! A `CallRequest` describes a single cross-contract call to be dispatched diff --git a/contracts/traits/src/oracle.rs b/contracts/traits/src/oracle.rs index 4cf8579aa..1b2134cfe 100644 --- a/contracts/traits/src/oracle.rs +++ b/contracts/traits/src/oracle.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Oracle types and trait definitions for real-time property valuation. //! //! This module contains all oracle-related types, error handling, and trait diff --git a/contracts/traits/src/property.rs b/contracts/traits/src/property.rs index 7f3e589ab..261fd60b3 100644 --- a/contracts/traits/src/property.rs +++ b/contracts/traits/src/property.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Property types and trait definitions for the PropChain registry. //! //! This module contains the core property-related types, metadata structures, diff --git a/contracts/traits/src/property_token_metadata.rs b/contracts/traits/src/property_token_metadata.rs index 37d73f56a..6e9c9b4e1 100644 --- a/contracts/traits/src/property_token_metadata.rs +++ b/contracts/traits/src/property_token_metadata.rs @@ -1,5 +1,12 @@ +// SPDX-License-Identifier: MIT + +/// Trait for reading and writing off-chain metadata URIs for property tokens. +/// +/// Metadata URIs typically point to IPFS or Arweave content containing +/// JSON documents with property descriptions, images, and attributes. pub trait PropertyTokenMetadataTrait { + /// Return the metadata URI for a given `token_id`, or `None` if unset. fn get_property_metadata(&self, token_id: u128) -> Option; - fn set_property_metadata(&mut self, token_id: u128, metadata_uri: String) - -> Result<(), String>; + /// Set the metadata URI for a `token_id`. Returns an error on failure. + fn set_property_metadata(&mut self, token_id: u128, metadata_uri: String) -> Result<(), String>; } diff --git a/contracts/traits/src/randomness.rs b/contracts/traits/src/randomness.rs index 86ea5c109..08c93aba1 100644 --- a/contracts/traits/src/randomness.rs +++ b/contracts/traits/src/randomness.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT use ink::prelude::vec::Vec; use ink::primitives::{AccountId, Hash}; diff --git a/contracts/traits/src/reentrancy_guard.rs b/contracts/traits/src/reentrancy_guard.rs index 656944924..322455423 100644 --- a/contracts/traits/src/reentrancy_guard.rs +++ b/contracts/traits/src/reentrancy_guard.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT /// Error type for reentrancy protection #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] #[cfg_attr(feature = "std", derive(scale_info::TypeInfo))] diff --git a/contracts/traits/src/types.rs b/contracts/traits/src/types.rs index a5df861d0..62f2e725d 100644 --- a/contracts/traits/src/types.rs +++ b/contracts/traits/src/types.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Shared types for PropChain contracts. // ========================================================================= diff --git a/contracts/version-registry/src/lib.rs b/contracts/version-registry/src/lib.rs index f4d389b72..93c33a835 100644 --- a/contracts/version-registry/src/lib.rs +++ b/contracts/version-registry/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] use ink::storage::Mapping; diff --git a/scripts/test_accounts.rs b/scripts/test_accounts.rs index 89f400bae..49a9042d5 100644 --- a/scripts/test_accounts.rs +++ b/scripts/test_accounts.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT pub struct TestAccountAddresses { pub Alice: &'static str, pub Bob: &'static str, diff --git a/security-audit/src/main.rs b/security-audit/src/main.rs index c6795391e..0cf359cff 100644 --- a/security-audit/src/main.rs +++ b/security-audit/src/main.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT use anyhow::{Context, Result}; use clap::{Parser, Subcommand}; use colored::*; diff --git a/tests/bridge_load_tests.rs b/tests/bridge_load_tests.rs index 63655ef77..4693ab746 100644 --- a/tests/bridge_load_tests.rs +++ b/tests/bridge_load_tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Bridge Extreme Load Tests //! //! Tests the cross-chain bridge contract under extreme load conditions: diff --git a/tests/bridge_oracle_integration.rs b/tests/bridge_oracle_integration.rs index ac9d4b209..6fcee0604 100644 --- a/tests/bridge_oracle_integration.rs +++ b/tests/bridge_oracle_integration.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #[cfg(test)] mod tests { #[test] diff --git a/tests/cross_contract_integration.rs b/tests/cross_contract_integration.rs index 2bbbc0436..7fdc16526 100644 --- a/tests/cross_contract_integration.rs +++ b/tests/cross_contract_integration.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Cross-Contract Integration Tests //! //! This module contains integration tests that verify interactions diff --git a/tests/integration_bridge_oracle.rs b/tests/integration_bridge_oracle.rs index a14e3f5ba..e11772ed7 100644 --- a/tests/integration_bridge_oracle.rs +++ b/tests/integration_bridge_oracle.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT /// # Integration Tests: Bridge <-> Oracle Cross-Contract Resolution (Issue #490) /// /// These tests verify the end-to-end pipeline: diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 86e7a2e2a..7ca4d992c 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg(feature = "e2e-tests")] use ink_e2e::build_message; diff --git a/tests/lib.rs b/tests/lib.rs index 4dfa6da46..a0c0e626f 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! PropChain Test Suite //! //! This module provides the test library for PropChain contracts, diff --git a/tests/observer_tests.rs b/tests/observer_tests.rs index 102f5c856..0411bddb4 100644 --- a/tests/observer_tests.rs +++ b/tests/observer_tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Observer pattern tests for Issue #185. //! //! Invariants proven: diff --git a/tests/performance_benchmarks.rs b/tests/performance_benchmarks.rs index 951b7d615..1bf9cf34f 100644 --- a/tests/performance_benchmarks.rs +++ b/tests/performance_benchmarks.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Performance Benchmarks and Regression Tests //! //! This module contains performance benchmarks to detect regressions diff --git a/tests/property_registry_tests.rs b/tests/property_registry_tests.rs index fc9916f0f..21a22c999 100644 --- a/tests/property_registry_tests.rs +++ b/tests/property_registry_tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![cfg_attr(not(feature = "std"), no_std)] use ink::env::{ diff --git a/tests/regression/mod.rs b/tests/regression/mod.rs index a95c84d4a..640f64388 100644 --- a/tests/regression/mod.rs +++ b/tests/regression/mod.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT // Regression Test Suite (Issue #487) // // Placeholder. All submodules that previously lived here were removed in diff --git a/tests/security_audit_runner.rs b/tests/security_audit_runner.rs index 40ff491e9..c6eda3d11 100644 --- a/tests/security_audit_runner.rs +++ b/tests/security_audit_runner.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT #![allow(clippy::needless_borrows_for_generic_args, dead_code, unused_imports)] //! Security Audit Runner diff --git a/tests/staking_load_tests.rs b/tests/staking_load_tests.rs index 9dd0bee7a..e3745f600 100644 --- a/tests/staking_load_tests.rs +++ b/tests/staking_load_tests.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Load Testing Framework for the Staking Contract (Issue #482) //! //! Simulates high-concurrency scenarios: bulk stake/unstake, concurrent diff --git a/tests/test_utils.rs b/tests/test_utils.rs index f77276fe2..d42862d7b 100644 --- a/tests/test_utils.rs +++ b/tests/test_utils.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: MIT //! Test Utilities and Fixtures for PropChain Contracts //! //! This module provides shared testing utilities, fixtures, and helpers