Skip to content

[Contracts] deploy.ts writes NEXT_PUBLIC_* contract-ID names (and never POOL_TOKEN_ADDRESS) into backend/.env, which the backend never reads #1153

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

scripts/deploy.ts:270-280 appends NEXT_PUBLIC_NFT_CONTRACT_ID / NEXT_PUBLIC_POOL_CONTRACT_ID / NEXT_PUBLIC_MANAGER_CONTRACT_ID / NEXT_PUBLIC_GOVERNANCE_CONTRACT_ID to both frontend/.env.local AND backend/.env. But the backend reads LOAN_MANAGER_CONTRACT_ID / LENDING_POOL_CONTRACT_ID / REMITTANCE_NFT_CONTRACT_ID / MULTISIG_GOVERNANCE_CONTRACT_ID / POOL_TOKEN_ADDRESS (backend/src/config/env.ts:14-18, backend/src/app.ts:145-149). After a fresh deploy the backend still has no valid contract IDs and POOL_TOKEN_ADDRESS is never emitted at all, so required-env validation fails or uses stale values.

Acceptance criteria

  • deploy.ts writes the backend-expected variable names (LOAN_MANAGER_CONTRACT_ID, LENDING_POOL_CONTRACT_ID, REMITTANCE_NFT_CONTRACT_ID, MULTISIG_GOVERNANCE_CONTRACT_ID) into backend/.env
  • deploy.ts also emits POOL_TOKEN_ADDRESS (config.token) to backend/.env
  • Frontend keeps receiving the NEXT_PUBLIC_* names in frontend/.env.local
  • A post-deploy note/test confirms backend env.ts required-var validation passes with the generated file

Files to touch

  • scripts/deploy.ts
  • scripts/deploy-config.json

Out of scope

  • Renaming the backend env vars themselves
  • Frontend env var naming

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcontractsIssues related to smart contractscriticalHigh-impact / hard issuedevopsIssues related to CI/CD and infrastructure

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions