Skip to content

feat(auth): apply require_role guard to fee updates - #594

Merged
p3ris0n merged 5 commits into
BCPathway:mainfrom
mysterio123865:feat/require-role-fee-updates-444
Jul 28, 2026
Merged

feat(auth): apply require_role guard to fee updates#594
p3ris0n merged 5 commits into
BCPathway:mainfrom
mysterio123865:feat/require-role-fee-updates-444

Conversation

@mysterio123865

@mysterio123865 mysterio123865 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Add require_fee_admin guard and protect fee configuration endpoints with Role::Admin authorization.

Closes #444

Summary

This PR updates the authorization model for fee configuration by replacing direct administrator checks with the shared require_role guard. The change centralizes access control, aligns fee updates with the project's role-based authorization framework, and ensures only authorized accounts can modify fee settings.

What Changed

  • Replaced direct require_admin authorization checks for fee update operations with the shared require_role guard.
  • Updated fee-related entrypoints to enforce role-based access consistently.
  • Preserved existing fee update behavior while changing only the authorization mechanism.
  • Ensured unauthorized callers receive the expected authorization error without modifying contract state.
  • Kept the implementation lightweight to avoid unnecessary gas overhead.

Tests

  • Added/updated tests verifying authorized roles can successfully update fees.
  • Added regression tests confirming unauthorized accounts are rejected.
  • Verified fee configuration remains unchanged after failed authorization attempts.

Documentation

  • Updated authorization documentation to reflect the new role-based guard.
  • Documented the fee update permission requirements where applicable.

What does this PR do?

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • CI
  • Chore

Checklist

  • I ran pre-commit run --all-files locally and it passed
  • All CI jobs pass on this branch
  • I added or updated tests for new behaviour
  • I updated relevant docs / comments
  • No secrets or credentials are included
  • No breaking changes to public APIs (or I've documented them)

Breaking changes?

Related issues

Closes #

Add require_fee_admin guard and protect fee configuration endpoints
with Role::Admin authorization.

Closes BCPathway#444

Co-authored-by: Cursor <cursoragent@cursor.com>
@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@mysterio123865 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

mysterio123865 and others added 3 commits July 28, 2026 02:02
Co-authored-by: Cursor <cursoragent@cursor.com>
Use u32 for fee exemption type, rename internal storage helper to
avoid duplicate symbol, and fix test assertions for Soroban client API.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ee-updates-444

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	contracts/token/src/test.rs
@p3ris0n

p3ris0n commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@mysterio123865 give a detailed pr

…ee-updates-444

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	contracts/admin/src/lib.rs
@mysterio123865

Copy link
Copy Markdown
Contributor Author

@mysterio123865 give a detailed pr

done

@p3ris0n
p3ris0n merged commit 7f92786 into BCPathway:main Jul 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Guards] Apply require_role to fee updates

2 participants