caelum0x a8e03d58e9 feat: real public demo deployment for /swap and /vault, close Rust anvil-test gap
Owner reported qie-forge.vercel.app as "genuinely empty" — /swap and /vault
were showing the honest-but-empty "not deployed yet" state because no QIE
Testnet/Mainnet deployer key exists in this environment (confirmed: none
found in ~/products/.env or any other env file).

Real fix, not a toy/local-only proof: deployed the actual compiled
QieForge contracts (factory, router, oracle, vault) to a persistent,
publicly reachable anvil devnet self-hosted on the products box
(packages/contracts/script/DeployDemo.s.sol), seeded with real AMM
liquidity and a real open vault position. Added a "demo" QieNetworkName
to @qie-forge/core (distinct from testnet/mainnet, chain id 31337) and a
DemoBanner shown on /swap and /vault whenever the network is "demo", so
this can never be mistaken for live QIE Testnet/Mainnet activity. Wired
the live Vercel production project to it via env vars — no other frontend
code change needed, confirmed against the real production URL with curl
and gstack browse (real on-chain quote, real vault position, real swap
UI interaction).

Also committed packages/rust/tests/anvil_integration.rs + vault.rs
(previously uncommitted, verified passing), closing the "no Rust
anvil-integration test" gap docs/STATUS.md had tracked — the Rust SDK now
has the same on-chain round-trip proof the Python SDK already had.

Separately confirmed QieForgeVault still has no lender deposit/withdraw
flow despite an earlier commit's message claiming otherwise (re-verified
by reading QieForgeVault.sol directly, not trusting the commit message) —
documented honestly in docs/STATUS.md as a real gap before any funded
Testnet/Mainnet launch.
2026-10-27 23:32:06 +03:00

35 lines
1.4 KiB
TypeScript

import { getRouterAddress, getSwapTokens, getNetworkName } from "@/lib/config";
import { SwapCard } from "@/components/SwapCard";
import { AlertIcon } from "@/components/icons";
import { DemoBanner } from "@/components/DemoBanner";
export default function SwapPage() {
const routerAddress = getRouterAddress();
const tokens = getSwapTokens();
return (
<div className="mx-auto max-w-5xl px-6 py-16">
<h1 className="text-2xl font-semibold text-foreground mb-6">Swap</h1>
{getNetworkName() === "demo" && <DemoBanner />}
{routerAddress && tokens.length >= 2 ? (
<SwapCard tokens={tokens} routerAddress={routerAddress} />
) : (
<div className="card p-6 max-w-md flex items-start gap-3">
<AlertIcon className="w-5 h-5 text-muted mt-0.5" />
<p className="text-sm text-muted">
No router/token configuration set for this network yet (
<code className="text-xs">NEXT_PUBLIC_QIE_FORGE_ROUTER_ADDRESS</code> /{" "}
<code className="text-xs">NEXT_PUBLIC_QIE_FORGE_SWAP_TOKENS</code>). The protocol itself is
built and tested — see{" "}
<a className="underline hover:text-foreground" href="https://github.com/caelum0x/qie-forge">
the repo
</a>{" "}
— it just isn&apos;t deployed on this network yet.
</p>
</div>
)}
</div>
);
}