Skip to content

Implement real admin contract transactions for frontend - #1294

Open
willowgray071-cpu wants to merge 1 commit into
StellarCheckMate:mainfrom
willowgray071-cpu:main
Open

Implement real admin contract transactions for frontend#1294
willowgray071-cpu wants to merge 1 commit into
StellarCheckMate:mainfrom
willowgray071-cpu:main

Conversation

@willowgray071-cpu

Copy link
Copy Markdown
Contributor

Summary

Replaces stub implementations in useAdminContract with real transaction building, signing, and submission. The frontend Admin Panel now sends actual Soroban contract invocations instead of fake setTimeout calls.

Changes

  • buildInvokeTx: Creates proper invoke-contract transactions using stellar-sdk's TransactionBuilder and Contract API
  • SCVal Decoding: Implements XDR decoding for Address and Boolean types returned by get_admin, get_oracle, is_paused view functions
  • invoke(): Now properly signs transactions via connected wallet (Freighter/Albedo) and submits to the network
  • Authorization: Fixed isAdmin comparison to work with decoded Address strings; now properly distinguishes admin vs non-admin wallets
  • Tests: Comprehensive test coverage for transaction building, wallet signing, RPC errors, and authorization checks

Testing

  • All 128 frontend tests pass
  • ESLint passes
  • Build succeeds
  • Tested pause(), unpause(), addToken(), removeToken(), rotateOracle(), and transferAdmin() actions

Closes #1277

Replace stub implementations in useAdminContract with real transaction building, signing, and submission:
- Implement buildInvokeTx to create proper Soroban contract invoke transactions using stellar-sdk
- Implement SCVal XDR decoding for address and boolean types (get_admin, get_oracle, is_paused)
- Wire invoke() to sign transactions via Freighter/Albedo wallet and submit via RPC
- Fix isAdmin comparison to work with properly decoded Address strings
- Add comprehensive tests covering real transaction building, signing errors, RPC failures, and authorization checks

Closes StellarCheckMate#1277
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.

Frontend Admin Panel Sends No Real Transactions — Every Action Is a Fake setTimeout

1 participant