Skip to content

Commit

Permalink
FE: add polygon native USDC and FRAX (#1627)
Browse files Browse the repository at this point in the history
* Update values in generation script

* Update CCTP Router Address

* Regenerate bridge map

* Add FRAX address on Polygon

---------

Co-authored-by: bigboydiamonds <[email protected]>
  • Loading branch information
ChiTimesChi and bigboydiamonds authored Dec 13, 2023
1 parent 452bfca commit 3f02e01
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 14 deletions.
50 changes: 42 additions & 8 deletions packages/synapse-interface/constants/bridgeMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,11 @@ export const BRIDGE_MAP = {
'0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174': {
decimals: 6,
symbol: 'USDC.e',
origin: ['nUSD'],
destination: ['nUSD'],
origin: ['CCTP.USDC', 'nUSD'],
destination: ['CCTP.USDC', 'nUSD'],
swappable: [
'0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',
'0x45c32fA6DF82ead1e2EF74d17b76547EDdFaFF89',
'0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063',
'0xB6c473756050dE474286bED418B77Aeac39B02aF',
'0xc2132D05D31c914a87C6611C10748AEb04B58e8F',
Expand All @@ -536,24 +538,54 @@ export const BRIDGE_MAP = {
destination: ['H2O'],
swappable: [],
},
'0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359': {
decimals: 6,
symbol: 'USDC',
origin: ['CCTP.USDC', 'nUSD'],
destination: ['CCTP.USDC'],
swappable: [
'0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174',
'0x45c32fA6DF82ead1e2EF74d17b76547EDdFaFF89',
'0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063',
'0xB6c473756050dE474286bED418B77Aeac39B02aF',
'0xc2132D05D31c914a87C6611C10748AEb04B58e8F',
],
},
'0x45c32fA6DF82ead1e2EF74d17b76547EDdFaFF89': {
decimals: 18,
symbol: 'FRAX',
origin: ['CCTP.USDC', 'nUSD'],
destination: ['CCTP.USDC'],
swappable: [
'0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174',
'0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',
'0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063',
'0xB6c473756050dE474286bED418B77Aeac39B02aF',
'0xc2132D05D31c914a87C6611C10748AEb04B58e8F',
],
},
'0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063': {
decimals: 18,
symbol: 'DAI',
origin: ['nUSD'],
destination: ['nUSD'],
origin: ['CCTP.USDC', 'nUSD'],
destination: ['CCTP.USDC', 'nUSD'],
swappable: [
'0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174',
'0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',
'0x45c32fA6DF82ead1e2EF74d17b76547EDdFaFF89',
'0xB6c473756050dE474286bED418B77Aeac39B02aF',
'0xc2132D05D31c914a87C6611C10748AEb04B58e8F',
],
},
'0xB6c473756050dE474286bED418B77Aeac39B02aF': {
decimals: 18,
symbol: 'nUSD',
origin: ['nUSD'],
destination: ['nUSD'],
origin: ['CCTP.USDC', 'nUSD'],
destination: ['CCTP.USDC', 'nUSD'],
swappable: [
'0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174',
'0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',
'0x45c32fA6DF82ead1e2EF74d17b76547EDdFaFF89',
'0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063',
'0xc2132D05D31c914a87C6611C10748AEb04B58e8F',
],
Expand All @@ -568,10 +600,12 @@ export const BRIDGE_MAP = {
'0xc2132D05D31c914a87C6611C10748AEb04B58e8F': {
decimals: 6,
symbol: 'USDT',
origin: ['nUSD'],
destination: ['nUSD'],
origin: ['CCTP.USDC', 'nUSD'],
destination: ['CCTP.USDC', 'nUSD'],
swappable: [
'0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174',
'0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',
'0x45c32fA6DF82ead1e2EF74d17b76547EDdFaFF89',
'0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063',
'0xB6c473756050dE474286bED418B77Aeac39B02aF',
],
Expand Down
1 change: 1 addition & 0 deletions packages/synapse-interface/constants/tokens/bridgeable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ export const FRAX = new Token({
[CHAINS.ETH.id]: '0x853d955acef822db058eb8505911ed77f175b99e',
[CHAINS.ARBITRUM.id]: '0x17FC002b466eEc40DaE837Fc4bE5c67993ddBd6F',
[CHAINS.DOGE.id]: '0x10D70831f9C3c11c5fe683b2f1Be334503880DB6',
[CHAINS.POLYGON.id]: '0x45c32fA6DF82ead1e2EF74d17b76547EDdFaFF89',
},
decimals: 18,
symbol: 'FRAX',
Expand Down
9 changes: 4 additions & 5 deletions packages/synapse-interface/scripts/generateMaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ Object.keys(providers).forEach((chainId) => {

// Contract addresses
const SynapseRouterAddress = '0x7e7a0e201fd38d3adaa9523da6c109a07118c96a'
const SynapseCCTPRouterAddress = '0xd359bc471554504f683fbd4f6e36848612349ddf'
const SynapseCCTPAddress = '0xfB2Bfc368a7edfD51aa2cbEC513ad50edEa74E84'
const SynapseCCTPOptimismAddress = '0x5e69c336661dde70404e3345BA61F9c01DdB4C36'
const SynapseCCTPRouterAddress = '0xd5a597d6e7ddf373a92C8f477DAAA673b0902F48'
const SynapseCCTPAddress = '0x12715a66773BD9C54534a01aBF01d05F6B4Bd35E'

// Chain IDs where SynapseCCTPRouter is allowed
const allowedChainIdsForSynapseCCTPRouter = [1, 10, 8453, 42161, 43114]
const allowedChainIdsForSynapseCCTPRouter = [1, 10, 137, 8453, 42161, 43114]

// Get SynapseRouter contract instances for each chain
const SynapseRouters = {}
Expand Down Expand Up @@ -61,7 +60,7 @@ allowedChainIdsForSynapseCCTPRouter.forEach((chainId) => {
providers[chainId]
)
SynapseCCTPs[chainId] = new ethers.Contract(
chainId === 10 ? SynapseCCTPOptimismAddress : SynapseCCTPAddress,
SynapseCCTPAddress,
SynapseCCTPABI,
providers[chainId]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BRIDGABLE_TOKENS, POOLS_BY_CHAIN } from '@/constants/tokens'
import { FetchState } from '@/slices/portfolio/actions'

export const ROUTER_ADDRESS = '0x7E7A0e201FD38d3ADAA9523Da6C109a07118C96a'
export const CCTP_ROUTER_ADDRESS = '0xd359bc471554504f683fbd4f6e36848612349ddf'
export const CCTP_ROUTER_ADDRESS = '0xd5a597d6e7ddf373a92C8f477DAAA673b0902F48'

export interface TokenAndBalance {
token: Token
Expand Down

0 comments on commit 3f02e01

Please sign in to comment.