Skip to content

Commit

Permalink
feat: update router addresses for production use
Browse files Browse the repository at this point in the history
  • Loading branch information
zodahu committed Nov 20, 2023
1 parent 4605ce2 commit 7f66ce3
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 33 deletions.
5 changes: 5 additions & 0 deletions .changeset/weak-cups-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@protocolink/core': patch
---

feat: update router addresses for production use
14 changes: 7 additions & 7 deletions packages/core/src/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ type ContractNames = 'Router';

export const contractAddressMap: Record<number, Record<ContractNames, string>> = {
[common.ChainId.mainnet]: {
Router: '0x3fa3B62F0c9c13733245A778DE4157E47Cf5bA21',
Router: '0xDec80E988F4baF43be69c13711453013c212feA8',
},
[common.ChainId.optimism]: {
Router: '0x3fa3B62F0c9c13733245A778DE4157E47Cf5bA21',
Router: '0xDec80E988F4baF43be69c13711453013c212feA8',
},
[common.ChainId.polygon]: {
Router: '0x3fa3B62F0c9c13733245A778DE4157E47Cf5bA21',
Router: '0xDec80E988F4baF43be69c13711453013c212feA8',
},
[common.ChainId.zksync]: {
Router: '0xa8350893B36e0425B50917125d9603F81F2D3C87',
},
[common.ChainId.metis]: {
Router: '0x3fa3B62F0c9c13733245A778DE4157E47Cf5bA21',
Router: '0xDec80E988F4baF43be69c13711453013c212feA8',
},
[common.ChainId.base]: {
Router: '0x3fa3B62F0c9c13733245A778DE4157E47Cf5bA21',
Router: '0xDec80E988F4baF43be69c13711453013c212feA8',
},
[common.ChainId.arbitrum]: {
Router: '0x3fa3B62F0c9c13733245A778DE4157E47Cf5bA21',
Router: '0xDec80E988F4baF43be69c13711453013c212feA8',
},
[common.ChainId.avalanche]: {
Router: '0x3fa3B62F0c9c13733245A778DE4157E47Cf5bA21',
Router: '0xDec80E988F4baF43be69c13711453013c212feA8',
},
};

Expand Down
156 changes: 130 additions & 26 deletions packages/core/src/router-kit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,36 @@ describe('RouterKit', function () {
const testCases = [
{
chainId: common.ChainId.mainnet,
expected: '0x903847853d5fE12BaC24dD85903190528CF6070b',
expected: '0x4D4c961De7140E642b7217f221b73e859E3A6482',
},
{
chainId: common.ChainId.polygon,
expected: '0x903847853d5fE12BaC24dD85903190528CF6070b',
chainId: common.ChainId.optimism,
expected: '0x4D4c961De7140E642b7217f221b73e859E3A6482',
},
{
chainId: common.ChainId.arbitrum,
expected: '0x903847853d5fE12BaC24dD85903190528CF6070b',
chainId: common.ChainId.polygon,
expected: '0x4D4c961De7140E642b7217f221b73e859E3A6482',
},
{
chainId: common.ChainId.zksync,
expected: '0x1f4f87CDf642bAfD106fa42Ae327f5bAE7ab8F02',
},
{
chainId: common.ChainId.metis,
expected: '0x4D4c961De7140E642b7217f221b73e859E3A6482',
},
{
chainId: common.ChainId.base,
expected: '0x4D4c961De7140E642b7217f221b73e859E3A6482',
},
{
chainId: common.ChainId.arbitrum,
expected: '0x4D4c961De7140E642b7217f221b73e859E3A6482',
},
{
chainId: common.ChainId.avalanche,
expected: '0x4D4c961De7140E642b7217f221b73e859E3A6482',
},
];

testCases.forEach(({ chainId, expected }, i) => {
Expand All @@ -38,19 +54,35 @@ describe('RouterKit', function () {
const testCases = [
{
chainId: common.ChainId.mainnet,
expected: '0xDdbe07CB6D77e81802C55bB381546c0DA51163dd',
expected: '0x6304EB1B1eC2135a64a90bA901B12Cf769657579',
},
{
chainId: common.ChainId.optimism,
expected: '0x168608B226ef4E59Db5E61359509656a51BAe090',
},
{
chainId: common.ChainId.polygon,
expected: '0x3EBe4dfaF95cd320BF34633B3BDf773FbE732E63',
},
{
chainId: common.ChainId.zksync,
expected: '0xDdbe07CB6D77e81802C55bB381546c0DA51163dd',
},
{
chainId: common.ChainId.metis,
expected: '0x75Ce960F2FD5f06C83EE034992362e593dcf7722',
},
{
chainId: common.ChainId.base,
expected: '0x50Df7c73bA1B4bb74934E50298de73F265260Ea4',
},
{
chainId: common.ChainId.arbitrum,
expected: '0xDdbe07CB6D77e81802C55bB381546c0DA51163dd',
expected: '0x3EBe4dfaF95cd320BF34633B3BDf773FbE732E63',
},
{
chainId: common.ChainId.zksync,
expected: '0xDdbe07CB6D77e81802C55bB381546c0DA51163dd',
chainId: common.ChainId.avalanche,
expected: '0x168608B226ef4E59Db5E61359509656a51BAe090',
},
];

Expand All @@ -67,19 +99,35 @@ describe('RouterKit', function () {
const testCases = [
{
chainId: common.ChainId.mainnet,
expected: '0xddbe07cb6d77e81802c55bb381546c0da51163dd000000000000000000002710',
expected: '0x6304eb1b1ec2135a64a90ba901b12cf769657579000000000000000000002710',
},
{
chainId: common.ChainId.optimism,
expected: '0x168608b226ef4e59db5e61359509656a51bae090000000000000000000002710',
},
{
chainId: common.ChainId.polygon,
expected: '0x3ebe4dfaf95cd320bf34633b3bdf773fbe732e63000000000000000000002710',
},
{
chainId: common.ChainId.zksync,
expected: '0xddbe07cb6d77e81802c55bb381546c0da51163dd000000000000000000002710',
},
{
chainId: common.ChainId.metis,
expected: '0x75ce960f2fd5f06c83ee034992362e593dcf7722000000000000000000002710',
},
{
chainId: common.ChainId.base,
expected: '0x50df7c73ba1b4bb74934e50298de73f265260ea4000000000000000000002710',
},
{
chainId: common.ChainId.arbitrum,
expected: '0xddbe07cb6d77e81802c55bb381546c0da51163dd000000000000000000002710',
expected: '0x3ebe4dfaf95cd320bf34633b3bdf773fbe732e63000000000000000000002710',
},
{
chainId: common.ChainId.zksync,
expected: '0xddbe07cb6d77e81802c55bb381546c0da51163dd000000000000000000002710',
chainId: common.ChainId.avalanche,
expected: '0x168608b226ef4e59db5e61359509656a51bae090000000000000000000002710',
},
];

Expand All @@ -99,17 +147,33 @@ describe('RouterKit', function () {
expected: '0x000000000022D473030F116dDEE9F6B43aC78BA3',
},
{
chainId: common.ChainId.polygon,
chainId: common.ChainId.optimism,
expected: '0x000000000022D473030F116dDEE9F6B43aC78BA3',
},
{
chainId: common.ChainId.arbitrum,
chainId: common.ChainId.polygon,
expected: '0x000000000022D473030F116dDEE9F6B43aC78BA3',
},
{
chainId: common.ChainId.zksync,
expected: '0x87C0878B54c174199f438470FD74B3F7e1Def295',
},
{
chainId: common.ChainId.metis,
expected: '0x2EE5407017B878774b58c34A8c09CAcC94aDd69B',
},
{
chainId: common.ChainId.base,
expected: '0x000000000022D473030F116dDEE9F6B43aC78BA3',
},
{
chainId: common.ChainId.arbitrum,
expected: '0x000000000022D473030F116dDEE9F6B43aC78BA3',
},
{
chainId: common.ChainId.avalanche,
expected: '0x000000000022D473030F116dDEE9F6B43aC78BA3',
},
];

testCases.forEach(({ chainId, expected }, i) => {
Expand All @@ -126,32 +190,32 @@ describe('RouterKit', function () {
{
chainId: common.ChainId.mainnet,
account: '0x5cb738DAe833Ec21fe65ae1719fAd8ab8cE7f23D',
expected: '0xefc25B94FFeB90d5045cDAA936a52489bfBeA9D8',
expected: '0x8f6325f5E452B8Aa8137722A9f584C41c32d53A1',
},
{
chainId: common.ChainId.mainnet,
account: '0xa3C1C91403F0026b9dd086882aDbC8Cdbc3b3cfB',
expected: '0x236E002fb1ba4043463aa89E1ccF845d2e3661a6',
expected: '0x22CF139619f4B8Afc863beCa670615C6310aC7c6',
},
{
chainId: common.ChainId.polygon,
chainId: common.ChainId.optimism,
account: '0x5cb738DAe833Ec21fe65ae1719fAd8ab8cE7f23D',
expected: '0xefc25B94FFeB90d5045cDAA936a52489bfBeA9D8',
expected: '0x8f6325f5E452B8Aa8137722A9f584C41c32d53A1',
},
{
chainId: common.ChainId.polygon,
chainId: common.ChainId.optimism,
account: '0xa3C1C91403F0026b9dd086882aDbC8Cdbc3b3cfB',
expected: '0x236E002fb1ba4043463aa89E1ccF845d2e3661a6',
expected: '0x22CF139619f4B8Afc863beCa670615C6310aC7c6',
},
{
chainId: common.ChainId.arbitrum,
chainId: common.ChainId.polygon,
account: '0x5cb738DAe833Ec21fe65ae1719fAd8ab8cE7f23D',
expected: '0xefc25B94FFeB90d5045cDAA936a52489bfBeA9D8',
expected: '0x8f6325f5E452B8Aa8137722A9f584C41c32d53A1',
},
{
chainId: common.ChainId.arbitrum,
chainId: common.ChainId.polygon,
account: '0xa3C1C91403F0026b9dd086882aDbC8Cdbc3b3cfB',
expected: '0x236E002fb1ba4043463aa89E1ccF845d2e3661a6',
expected: '0x22CF139619f4B8Afc863beCa670615C6310aC7c6',
},
{
chainId: common.ChainId.zksync,
Expand All @@ -163,6 +227,46 @@ describe('RouterKit', function () {
account: '0xa3C1C91403F0026b9dd086882aDbC8Cdbc3b3cfB',
expected: '0x7A4908e637ae38D565Ea88010F75EB5dBdf39fFc',
},
{
chainId: common.ChainId.metis,
account: '0x5cb738DAe833Ec21fe65ae1719fAd8ab8cE7f23D',
expected: '0x8f6325f5E452B8Aa8137722A9f584C41c32d53A1',
},
{
chainId: common.ChainId.metis,
account: '0xa3C1C91403F0026b9dd086882aDbC8Cdbc3b3cfB',
expected: '0x22CF139619f4B8Afc863beCa670615C6310aC7c6',
},
{
chainId: common.ChainId.base,
account: '0x5cb738DAe833Ec21fe65ae1719fAd8ab8cE7f23D',
expected: '0x8f6325f5E452B8Aa8137722A9f584C41c32d53A1',
},
{
chainId: common.ChainId.base,
account: '0xa3C1C91403F0026b9dd086882aDbC8Cdbc3b3cfB',
expected: '0x22CF139619f4B8Afc863beCa670615C6310aC7c6',
},
{
chainId: common.ChainId.arbitrum,
account: '0x5cb738DAe833Ec21fe65ae1719fAd8ab8cE7f23D',
expected: '0x8f6325f5E452B8Aa8137722A9f584C41c32d53A1',
},
{
chainId: common.ChainId.arbitrum,
account: '0xa3C1C91403F0026b9dd086882aDbC8Cdbc3b3cfB',
expected: '0x22CF139619f4B8Afc863beCa670615C6310aC7c6',
},
{
chainId: common.ChainId.avalanche,
account: '0x5cb738DAe833Ec21fe65ae1719fAd8ab8cE7f23D',
expected: '0x8f6325f5E452B8Aa8137722A9f584C41c32d53A1',
},
{
chainId: common.ChainId.avalanche,
account: '0xa3C1C91403F0026b9dd086882aDbC8Cdbc3b3cfB',
expected: '0x22CF139619f4B8Afc863beCa670615C6310aC7c6',
},
];

testCases.forEach(({ chainId, account, expected }, i) => {
Expand Down Expand Up @@ -198,7 +302,7 @@ describe('RouterKit', function () {
name: 'Protocolink',
version: '1',
chainId: 1,
verifyingContract: '0x3fa3B62F0c9c13733245A778DE4157E47Cf5bA21',
verifyingContract: '0xDec80E988F4baF43be69c13711453013c212feA8',
},
types: {
LogicBatch: [
Expand Down

0 comments on commit 7f66ce3

Please sign in to comment.