Skip to content

Commit

Permalink
Merge pull request #73 from Jeff-CCH/feat/add-polygon-zkEVM
Browse files Browse the repository at this point in the history
feat(core): add Router address to Polygon zkEVM
  • Loading branch information
Jeff-CCH authored Jul 24, 2024
2 parents bd22b59 + 0045058 commit 631f72c
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/quick-teachers-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@protocolink/core': minor
---

add Router address to Polygon zkEVM
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"typechain": "rm -rf src/contracts && typechain --target ethers-v5 --out-dir src/contracts src/abis/*.json && pretty-quick"
},
"dependencies": {
"@protocolink/common": "^0.4.2",
"@protocolink/common": "^0.5.0",
"@uniswap/permit2-sdk": "^1.2.0",
"ethers": "^5.7.2",
"tiny-invariant": "^1.3.1"
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export const contractAddressMap: Record<number, Record<ContractNames, string>> =
[common.ChainId.metis]: {
Router: '0xDec80E988F4baF43be69c13711453013c212feA8',
},
[common.ChainId.polygonZkevm]: {
Router: '0xDec80E988F4baF43be69c13711453013c212feA8',
},
[common.ChainId.base]: {
Router: '0xDec80E988F4baF43be69c13711453013c212feA8',
},
Expand Down
26 changes: 26 additions & 0 deletions packages/core/src/router-kit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ describe('RouterKit', function () {
chainId: common.ChainId.metis,
expected: '0x4D4c961De7140E642b7217f221b73e859E3A6482',
},
{
chainId: common.ChainId.polygonZkevm,
expected: '0x4D4c961De7140E642b7217f221b73e859E3A6482',
},
{
chainId: common.ChainId.base,
expected: '0x4D4c961De7140E642b7217f221b73e859E3A6482',
Expand Down Expand Up @@ -92,6 +96,10 @@ describe('RouterKit', function () {
chainId: common.ChainId.metis,
expected: '0xFB20753f85f89be6F42D228667D70e62D1Ba5f75',
},
{
chainId: common.ChainId.polygonZkevm,
expected: '0xFB20753f85f89be6F42D228667D70e62D1Ba5f75',
},
{
chainId: common.ChainId.base,
expected: '0xFB20753f85f89be6F42D228667D70e62D1Ba5f75',
Expand Down Expand Up @@ -149,6 +157,10 @@ describe('RouterKit', function () {
chainId: common.ChainId.metis,
expected: '0xfb20753f85f89be6f42d228667d70e62d1ba5f75000000000000000000002710',
},
{
chainId: common.ChainId.polygonZkevm,
expected: '0xfb20753f85f89be6f42d228667d70e62d1ba5f75000000000000000000002710',
},
{
chainId: common.ChainId.base,
expected: '0xfb20753f85f89be6f42d228667d70e62d1ba5f75000000000000000000002710',
Expand Down Expand Up @@ -206,6 +218,10 @@ describe('RouterKit', function () {
chainId: common.ChainId.metis,
expected: '0x2EE5407017B878774b58c34A8c09CAcC94aDd69B',
},
{
chainId: common.ChainId.polygonZkevm,
expected: '0x000000000022D473030F116dDEE9F6B43aC78BA3',
},
{
chainId: common.ChainId.base,
expected: '0x000000000022D473030F116dDEE9F6B43aC78BA3',
Expand Down Expand Up @@ -305,6 +321,16 @@ describe('RouterKit', function () {
account: '0xa3C1C91403F0026b9dd086882aDbC8Cdbc3b3cfB',
expected: '0x22CF139619f4B8Afc863beCa670615C6310aC7c6',
},
{
chainId: common.ChainId.polygonZkevm,
account: '0x5cb738DAe833Ec21fe65ae1719fAd8ab8cE7f23D',
expected: '0x8f6325f5E452B8Aa8137722A9f584C41c32d53A1',
},
{
chainId: common.ChainId.polygonZkevm,
account: '0xa3C1C91403F0026b9dd086882aDbC8Cdbc3b3cfB',
expected: '0x22CF139619f4B8Afc863beCa670615C6310aC7c6',
},
{
chainId: common.ChainId.base,
account: '0x5cb738DAe833Ec21fe65ae1719fAd8ab8cE7f23D',
Expand Down
15 changes: 15 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,21 @@
type-fest "^3.12.0"
zksync-web3 "^0.14.3"

"@protocolink/common@^0.4.2":
version "0.4.2"
resolved "https://registry.yarnpkg.com/@protocolink/common/-/common-0.4.2.tgz#25fb1f4991aaf957dc686e5364f4f5a47c9fe7bf"
integrity sha512-HuO3WZEfSDnbbdSrUlHYcltgWdKe0V9suJrS/FYFrrawGHI3zE4mZwG7oBvbczU+z1OwF4ANTEhKVOH11uWJIQ==
dependencies:
"@types/lodash" "^4.14.195"
axios "^1.3.6"
axios-retry "^3.5.1"
bignumber.js "^9.1.1"
ethers "^5.7.2"
lodash "^4.17.21"
tiny-invariant "^1.3.1"
type-fest "^3.12.0"
zksync-web3 "^0.14.3"

"@protocolink/core@^0.4.13":
version "0.4.13"
resolved "https://registry.yarnpkg.com/@protocolink/core/-/core-0.4.13.tgz#844c6c31d1ea60a0a5db8fd6b89104b006aaaefd"
Expand Down

0 comments on commit 631f72c

Please sign in to comment.