Skip to content

feat: Add foreclose capability for configured guardian applications - #469

Open
brunomenezes wants to merge 9 commits into
mainfrom
feat/add-foreclose-capability-for-configured-guardian
Open

feat: Add foreclose capability for configured guardian applications#469
brunomenezes wants to merge 9 commits into
mainfrom
feat/add-foreclose-capability-for-configured-guardian

Conversation

@brunomenezes

@brunomenezes brunomenezes commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary


The Cartesi rollups contracts expose a foreclosure operation meant for guardian-configured applications. This PR brings that capability into the explorer UI with appropriate safeguards (confirmation modal, irreversible-action warnings). Also, refactored the output execution component to correctly reflect all possible epoch states and to provide information about its execution for epochs that have status claim_foreclosed.

PS: For the lookback test the reviewer can use the following deployed instances.

Current: https://dave-demo.cartesi.io/
Preview: https://dave-git-feat-add-foreclose-capability-for-confi-af9017-cartesi.vercel.app/

Tip: use cartesi/cli, as it already has CORS configured at the proxy level for ease of testing.

What changed

Foreclose action

  • Added a Foreclose option to the Send Menu (located in the home page in the application card), allowing a configured guardian to foreclose an application directly from the UI.
  • Introduced a ForecloseForm component that handles the full transaction flow (simulate → write → wait for receipt).
  • Added a ConfirmationModal component to gate irreversible actions behind an explicit user confirmation step, used by the foreclose flow.

Output execution improvements

  • Refactored OutputExecution to surface richer epoch-status feedback: a badge is shown while the claim is pending, and a distinct foreclosed state is shown when execution is no longer possible.
  • Removed the epoch-status polling loop from OutputExecution — epoch state is now driven reactively without a client-side interval.

Content / copy consolidation

  • Extracted UI strings into a structured content object (forecloseMessages, globalMessages, outputMessages) so copy lives in one place and components stay free of hardcoded strings. PS: This is a continuing effort.

CSP fix

  • Removed upgrade-insecure-requests from the Content Security Policy and replaced the broad http: scheme source with explicit loopback origins (http://localhost:*, http://127.0.0.1:*, ws://localhost:*, ws://127.0.0.1:*). This allows users on deployed HTTPS instances to connect a local node without the browser silently rewriting their http://localhost URL to https://localhost and failing the TLS handshake.

Tests

  • Added OutputExecution.test.tsx covering feedback badges, button states, wallet interactions, error display, and success/error callbacks.
  • Extended SendMenu.test.tsx to cover the new foreclose path and confirmation modal integration.
  • Added test cases for the new ForecloseForm.

@brunomenezes brunomenezes linked an issue Jul 9, 2026 that may be closed by this pull request
7 tasks
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dave Ready Ready Preview, Comment Jul 9, 2026 6:16am
rollups-explorer-arbitrum-mainnet Ready Ready Preview, Comment Jul 9, 2026 6:16am
rollups-explorer-arbitrum-sepolia Ready Ready Preview, Comment Jul 9, 2026 6:16am
rollups-explorer-base-mainnet Ready Ready Preview, Comment Jul 9, 2026 6:16am
rollups-explorer-base-sepolia Ready Ready Preview, Comment Jul 9, 2026 6:16am
rollups-explorer-mainnet Ready Ready Preview, Comment Jul 9, 2026 6:16am
rollups-explorer-optimism-mainnet Ready Ready Preview, Comment Jul 9, 2026 6:16am
rollups-explorer-optimism-sepolia Ready Ready Preview, Comment Jul 9, 2026 6:16am
rollups-explorer-sepolia Ready Ready Preview, Comment Jul 9, 2026 6:16am
rollups-explorer-workshop Ready Ready Preview, Comment Jul 9, 2026 6:16am

Request Review

@brunomenezes
brunomenezes requested review from guidanoli and vfusco July 9, 2026 05:55
@brunomenezes brunomenezes moved this from Todo to Waiting review in Rollups SDK Jul 9, 2026
* Remove upgrade-insecure-requests and explicit list loopback origins from CSP.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting review

Development

Successfully merging this pull request may close these issues.

feat: Add 'Foreclose' capability for configured Guardian

1 participant