Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(synapse-constants): chain and token updates #3320

Merged
merged 18 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 129 additions & 4 deletions packages/synapse-constants/src/constants/bridgeMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ export const BRIDGE_MAP = {
destination: ['JEWEL'],
swappable: [],
},
'0x163f8C2467924be0ae7B5347228CABF260318753': {
decimals: 18,
symbol: 'WLD',
origin: ['RFQ.WLD'],
destination: ['RFQ.WLD'],
swappable: [],
},
'0x1B84765dE8B7566e4cEAF4D0fD3c5aF52D3DdE4F': {
decimals: 18,
symbol: 'nUSD',
Expand Down Expand Up @@ -455,6 +462,13 @@ export const BRIDGE_MAP = {
destination: ['L2DAO'],
swappable: [],
},
'0xdC6fF44d5d932Cbd77B52E5612Ba0529DC6226F1': {
decimals: 18,
symbol: 'WLD',
origin: ['RFQ.WLD'],
destination: ['RFQ.WLD'],
swappable: [],
},
},
'25': {
'0x396c9c192dd323995346632581BEF92a31AC623b': {
Expand Down Expand Up @@ -591,7 +605,7 @@ export const BRIDGE_MAP = {
},
'0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270': {
decimals: 18,
symbol: 'WMATIC',
symbol: 'WPOL',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Residual 'WMATIC' instances found in the codebase.

The symbol 'WMATIC' is still present in multiple files and needs to be updated to 'WPOL' to ensure consistency across the project.

Affected files include, but are not limited to:

  • packages/widget/src/types/index.d.ts
  • packages/synapse-interface/constants/tokens/bridgeable.ts
  • packages/synapse-interface/__tests__/getToTokens.test.ts
  • packages/synapse-interface/__tests__/__fixtures__/mockRoutes.ts
  • packages/widget/src/index.tsx
  • packages/synapse-constants/src/constants/tokens/bridgeable.ts
  • packages/rest-api/src/constants/bridgeable.ts

Please update all instances of 'WMATIC' to 'WPOL' to complete the symbol change.

🔗 Analysis chain

Verify the impact of changing WMATIC to WPOL.

The symbol change from 'WMATIC' to 'WPOL' has been implemented correctly. However, this change could have wider implications across the project.

Please ensure this change is consistent across the entire codebase. Run the following script to check for any remaining instances of 'WMATIC':

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for remaining instances of 'WMATIC' in the codebase

# Search for 'WMATIC' in all files
rg -i 'WMATIC'

Length of output: 9950


Script:

#!/bin/bash
# Description: Check for remaining instances of 'WMATIC' in the codebase

# Search for 'WMATIC' in all files
rg -i '\bWMATIC\b'

Length of output: 1263

origin: ['MATIC'],
destination: ['MATIC'],
swappable: [],
Expand Down Expand Up @@ -670,7 +684,7 @@ export const BRIDGE_MAP = {
},
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': {
decimals: 18,
symbol: 'MATIC',
symbol: 'POL',
origin: ['MATIC'],
destination: ['MATIC'],
swappable: [],
Expand Down Expand Up @@ -872,6 +886,29 @@ export const BRIDGE_MAP = {
],
},
},
'480': {
'0x2cFc85d8E48F8EAB294be644d9E25C3030863003': {
decimals: 18,
symbol: 'WLD',
origin: ['RFQ.WLD'],
destination: ['RFQ.WLD'],
swappable: [],
},
'0x79A02482A880bCE3F13e09Da970dC34db4CD24d1': {
decimals: 6,
symbol: 'USDC.e',
origin: ['RFQ.USDC'],
destination: ['RFQ.USDC'],
swappable: [],
},
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': {
decimals: 18,
symbol: 'ETH',
origin: ['RFQ.ETH'],
destination: ['RFQ.ETH'],
swappable: [],
},
},
'1088': {
'0x17C09cfC96C865CF546d73365Cedb6dC66986963': {
decimals: 18,
Expand All @@ -894,6 +931,13 @@ export const BRIDGE_MAP = {
destination: ['SYN'],
swappable: [],
},
'0x75cb093E4D61d2A2e65D8e0BBb01DE8d89b53481': {
decimals: 18,
symbol: 'WMetis',
origin: ['Metis'],
destination: ['Metis'],
swappable: [],
},
'0x931B8f17764362A3325D30681009f0eDd6211231': {
decimals: 18,
symbol: 'nETH',
Expand Down Expand Up @@ -922,6 +966,13 @@ export const BRIDGE_MAP = {
destination: ['nUSD'],
swappable: ['0x961318Fc85475E125B99Cc9215f62679aE5200aB'],
},
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': {
decimals: 18,
symbol: 'Metis',
origin: ['Metis'],
destination: ['Metis'],
swappable: [],
},
'0xFB21B70922B9f6e3C6274BcD6CB1aa8A0fe20B80': {
decimals: 18,
symbol: 'gOHM',
Expand Down Expand Up @@ -1179,6 +1230,13 @@ export const BRIDGE_MAP = {
destination: ['JEWEL'],
swappable: [],
},
'0x543f1b2176F7E677a95D01ca83551FAa08F83D9F': {
decimals: 18,
symbol: 'Metis',
origin: ['Metis'],
destination: ['Metis'],
swappable: [],
},
'0x5819b6af194A78511c79C85Ea68D2377a7e9335f': {
decimals: 18,
symbol: 'WKLAY',
Expand Down Expand Up @@ -1736,6 +1794,13 @@ export const BRIDGE_MAP = {
destination: ['nUSD'],
swappable: [],
},
'0x43E8E55792D6317328e5c6B0A0C89eF4b8102Fa2': {
decimals: 18,
symbol: 'Metis',
origin: ['Metis'],
destination: ['Metis'],
swappable: [],
},
'0x7516EB8B8Edfa420f540a162335eACF3ea05a247': {
decimals: 8,
symbol: 'BTC.b',
Expand Down Expand Up @@ -1793,6 +1858,36 @@ export const BRIDGE_MAP = {
swappable: [],
},
},
'59144': {
'0x176211869cA2b568f2A7D4EE941E073a821EE1ff': {
decimals: 6,
symbol: 'USDC',
origin: ['RFQ.USDC'],
destination: ['RFQ.USDC'],
swappable: ['0xA219439258ca9da29E9Cc4cE5596924745e12B93'],
},
'0xA219439258ca9da29E9Cc4cE5596924745e12B93': {
decimals: 6,
symbol: 'USDT',
origin: ['RFQ.USDC'],
destination: [],
swappable: ['0x176211869cA2b568f2A7D4EE941E073a821EE1ff'],
},
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': {
decimals: 18,
symbol: 'ETH',
origin: ['RFQ.ETH'],
destination: ['RFQ.ETH'],
swappable: [],
},
'0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f': {
decimals: 18,
symbol: 'WETH',
origin: ['RFQ.ETH'],
destination: [],
swappable: [],
},
},
'81457': {
'0x3194B0A295D87fDAA54DF852c248F7a6BAF6c6e0': {
decimals: 18,
Expand All @@ -1804,8 +1899,8 @@ export const BRIDGE_MAP = {
'0x4300000000000000000000000000000000000003': {
decimals: 18,
symbol: 'USDB',
origin: ['nUSD', 'RFQ.USDB'],
destination: ['nUSD', 'RFQ.USDB'],
origin: ['nUSD'],
destination: ['nUSD'],
swappable: ['0x3194B0A295D87fDAA54DF852c248F7a6BAF6c6e0'],
},
'0x4300000000000000000000000000000000000004': {
Expand Down Expand Up @@ -1846,6 +1941,36 @@ export const BRIDGE_MAP = {
],
},
},
'534352': {
'0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4': {
decimals: 6,
symbol: 'USDC',
origin: ['RFQ.USDC'],
destination: ['RFQ.USDC'],
swappable: ['0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df'],
},
'0x5300000000000000000000000000000000000004': {
decimals: 18,
symbol: 'WETH',
origin: ['RFQ.ETH'],
destination: [],
swappable: [],
},
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': {
decimals: 18,
symbol: 'ETH',
origin: ['RFQ.ETH'],
destination: ['RFQ.ETH'],
swappable: [],
},
'0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df': {
decimals: 6,
symbol: 'USDT',
origin: ['RFQ.USDC'],
destination: [],
swappable: ['0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4'],
},
},
'1313161554': {
'0x07379565cD8B0CaE7c60Dc78e7f601b34AF2A21c': {
decimals: 18,
Expand Down
26 changes: 26 additions & 0 deletions packages/synapse-constants/src/constants/chains/master.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,3 +504,29 @@ export const LINEA: Chain = {
},
color: 'black',
}

export const WORLDCHAIN: Chain = {
priorityRank: 99,
id: 480,
chainSymbol: 'WORLDCHAIN',
name: 'World Chain',
codeName: 'worldchain',
chainImg:
'https://synapse-interface-worldchain.sanguine-fe.pages.dev/_next/static/media/worldchain.62d1dfd2.svg',
layer: 2,
rpcUrls: {
primary: 'https://worldchain-mainnet.g.alchemy.com/public',
fallback: 'https://worldchain-mainnet.g.alchemy.com/public',
},
explorerUrl: 'https://worldchain-mainnet.explorer.alchemy.com',
explorerName: 'World Chain Explorer',
explorerImg:
'https://synapse-interface-worldchain.sanguine-fe.pages.dev/_next/static/media/worldchain.62d1dfd2.svg',
blockTime: 3000,
nativeCurrency: {
name: 'Ethereum',
symbol: 'ETH',
decimals: 18,
},
color: 'black',
}
44 changes: 41 additions & 3 deletions packages/synapse-constants/src/constants/tokens/bridgeable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@ export const ETH = new Token({
[CHAINS.BLAST.id]: nullAddress,
[CHAINS.SCROLL.id]: nullAddress,
[CHAINS.LINEA.id]: nullAddress,
[CHAINS.WORLDCHAIN.id]: nullAddress,
},
decimals: 18,
symbol: 'ETH',
Expand Down Expand Up @@ -911,6 +912,7 @@ export const USDCe = new Token({
[CHAINS.ARBITRUM.id]: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8',
[CHAINS.AURORA.id]: '0xB12BFcA5A55806AaF64E99521918A4bf0fC40802',
[CHAINS.POLYGON.id]: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174',
[CHAINS.WORLDCHAIN.id]: '0x79A02482A880bCE3F13e09Da970dC34db4CD24d1',
},
decimals: 6,
symbol: 'USDC.e',
Expand Down Expand Up @@ -1114,7 +1116,6 @@ export const WKLAY = new Token({

export const MATIC = new Token({
addresses: {
[CHAINS.POLYGON.id]: zeroAddress,
[CHAINS.DFK.id]: '0xD17a41Cd199edF1093A9Be4404EaDe52Ec19698e',
},
decimals: 18,
Expand All @@ -1130,7 +1131,24 @@ export const MATIC = new Token({
coingeckoId: 'matic-network',
})

export const WMATIC = new Token({
export const POL = new Token({
addresses: {
[CHAINS.POLYGON.id]: zeroAddress,
},
decimals: 18,
symbol: 'MATIC',
name: 'MATIC',
logo: 'https://8f3ea9f2.sanguine-fe.pages.dev/_next/static/media/matic.237cd2b6.svg',
isNative: true,
swapableType: 'MATIC',
color: 'blue',
visibilityRank: 90,
priorityRank: 3,
routeSymbol: 'POL',
coingeckoId: 'matic-network',
})

export const WPOL = new Token({
addresses: {
[CHAINS.POLYGON.id]: '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270',
},
Expand All @@ -1142,7 +1160,7 @@ export const WMATIC = new Token({
color: 'blue',
visibilityRank: 90,
priorityRank: 3,
routeSymbol: 'WMATIC',
routeSymbol: 'WPOL',
})

export const FTM = new Token({
Expand Down Expand Up @@ -1276,3 +1294,23 @@ export const SPECTRAL = new Token({
color: 'blue',
routeSymbol: 'SPEC',
})

export const WLD = new Token({
priorityRank: 106,
addresses: {
[CHAINS.ETH.id]: '0x163f8c2467924be0ae7b5347228cabf260318753',
[CHAINS.OPTIMISM.id]: '0xdC6fF44d5d932Cbd77B52E5612Ba0529DC6226F1',
[CHAINS.WORLDCHAIN.id]: '0x2cFc85d8E48F8EAB294be644d9E25C3030863003',
},
decimals: {
[CHAINS.ETH.id]: 18,
[CHAINS.OPTIMISM.id]: 18,
[CHAINS.WORLDCHAIN.id]: 18,
},
symbol: 'WLD',
name: 'Worldcoin',
logo: 'https://synapse-interface-worldchain.sanguine-fe.pages.dev/_next/static/media/worldchain.62d1dfd2.svg',
swapableType: 'WLD',
color: 'gray',
routeSymbol: 'WLD',
})
Loading
Loading