Summary
The Sponsor Portal (/sponsor) is currently a placeholder. This issue is to implement the full sponsor/donor workflow: connect wallet → deposit USDC to the treasury → receive GOV governance tokens → vote on scholarship proposals.
User flow
Sponsor connects Freighter wallet
→ Sees their USDC balance and current GOV holdings
→ Enters deposit amount
→ Approves USDC transfer (Freighter signs)
→ Calls scholarship_treasury.deposit(donor, amount, usdc_token_address)
→ Receives GOV tokens at 100:1 rate (100 USDC = 1 GOV, each GOV = 10,000 atomic units)
→ Can now vote on active scholarship proposals
→ Can delegate voting power to another address
What to build
Frontend (src/pages/SponsorPortal.tsx)
- Wallet connection gate (redirect if not connected)
- USDC balance display (query Stellar horizon or SAC balance)
- GOV token balance and voting power display (use
GET /api/governance/voting-power/:address)
- Deposit form: amount input → calls
POST /api/treasury/deposit
- Delegation panel: delegate GOV voting power (calls governance token
delegate())
- List of active proposals the sponsor can vote on (links to
/dao/proposals)
- Transaction history: past deposits and votes
Backend (POST /api/treasury/deposit)
New endpoint:
POST /api/treasury/deposit
Body: { donor_address: string, amount: number, tx_hash: string }
- Verifies the Stellar transaction (horizon lookup by
tx_hash)
- Confirms
deposit() was called on the treasury contract with correct args
- Records contribution in a
treasury_deposits table
- Returns updated GOV balance
Database migration
CREATE TABLE IF NOT EXISTS treasury_deposits (
id SERIAL PRIMARY KEY,
donor_address TEXT NOT NULL,
amount_usdc NUMERIC NOT NULL,
gov_issued NUMERIC NOT NULL,
tx_hash TEXT NOT NULL UNIQUE,
created_at TIMESTAMPTZ DEFAULT NOW()
);
Contract interface
// contracts/scholarship_treasury/src/lib.rs
pub fn deposit(env: Env, donor: Address, amount: i128, asset: Address)
// Mints GOV tokens at 100:1 rate to the donor
Relevant existing code
| File |
Notes |
GET /api/treasury/stats |
Already queries on-chain events for total deposited |
GET /api/governance/voting-power/:address |
Already returns GOV balance + voting power |
GET /api/governance/delegation/:address |
Already returns current delegate |
contracts/scholarship_treasury/src/lib.rs |
deposit() is fully implemented |
Acceptance criteria
Summary
The Sponsor Portal (
/sponsor) is currently a placeholder. This issue is to implement the full sponsor/donor workflow: connect wallet → deposit USDC to the treasury → receive GOV governance tokens → vote on scholarship proposals.User flow
What to build
Frontend (
src/pages/SponsorPortal.tsx)GET /api/governance/voting-power/:address)POST /api/treasury/depositdelegate())/dao/proposals)Backend (
POST /api/treasury/deposit)New endpoint:
tx_hash)deposit()was called on the treasury contract with correct argstreasury_depositstableDatabase migration
Contract interface
Relevant existing code
GET /api/treasury/statsGET /api/governance/voting-power/:addressGET /api/governance/delegation/:addresscontracts/scholarship_treasury/src/lib.rsdeposit()is fully implementedAcceptance criteria