add support for facet chain and creating facet forced inclusion transactions #3146
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description and Related Issue(s)
Adds support for Facet L2 networks in the Blockscout contract interaction UI by integrating the Facet SDK, while preserving existing behavior for all non-Facet chains. When the current chain is a Facet chain, contract calls and value transfers are routed through the Facet SDK helper functions; otherwise, the existing
viem/wagmiflow is used unchanged.No specific GitHub issue to link; this is an integration enhancement.
Proposed Changes
Add Facet SDK integration to contract method calls
useCallMethodWalletClientto detect when the configured chain isfacetMainnetorfacetSepolia.config.features.rollup.parentChainand use that as thetargetChainId.walletClientare ontargetChainId(switching chains as needed).receive/fallback(native value send) calls, usesendFacetTransactionon Facet chains and keepwalletClient.sendTransactionfor non-Facet chains.writeFacetContracton Facet chains and keepwalletClient.writeContractfor non-Facet chains, reusing the existing ABI/method-name workaround.txRequest,writeRequest) between Facet and non-Facet code paths to avoid duplication.Dependencies
@0xfacet/sdkdependency (used for Facet chain detection and Facet transaction helpers).ENV variables
config.features.rollupand itsparentChain) to locate the correct L1 chain for Facet.Breaking or Incompatible Changes
Additional Information
useCallMethodWalletClient) and is intended to be a minimal, backwards-compatible integration layer on top of the existingviem/wagmisetup.Checklist for PR author