-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: abstract constants + rename variables
- Loading branch information
Showing
5 changed files
with
61 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,11 @@ | ||
const DangerousBridges = [ | ||
'bridge.arbitrum.io', | ||
'bridge.base.org', | ||
'cbridge.celer.network', | ||
'www.orbiter.finance', | ||
'zksync-era.l2scan.co', | ||
'app.optimism.io', | ||
'www.portalbridge.com', | ||
'wallet.polygon.technology', | ||
'app.rhino.fi', | ||
] | ||
import { StrictAddressBridges, DefaultAddressBridges } from '../constants' | ||
|
||
const RiskyBridges = [ | ||
'across.to', | ||
'app.allbridge.io', | ||
'core.allbridge.io', | ||
'bungee.exchange', | ||
'www.carrier.so', | ||
'app.chainport.io', | ||
'bridge.gnosischain.com', | ||
'app.hop.exchange', | ||
'app.interport.fi', | ||
'jumper.exchange', | ||
'www.layerswap.io', | ||
'meson.fi', | ||
'satellite.money', | ||
'stargate.finance', | ||
'app.squidrouter.com', | ||
'app.symbiosis.finance', | ||
'www.synapseprotocol.com', | ||
'app.thevoyager.io', | ||
'portal.txsync.io', | ||
'bridge.wanchain.org', | ||
'app.xy.finance', | ||
] | ||
|
||
export const isDangerousBridge = (origin: string) => { | ||
return DangerousBridges.some((bridge) => origin.includes(bridge)) | ||
// Bridge enforces the same address on destination chain | ||
export const isStrictAddressBridge = (origin: string) => { | ||
return StrictAddressBridges.some((bridge) => origin.includes(bridge)) | ||
} | ||
|
||
export const isRiskyBridge = (origin: string) => { | ||
return RiskyBridges.some((bridge) => origin.includes(bridge)) | ||
// Bridge defaults to same address on destination chain but allows changing it | ||
export const isDefaultAddressBridge = (origin: string) => { | ||
return DefaultAddressBridges.some((bridge) => origin.includes(bridge)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Bridges enforcing same address on destination chains | ||
export const StrictAddressBridges = [ | ||
'bridge.arbitrum.io', | ||
'bridge.base.org', | ||
'cbridge.celer.network', | ||
'www.orbiter.finance', | ||
'zksync-era.l2scan.co', | ||
'app.optimism.io', | ||
'www.portalbridge.com', | ||
'wallet.polygon.technology', | ||
'app.rhino.fi', | ||
] | ||
|
||
// Bridges that initially select the same address on the destination chain but allow changing it | ||
export const DefaultAddressBridges = [ | ||
'across.to', | ||
'app.allbridge.io', | ||
'core.allbridge.io', | ||
'bungee.exchange', | ||
'www.carrier.so', | ||
'app.chainport.io', | ||
'bridge.gnosischain.com', | ||
'app.hop.exchange', | ||
'app.interport.fi', | ||
'jumper.exchange', | ||
'www.layerswap.io', | ||
'meson.fi', | ||
'satellite.money', | ||
'stargate.finance', | ||
'app.squidrouter.com', | ||
'app.symbiosis.finance', | ||
'www.synapseprotocol.com', | ||
'app.thevoyager.io', | ||
'portal.txsync.io', | ||
'bridge.wanchain.org', | ||
'app.xy.finance', | ||
] |