feat: propagate custom contractNetworks config in Safe4337Pack.ts #1108
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.
What it solves
Ability to configure Safe contract addresses for a custom network.
How this PR fixes it
Propagate ContractNetworkingsConfig through Safe4337Pack.init.
Description
Hello, I want to deploy a Safe account with Passkey support to my custom network. I have deployed contracts from the safe-smart-account v1.4.1, safe-modules module 4337 v0.3.0-1 and also safe-modules module passkey v0.2.1-1 according to their custom deployment section in README respectively, but I don't see any way of specifying them when I use Safe4337Pack.init.
Call to Safe4337Pack.init, where
passkey
is object from extractPasskeyData:I got an error:
I traced the error through your source code:
provider
,signer
,safeVersion
arguments,contractNetworks
, but thecontractNetworks
are undefined, because onlyprovider
,signer
,safeVersion
arguments are passed,customContracts
are passed to getSafeWebAuthnSignerFactoryContract,safeWebAuthnSignerFactoryAddress
is passed to getSafeWebAuthnSignerFactoryContractInstance (same goes forsafeWebAuthnSignerFactoryAbi
),contractAddress
is then used in SafeWebAuthnSignerFactoryContract_v0_2_1 constructor,customContractAddress
is used in parent SafeWebAuthnSignerFactoryBaseContract constructor (same goes forcustomContractAbi
),customContractAddress
is passed to BaseContract constructor (same goes forcustomContractAbi
),resolvedAddress
is evaluated to undefined becausecustomContractAddress
is undefined and there are no deployments on my network,Versions
@safe-global/protocol-kit
: 5.2.0@safe-global/relay-kit
: 3.4.0