Skip to content

fix: change network before operating with lands#3345

Open
alejandralevy wants to merge 2 commits intomasterfrom
fix/change-network-transfer
Open

fix: change network before operating with lands#3345
alejandralevy wants to merge 2 commits intomasterfrom
fix/change-network-transfer

Conversation

@alejandralevy
Copy link
Contributor

@alejandralevy alejandralevy commented Feb 16, 2026

Redirect to mainnet when operating with lands and states

Transferring an estate (or performing any land write operation) while connected to the Polygon network triggers a transaction that silently does nothing, since the LAND/Estate contracts only exist on Ethereum.

Fix: Added a validateAndSwitchNetwork() helper to src/modules/land/sagas.ts . Before every write operation, it checks if the user's wallet is on the Ethereum network — if not, it prompts them to switch via switchNetworkRequest and waits for SWITCH_NETWORK_SUCCESS before proceeding. Applied to all 7 land write handlers: transfer, setUpdateManager, dissolveEstate, createEstate, editEstate, setOperator, and editLand.

Screen.Recording.2026-02-16.at.10.49.30.mov
Screen.Recording.2026-02-16.at.11.37.17.mov

@vercel
Copy link

vercel bot commented Feb 16, 2026

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

Project Deployment Actions Updated (UTC)
builder Ready Ready Preview, Comment Feb 16, 2026 10:41am

Request Review

@coveralls
Copy link

coveralls commented Feb 16, 2026

Pull Request Test Coverage Report for Build 22059422648

Details

  • 11 of 20 (55.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.009%) to 49.165%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/modules/wallet/sagas.ts 8 10 80.0%
src/modules/land/sagas.ts 1 8 12.5%
Totals Coverage Status
Change from base Build 21947900726: -0.009%
Covered Lines: 6277
Relevant Lines: 11654

💛 - Coveralls

@alejandralevy alejandralevy changed the title feat: change network before operating with lands fix: change network before operating with lands Feb 16, 2026
}

/** Validate that the user's wallet is on Ethereum network for write operations. */
function* validateAndSwitchNetwork() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rename to something like changeToEthereumNetwork ? wdyt? @RocioCM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yess, rename it, sounds better! validateAndSwitchNetwork sounds like you can choose which network to validate, but this function always targets ethereum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants