Skip to content

Commit b664763

Browse files
JOYclaude
andcommitted
fix: provide explicit contractNetworks for custom chains
Protocol-kit resolves contract addresses from safe-deployments package, which fails for chains not in the registry. Provide canonical contract addresses directly via contractNetworks config when safe-deployments lookup returns nothing. This fixes "SDK is not initialized yet" error on DOS Chain. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4721d60 commit b664763

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

apps/web/src/hooks/coreSDK/safeCoreSDK.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,26 @@ export const initSafeSDK = async ({
100100
contractNetworks,
101101
})
102102

103+
// For self-hosted chains not in safe-deployments, provide contract addresses explicitly
104+
// This bypasses the safe-deployments lookup that fails for custom chains
105+
if (!contractNetworks?.[chainId]) {
106+
contractNetworks = {
107+
...contractNetworks,
108+
[chainId]: {
109+
...contractNetworks?.[chainId],
110+
multiSendAddress: '0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526',
111+
multiSendCallOnlyAddress: '0x9641d764fc13c8B624c04430C7356C1C7C8102e2',
112+
safeSingletonAddress: '0x41675C099F32341bf84BFc5382aF534df5C7461a',
113+
safeSingletonL2Address: '0x29fcB43b46531BcA003ddC8FCB67FFE91900C762',
114+
safeProxyFactoryAddress: '0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67',
115+
fallbackHandlerAddress: '0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99',
116+
signMessageLibAddress: '0xd53cd0aB83D845Ac265BE939c57F53AD838012c9',
117+
createCallAddress: '0x9b35Af71d77eaf8d7e40252370304687390A1A52',
118+
simulateTxAccessorAddress: '0x3d4BA2E0884aa488718476ca2FB8Efc291A46199',
119+
},
120+
}
121+
}
122+
103123
if (undeployedSafe) {
104124
if (isPredictedSafeProps(undeployedSafe.props) || isReplayedSafeProps(undeployedSafe.props)) {
105125
return Safe.init({

0 commit comments

Comments
 (0)