Skip to content

Commit

Permalink
[#1286] Support for CCTP Polygon (#1312)
Browse files Browse the repository at this point in the history
* Support for polygon testnet manual CCTP route

* Support for polygon mainnet manual CCTP route

* Support for polygon testnet relay CCTP route

* Support for polygon mainnet relay CCTP route

* Add wormchain default rpc and update foreign assets cache

* Add missing cctp domain to polygon mainnet config

* Fix contract address

* Revert check foreign address script changes mistakingly commited
  • Loading branch information
M-Picco committed Dec 15, 2023
1 parent bcc19c8 commit 6c03d7a
Show file tree
Hide file tree
Showing 7 changed files with 318 additions and 97 deletions.
9 changes: 8 additions & 1 deletion sdk/src/config/MAINNET.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,16 @@ const MAINNET: { [chain in MainnetChainName]: ChainConfig } = {
...CONTRACTS.MAINNET.polygon,
relayer: '0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca',
tbtcGateway: '0x09959798B95d00a3183d20FaC298E4594E599eab',
cctpContracts: {
cctpMessageTransmitter: '0xF3be9355363857F3e001be68856A2f96b4C39Ba9',
cctpTokenMessenger: '0x9daF8c91AEFAE50b9c0E69629D3F6Ca40cA3B3FE',
wormholeCCTP: '0x0FF28217dCc90372345954563486528aa865cDd6',
wormholeCircleRelayer: '0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2',
},
},
finalityThreshold: 512,
nativeTokenDecimals: 18,
cctpDomain: 7,
},
bsc: {
key: 'bsc',
Expand Down Expand Up @@ -306,7 +313,7 @@ const MAINNET_CONFIG: WormholeConfig = {
optimism: 'https://rpc.ankr.com/optimism',
base: 'https://base.publicnode.com',
sei: '', // TODO: fill in
wormchain: '',
wormchain: 'https://wormchain-rpc.quickapi.com',
osmosis: 'https://osmosis-rpc.polkachu.com',
cosmoshub: 'https://cosmos-rpc.polkachu.com',
evmos: 'https://evmos-rpc.polkachu.com',
Expand Down
7 changes: 7 additions & 0 deletions sdk/src/config/TESTNET.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,16 @@ const TESTNET: { [chain in TestnetChainName]: ChainConfig } = {
...CONTRACTS.TESTNET.polygon,
relayer: '0x9563a59c15842a6f322b10f69d1dd88b41f2e97b',
tbtcGateway: '0x91fe7128f74dbd4f031ea3d90fc5ea4dcfd81818',
cctpContracts: {
cctpTokenMessenger: '0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5',
cctpMessageTransmitter: '0xe09A679F56207EF33F5b9d8fb4499Ec00792eA73',
wormholeCCTP: '0x2703483B1a5a7c577e8680de9Df8Be03c6f30e3c',
wormholeCircleRelayer: '0x4cb69FaE7e7Af841e44E1A1c30Af640739378bb2',
},
},
finalityThreshold: 64,
nativeTokenDecimals: 18,
cctpDomain: 7,
},
bsc: {
key: 'bsc',
Expand Down
4 changes: 3 additions & 1 deletion wormhole-connect/scripts/checkForeignAssetsConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ const checkEnvConfig = async (
if (WORMCHAIN_ERROR_MESSAGES.includes(e?.message)) {
// do not throw on wormchain errors
} else {
throw e;
console.error(
`❌ Failed to fetch foreign address. Env: ${env}, Key: ${tokenKey}, Chain: ${chain} ${e?.message}`,
);
}
}
if (foreignAddress) {
Expand Down
Loading

0 comments on commit 6c03d7a

Please sign in to comment.