Skip to content
This repository was archived by the owner on Jul 31, 2026. It is now read-only.

Contract simulation accuracy - #211

Merged
ulissesferreira merged 1 commit into
mikesposito/fix/disable-scan-for-unsupported-txsfrom
cursor/contract-simulation-accuracy-c2d4
Feb 20, 2026
Merged

Contract simulation accuracy#211
ulissesferreira merged 1 commit into
mikesposito/fix/disable-scan-for-unsupported-txsfrom
cursor/contract-simulation-accuracy-c2d4

Conversation

@ulissesferreira

Copy link
Copy Markdown
Contributor

Enhance security scan accuracy by limiting API calls to supported contract types and adjusting confirmation button behavior based on simulation accuracy.

The previous implementation attempted to scan all transaction types, which could lead to misleading or irrelevant security alerts for unsupported contracts. This PR introduces a simulationAccurate flag to distinguish between reliable scans (for supported contracts) and unreliable ones (for unsupported contracts or multiple contract calls). For unreliable simulations, the "Estimated Changes" will be empty, and the user will always be able to proceed, even if the scan itself returns an error. For accurate simulations, the "Confirm" button will be blocked if the scan encounters an error, ensuring users are only blocked when the simulation is considered reliable.


Open in Cursor Open in Web

- Update supported contract types: TransferContract, CreateSmartContract, TriggerSmartContract
- Add 'simulationAccurate' flag to TransactionScanResult
- For unsupported transactions: return empty estimated changes instead of blocking
- Only block confirm button for accurate simulations with errors
- Update tests to reflect new supported contract types

Co-authored-by: ulisses.ferreira <ulisses.ferreira@consensys.net>
@cursor

cursor Bot commented Feb 19, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@ulissesferreira
ulissesferreira marked this pull request as ready for review February 20, 2026 10:42
@ulissesferreira
ulissesferreira requested a review from a team as a code owner February 20, 2026 10:42
@ulissesferreira
ulissesferreira merged commit 6f768c3 into mikesposito/fix/disable-scan-for-unsupported-txs Feb 20, 2026
7 of 8 checks passed
@ulissesferreira
ulissesferreira deleted the cursor/contract-simulation-accuracy-c2d4 branch February 20, 2026 15:03
cursor Bot pushed a commit that referenced this pull request Feb 20, 2026
Enhance security scan accuracy by limiting API calls to supported
contract types and adjusting confirmation button behavior based on
simulation accuracy.

The previous implementation attempted to scan all transaction types,
which could lead to misleading or irrelevant security alerts for
unsupported contracts. This PR introduces a `simulationAccurate` flag to
distinguish between reliable scans (for supported contracts) and
unreliable ones (for unsupported contracts or multiple contract calls).
For unreliable simulations, the "Estimated Changes" will be empty, and
the user will always be able to proceed, even if the scan itself returns
an error. For accurate simulations, the "Confirm" button will be blocked
if the scan encounters an error, ensuring users are only blocked when
the simulation is considered reliable.

---
<p><a
href="https://cursor.com/background-agent?bcId=bc-3af945ef-4817-4045-9ea9-6281fed76d50"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/agents?id=bc-3af945ef-4817-4045-9ea9-6281fed76d50"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a></p>

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
ulissesferreira added a commit that referenced this pull request Feb 20, 2026
Enhance security scan accuracy by limiting API calls to supported
contract types and adjusting confirmation button behavior based on
simulation accuracy.

The previous implementation attempted to scan all transaction types,
which could lead to misleading or irrelevant security alerts for
unsupported contracts. This PR introduces a `simulationAccurate` flag to
distinguish between reliable scans (for supported contracts) and
unreliable ones (for unsupported contracts or multiple contract calls).
For unreliable simulations, the "Estimated Changes" will be empty, and
the user will always be able to proceed, even if the scan itself returns
an error. For accurate simulations, the "Confirm" button will be blocked
if the scan encounters an error, ensuring users are only blocked when
the simulation is considered reliable.

---
<p><a
href="https://cursor.com/background-agent?bcId=bc-3af945ef-4817-4045-9ea9-6281fed76d50"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/agents?id=bc-3af945ef-4817-4045-9ea9-6281fed76d50"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a></p>

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
ulissesferreira added a commit that referenced this pull request Mar 12, 2026
Enhance security scan accuracy by limiting API calls to supported
contract types and adjusting confirmation button behavior based on
simulation accuracy.

The previous implementation attempted to scan all transaction types,
which could lead to misleading or irrelevant security alerts for
unsupported contracts. This PR introduces a `simulationAccurate` flag to
distinguish between reliable scans (for supported contracts) and
unreliable ones (for unsupported contracts or multiple contract calls).
For unreliable simulations, the "Estimated Changes" will be empty, and
the user will always be able to proceed, even if the scan itself returns
an error. For accurate simulations, the "Confirm" button will be blocked
if the scan encounters an error, ensuring users are only blocked when
the simulation is considered reliable.

---
<p><a
href="https://cursor.com/background-agent?bcId=bc-3af945ef-4817-4045-9ea9-6281fed76d50"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/agents?id=bc-3af945ef-4817-4045-9ea9-6281fed76d50"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a></p>

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants