Skip to content

feat(smart-contracts): verify access-control role revocation behavior - #1409

Merged
mijinummi merged 1 commit into
MDTechLabs:mainfrom
onyekachi66:feat/verify-access-control-role-revocation
Oct 24, 2026
Merged

mijinummi merged 1 commit into
MDTechLabs:mainfrom
onyekachi66:feat/verify-access-control-role-revocation

Conversation

@onyekachi66

Copy link
Copy Markdown
Contributor

Closes #1309

Objective

Improves BridgeWise's cross-chain routing and execution platform by implementing and verifying access-control role revocation behavior, enforcing strict asset and chain boundaries, eliminating duplicate/unsafe execution, and exposing actionable diagnostic evidence for operators without logging sensitive secrets or transaction payloads.

Scope & Key Changes

  • Smart Contract (contracts/BridgeCoreAccessControl.sol):
    • Implements OpenZeppelin UUPS-upgradeable access control with distinct operational roles: DEFAULT_ADMIN_ROLE, OPERATOR_ROLE, EXECUTOR_ROLE, and ROUTER_ROLE.
    • Added verifyRoleRevocation(bytes32 role, address account) restricted to OPERATOR_ROLE to verify and emit RoleRevocationVerified evidence for auditability during incidents or maintenance.
    • Reverts with RoleNotRevoked(bytes32 role, address account) if an unrevoked role is queried.
    • Enforces transfer idempotency via executedTransfers bitmap/mapping, reverting duplicate executions with custom error TransferAlreadyExecuted(bytes32 transferId) and emitting ExecutionAttemptRejected.
    • Validates recipient and non-zero amount boundaries to protect assets.
    • Reserved a 50-slot storage gap (uint256[50] private __gap) to safeguard upgrade compatibility.
  • Contract Tests (contracts/test/BridgeCoreAccessControl.spec.ts):
    • Validates authorized transfer execution and unauthorized caller rejection (AccessControlUnauthorizedAccount).
    • Verifies parameter boundary enforcement (zero address recipient, zero amounts).
    • Asserts duplicate execution rejection and idempotency diagnostics.
    • Validates immediate revocation enforcement upon admin role revocation.
    • Tests verifyRoleRevocation success and revert behavior when roles remain active.
    • Asserts role and state preservation across UUPS proxy upgrades, plus unauthorized upgrade rejection.
  • Documentation (docs/VERIFY_ACCESS_CONTROL_ROLE_REVOCATION.md):
    • Documents public interfaces, role semantics, gas and resource impact, UUPS upgrade considerations, and operator recovery/escalation paths.

Acceptance Criteria Verification

  • Contract-level tests assert relevant invariants and reject unauthorized or malformed calls.
  • Gas/resource impact and upgrade implications are documented.
  • Public interfaces, configuration, and failure semantics are documented.
  • Unit and boundary tests cover success, boundary, invalid-input, and failure cases.
  • Logs and metrics are actionable and exclude secrets, private keys, and sensitive payloads.
  • Pushed to upstream branch feat/verify-access-control-role-revocation using local git configuration.

@mijinummi
mijinummi merged commit d92dc35 into MDTechLabs:main Oct 24, 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

Development

Successfully merging this pull request may close these issues.

Verify access-control role revocation behavior

2 participants