Skip to content

Commit

Permalink
fix: use the deployment by chainId
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacook committed Jul 6, 2023
1 parent fdaf1a2 commit e3feea0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/components/settings/FallbackHandler/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export const FallbackHandler = (): ReactElement | null => {
return null
}

const isOfficial = !!safe.fallbackHandler && safe.fallbackHandler.value === fallbackHandlerDeployment?.defaultAddress
const isOfficial =
!!safe.fallbackHandler && safe.fallbackHandler.value === fallbackHandlerDeployment?.networkAddresses[safe.chainId]

const tooltip = !safe.fallbackHandler ? (
<>
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/coreSDK/safeCoreSDK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export const initSafeSDK = async ({
const safeL1Deployment = getSafeSingletonDeployment({ network: chainId, version: safeVersion })
const safeL2Deployment = getSafeL2SingletonDeployment({ network: chainId, version: safeVersion })

isL1SafeMasterCopy = masterCopy === safeL1Deployment?.defaultAddress
const isL2SafeMasterCopy = masterCopy === safeL2Deployment?.defaultAddress
isL1SafeMasterCopy = masterCopy === safeL1Deployment?.networkAddresses[chainId]
const isL2SafeMasterCopy = masterCopy === safeL2Deployment?.networkAddresses[chainId]

// Unknown deployment, which we do not want to support
if (!isL1SafeMasterCopy && !isL2SafeMasterCopy) {
Expand Down
2 changes: 1 addition & 1 deletion src/services/security/modules/DelegateCallModule/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class DelegateCallModule implements SecurityModule<DelegateCallModuleRequ
// We need not check for nested delegate calls as we only use MultiSendCallOnly in the UI
const multiSendDeployment = getMultiSendCallOnlyDeployment({ network: chainId, version: safeVersion ?? undefined })

return multiSendDeployment?.defaultAddress !== safeTransaction.data.to
return multiSendDeployment?.networkAddresses[chainId] !== safeTransaction.data.to
}

async scanTransaction(request: DelegateCallModuleRequest): Promise<SecurityResponse<DelegateCallModuleResponse>> {
Expand Down

0 comments on commit e3feea0

Please sign in to comment.