You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After deploying a contract, users have no record of what was deployed, to which network, when, or how the on-chain transaction resolved. This issue builds a full deployment history system with persistent storage, Stellar Explorer deep-links, transaction status polling, and the ability to re-inspect a past deployment in the contract inspector.
Why This Is Hard
Transaction status is async: at the moment of a successful deployContract() call the transaction may still be PENDING on-chain. The history system must store the initial record immediately, then poll GET /transaction/:hash in the background and update the record when the status resolves to SUCCESS or FAILED.
Storage schema versioning: localStorage is long-lived. The schema for deployment records will evolve. The system must include a schema version field and a migration function so records written today still load correctly after future updates.
Re-inspection link: each history entry must link back to /inspect/[contractId] (see issue Build a read-only contract inspector / viewer #18) — but the inspector needs the network context, so the history record must persist the network alongside the contract ID.
WASM hash tracking: the record should store the sourceHash from the compile response so users can verify which graph version produced a given deployment. This requires passing sourceHash from compileContract() all the way through to deployContract() and up to the history writer.
Data integrity: history records contain sensitive-ish data (wallet address, contract IDs). The size of localStorage is bounded (~5 MB). The system must cap records at a configurable max (default: 50) and evict oldest-first when the cap is reached.
Store the cancel function and call it on component unmount.
Acceptance Criteria
DeploymentRecord schema includes all required fields plus version: 1.
Records are persisted to localStorage and survive page refresh.
The record cap (50 entries) is enforced; oldest entry is evicted when exceeded.
pollTransactionStatus updates a pending record to success or failed after the transaction resolves.
The poller is cancelled on component unmount (no memory leak).
The history drawer shows the correct status icon (spinner / tick / X) per record.
Contract ID and tx hash are copyable with a single click (copy-to-clipboard + "Copied!" tooltip).
Stellar Expert links open https://stellar.expert/explorer/[network]/tx/[hash] on the correct network.
Inspect button navigates to /inspect/[contractId]?network=[network].
Individual records and all records can be deleted with a confirmation step.
Unit tests cover: appendDeploymentRecord cap enforcement, updateDeploymentStatus correctness, pollTransactionStatus resolve and timeout paths.
A Playwright E2E test: mocks a deploy response, asserts the history drawer shows a new pending record, then asserts it updates to success after the mock poller fires.
Summary
After deploying a contract, users have no record of what was deployed, to which network, when, or how the on-chain transaction resolved. This issue builds a full deployment history system with persistent storage, Stellar Explorer deep-links, transaction status polling, and the ability to re-inspect a past deployment in the contract inspector.
Why This Is Hard
deployContract()call the transaction may still bePENDINGon-chain. The history system must store the initial record immediately, then pollGET /transaction/:hashin the background and update the record when the status resolves toSUCCESSorFAILED.localStorageis long-lived. The schema for deployment records will evolve. The system must include a schema version field and a migration function so records written today still load correctly after future updates./inspect/[contractId](see issue Build a read-only contract inspector / viewer #18) — but the inspector needs the network context, so the history record must persist the network alongside the contract ID.sourceHashfrom the compile response so users can verify which graph version produced a given deployment. This requires passingsourceHashfromcompileContract()all the way through todeployContract()and up to the history writer.localStorageis bounded (~5 MB). The system must cap records at a configurable max (default: 50) and evict oldest-first when the cap is reached.Proposed Design
Storage layer (
src/lib/editor/deploymentHistory.ts)Records are stored as a JSON array under
lumens-block:deployments. Cap at 50 entries; evict oldest on overflow.Status poller (
src/lib/stellar/txPoller.ts)SorobanRpc.Server.getTransaction(txHash)every 2 seconds."failed"on timeout.DeploymentHistorycomponent (src/components/editor/DeploymentHistory.tsx)Intl.RelativeTimeFormat/inspect/[contractId]?network=[network]Integration (
DeployButton.tsx)After
deployContract()resolves:appendDeploymentRecord(...)with the result.pollTransactionStatus(txHash, network, (status) => updateDeploymentStatus(id, status)).Acceptance Criteria
DeploymentRecordschema includes all required fields plusversion: 1.localStorageand survive page refresh.pollTransactionStatusupdates apendingrecord tosuccessorfailedafter the transaction resolves.https://stellar.expert/explorer/[network]/tx/[hash]on the correct network./inspect/[contractId]?network=[network].appendDeploymentRecordcap enforcement,updateDeploymentStatuscorrectness,pollTransactionStatusresolve and timeout paths.