fix: Sign & Send refuses a transfer reviewed on another network (closes #524) #542

Open
clawbot wants to merge 1 commits from issue-524-confirm-network-switch into next
Collaborator

Fixes #524.

ConfirmTx now records the chain id of the network it is drawn for, on the pending transaction, in show(). "Sign & Send" compares it with the active network and, when they differ, sends nothing and says on the screen's errors line: "The active network changed after this transaction was reviewed, so it was not sent. Please go back and review it again." The send also carries that chain id, so ethers refuses to populate it for a provider on any other network.

What the diff does not show:

  • The pending transaction's chain id used to be set at the click, and the wait, success and error screens label the amount by it. It is now set when the screen is drawn, which is the same value whenever a send goes through.
  • Reopening the popup onto a saved ConfirmTx draws the screen again for whichever network is active then, so that path is labelled for, and sends on, the new network: the second outcome the issue's definition of done allows.
  • The refusal comes after the defective-wallet check and before the password is read, so no password is spent on it.

Disclosure: if the network were switched while the password is being decrypted, the refusal is ethers' own "transaction chainId mismatch" on the error screen, not a full sentence. Nothing is signed in that case either.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/AutistMask/issues/524. ConfirmTx now records the chain id of the network it is drawn for, on the pending transaction, in `show()`. "Sign & Send" compares it with the active network and, when they differ, sends nothing and says on the screen's errors line: "The active network changed after this transaction was reviewed, so it was not sent. Please go back and review it again." The send also carries that chain id, so ethers refuses to populate it for a provider on any other network. What the diff does not show: - The pending transaction's chain id used to be set at the click, and the wait, success and error screens label the amount by it. It is now set when the screen is drawn, which is the same value whenever a send goes through. - Reopening the popup onto a saved ConfirmTx draws the screen again for whichever network is active then, so that path is labelled for, and sends on, the new network: the second outcome the issue's definition of done allows. - The refusal comes after the defective-wallet check and before the password is read, so no password is spent on it. Disclosure: if the network were switched while the password is being decrypted, the refusal is ethers' own "transaction chainId mismatch" on the error screen, not a full sentence. Nothing is signed in that case either. Model: opus-5-5
clawbot added the needs-review label 2026-10-14 06:46:52 +02:00
clawbot self-assigned this 2026-10-14 06:46:52 +02:00
clawbot added 1 commit 2026-10-14 06:46:52 +02:00
fix: Sign & Send refuses a transfer reviewed on another network (closes #524)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
06657e6136
Settings is reachable from the confirmation screen, and Back from it only
unhides the screen as it was drawn. Sign & Send took the network at the
click, so a transfer reviewed on Sepolia went out on mainnet after a switch
in between. show() now records the chain id of the network it draws for.
Sign & Send refuses with a message on the screen when the active network
differs, and the send carries that chain id, so ethers will not populate it
for a provider on any other network.

Model: opus-5-5
Some checks are pending
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
You are not authorized to merge this pull request.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-524-confirm-network-switch:issue-524-confirm-network-switch
git checkout issue-524-confirm-network-switch
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#542