Skip to content

Enhance contracts with driver authorization and platform fee management#121

Merged
Tybravo merged 1 commit into
SwiftChainn:mainfrom
promisszn:main
Jun 1, 2026
Merged

Enhance contracts with driver authorization and platform fee management#121
Tybravo merged 1 commit into
SwiftChainn:mainfrom
promisszn:main

Conversation

@promisszn
Copy link
Copy Markdown
Contributor

Summary

  • Fleet owner authorization — added explicit caller parameter to add_driver_to_fleet with a code-level ownership check (matching the pattern already used by update_fleet_treasury), and added tests that confirm non-owners are rejected with Unauthorized
  • Evidence hashadd_evidence_hash was already implemented; fixed a pre-existing test failure in resolve_dispute_refund_sender (mock delivery missing driver) and made the reputation penalty conditional so the dispute contract degrades gracefully when no identity contract is configured
  • Slippage protectionexecute_settlement_swap already enforced min_amount_out; added missing testutils dev-dependency that was causing compilation failure, introduced a mock router in tests, and added full slippage coverage for both same-asset and cross-asset paths
  • Platform FX fee — added PlatformFeeBps storage key, set_platform_fee_bps (admin-only, capped at 10%) and get_platform_fee_bps functions; cross-asset swaps now route output through the contract before forwarding net amount to recipient; same-asset transfers deduct fee before sending; fee is collected by the admin address

Test results

130 tests across the workspace — 0 failures.

Closes #74
Closes #78
Closes #92
Closes #93


… authorization and reputation penalty logic; add platform fee management to settlement contract
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@promisszn Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Tybravo Tybravo merged commit 7d1da9d into SwiftChainn:main Jun 1, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants