Skip to content

Contract IDs in apps/web/.env.testnet disagree with packages/contracts/contracts.json (14 of 18 differ) #860

Closed

Description

@IbrahimIjai

AGENTS.md §5 says: "Contract IDs are committed, not secrets. They live in packages/contracts/contracts.json. Do not reintroduce environment variables for them."

But the web app still reads every contract ID from env vars (apps/web/src/app/config/env.ts → requireEnv(import.meta.env.VITE_CONTRACT_*)), sourced from apps/web/.env.testnet. Comparing the two:

  • 18 contract/token IDs in .env.testnet
  • 14 of them don't appear in contracts.json, including VITE_CONTRACT_DATA_STORE, MARKET_FACTORY, DEPOSIT_HANDLER, WITHDRAWAL_HANDLER, ORDER_VAULT, REFERRAL_STORAGE, ORACLE and ORDER_HANDLER

So the generated bindings (packages/contracts) and the running app may point at different deployments. That risks wrong reads and transactions sent to stale contracts.

Acceptance criteria

  • Find which set is the current testnet deployment and record it here
  • Make contracts.json the single source: web reads IDs from @workspace/contracts and the VITE_CONTRACT_* vars are removed (keep only network/RPC config in env)
  • Test that every contract the web app uses resolves from contracts.json for each network
  • Update .env.example, .env.testnet, .env.mainnet and the README

Found while running the web app locally (bun dev, headless Chromium and axe-core sweep of every route at desktop and iPhone-13 sizes) on 2026-10-15, main @ 4c5cf1d. Contributors: follow AGENTS.md / CONTRIBUTING.md. The full commit gate must pass, with no eslint-disable, .skip, or lowered thresholds.

Activity

  1. Ranjeet2063 commented on Oct 15, 2026

    @Ranjeet2063

    Hello maintainers,

    I reviewed the requirements for "Contract IDs in apps/web/.env.testnet disagree with packages/contracts/contracts.json (14 of 18 differ)" and would like to work on this implementation.

    Technical Implementation Outline:

    1. Review contract state storage keys, TTL policies, and auth guards (Address::require_auth) in packages/contracts/contracts.js.
    2. Implement safe state transition logic with checked arithmetic preventing under/overflow.
    3. Write comprehensive Soroban unit tests covering standard flows, unauthorized callers, and reverts.
    4. Verify contract execution footprint passes Soroban CPU/memory budget limits.

    Please assign this issue to me. I will submit a clean, well-tested, and production-ready PR promptly!

  2. Dekah101 commented on Oct 16, 2026

    @Dekah101

    @Dekah101 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Show me love bro

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Dekah101 to this issue.

  3. Eli-greens commented on Oct 16, 2026

    @Eli-greens

    @Renowned9 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi Maintainer, I would love to work on this issue. I have read the task description and would be able to work on them

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Renowned9 to this issue.

  4. Ay-obami commented on Oct 18, 2026

    @Ay-obami
    Contributor

    @Ay-obami has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I'll like to work on this issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Ay-obami to this issue.

  5. Ghoost-404 commented on Oct 18, 2026

    @Ghoost-404

    @Ghoost-404 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    hello, i'd like to work on this issue please

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Ghoost-404 to this issue.

  6. Jaydbrown commented on Oct 18, 2026

    @Jaydbrown
    Contributor

    @Jaydbrown has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    hello maintainer assign these isssues to me

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Jaydbrown to this issue.

  7. drips-wave commented on Oct 18, 2026

    @drips-wave

    Congratulations, @Jaydbrown! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

    🧑‍💻 @Jaydbrown: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  8. Jaydbrown commented on Oct 18, 2026

    @Jaydbrown
    Contributor

    Resolved in #996:

    • Made packages/contracts/contracts.json the single source of truth for contract addresses across networks (testnet and mainnet).
    • Exported typed contract deployment mappings and getContractAddresses from @workspace/contracts.
    • Updated apps/web/src/app/config/contracts.ts to source directly from @workspace/contracts using ENV.NETWORK.
    • Removed VITE_CONTRACT_* from apps/web/src/app/config/env.ts, .env.testnet, .env.example, and .env.mainnet.
    • Added contract resolution tests in apps/web/src/app/config/contracts.test.ts and packages/contracts/src/deployments.test.ts verifying all contracts resolve for testnet and mainnet.
  9. grantfox-oss commented on Oct 19, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox!

    @Jaydbrown's PR #996 was approved and merged by @IbrahimIjai.

    🏆 @Jaydbrown: You earned 35 FoxPoints for this contribution! Your current tier: Builder (1,022 total points). Track your full progress on GrantFox.

    👏 Great work, @Jaydbrown! Keep contributing to SO4-Markets.

  10. drips-wave commented on Oct 19, 2026

    @drips-wave

    This issue has been completed by @Jaydbrown as part of the Stellar Wave Program's 10th Wave 🥳

    😎 @Jaydbrown: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions