Skip to content

Frontend: campaign-form needs real contract submission flow #13

@alexanderkoh

Description

@alexanderkoh

Description

The campaign creation form (components/campaign/campaign-form.tsx) has the pool selector wired to the real TinyAMM pool and rates fetched from on-chain, but the parent page (app/campaign/new/page.tsx) submit handler needs verification.

What's done

  • Pool dropdown shows real TinyAMM pool from CONTRACTS.tinyamm
  • FLASH rate calculated from on-chain reserves via readContract
  • buildCreateCampaign() helper exists in lib/soroban.ts

What needs testing/fixing

  • Verify the submit handler in app/campaign/new/page.tsx correctly maps form state to buildCreateCampaign params
  • Duration is in hours in the form but needs to be converted to ledgers (1 hour ≈ 720 ledgers)
  • targetTVL is in USD in the form but contract expects LP tokens (i128)
  • contributionAmount needs to be converted to stroops (multiply by 1e7)
  • Test full flow: fill form → submit → wallet signs → campaign appears in explore
  • Error handling: show user-friendly errors for insufficient USDC, slippage, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    frontendFrontend/UI workmainnetRequired for mainnet launch

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions