Skip to content

Commit

Permalink
add morph network
Browse files Browse the repository at this point in the history
  • Loading branch information
hskang9 committed Nov 25, 2024
1 parent 77236a0 commit a04989b
Show file tree
Hide file tree
Showing 9 changed files with 313 additions and 22 deletions.
68 changes: 68 additions & 0 deletions src/buildList.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const neon = require("./tokens/neon.json");
const taiko = require("./tokens/taiko.json");
const storyIliad = require("./tokens/story_iliad.json");
const storyOdyssey = require("./tokens/story_odyssey.json");
const morph = require("./tokens/morph.json");

// pairs
const basePairs = require("./pairs/base.json");
Expand All @@ -23,6 +24,7 @@ const neonPairs = require("./pairs/neon.json");
const taikoPairs = require("./pairs/taiko.json");
const storyIliadPairs = require("./pairs/story_iliad.json");
const storyOdysseyPairs = require("./pairs/story_odyssey.json");
const morphPairs = require("./pairs/morph.json");

const bridgeUtils = require("@uniswap/token-list-bridge-utils");

Expand Down Expand Up @@ -136,6 +138,15 @@ module.exports = function buildList() {
decimals: 18,
logoURI: "https://app.piperx.xyz/assets/icon_Story-0eb3cd42.png",
},
Morph: {
"chainId": 2818,
"address": "0x5300000000000000000000000000000000000011",
"name": "Ether",
"symbol": "ETH",
"decimals": 18,
"cgId": "ethereum",
"logoURI": "https://s2.coinmarketcap.com/static/img/coins/128x128/1027.png"
},
},
// List stablecoins with top market cap on each chain
stablecoins: {
Expand Down Expand Up @@ -333,6 +344,35 @@ module.exports = function buildList() {
logoURI: "https://ethereum-optimism.github.io/data/USDC/logo.png",
},
],
Morph: [
{
"chainId": 2818,
"address": "0xc7D67A9cBB121b3b0b9c053DD9f469523243379A",
"name": "Tether USD",
"symbol": "USDT",
"decimals": 18,
"cgId": "tether",
"logoURI": "https://raw.githubusercontent.com/morph-l2/morph-list/main/tokenIcons/USDT.svg"
},
{
"chainId": 2818,
"address": "0xe34c91815d7fc18A9e2148bcD4241d0a5848b693",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"cgId": "usd-coin",
"logoURI": "https://raw.githubusercontent.com/morph-l2/morph-list/main/tokenIcons/USDC.svg"
},
{
"chainId": 2818,
"address": "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",
"name": "Dai",
"symbol": "DAI",
"decimals": 18,
"cgId": "dai",
"logoURI": "https://raw.githubusercontent.com/morph-l2/morph-list/main/tokenIcons/DAI.svg"
}
]
},
defaultPair: {
Base: {
Expand Down Expand Up @@ -538,6 +578,27 @@ module.exports = function buildList() {
logoURI: "https://ethereum-optimism.github.io/data/USDC/logo.png",
},
},
Morph: {
"base": {
"chainId": 2818,
"address": "0x5300000000000000000000000000000000000011",
"name": "Ether",
"symbol": "ETH",
"decimals": 18,
"cgId": "ethereum",
"logoURI": "https://s2.coinmarketcap.com/static/img/coins/128x128/1027.png"
},
"quote": {
"chainId": 2818,
"address": "0xc7D67A9cBB121b3b0b9c053DD9f469523243379A",
"name": "Tether USD",
"symbol": "USDT",
"decimals": 18,
"cgId": "tether",
"logoURI": "https://raw.githubusercontent.com/morph-l2/morph-list/main/tokenIcons/USDT.svg"
},
"listing_price": 3347.96
},
},
scannerLink: {
Base: "https://basescan.org/",
Expand All @@ -552,6 +613,7 @@ module.exports = function buildList() {
"Story Public Testnet": "https://testnet.storyscan.xyz/",
"Story Odyssey Testnet":
"https://odyssey-testnet-explorer.storyscan.xyz/",
Morph: "https://explorer.morphl2.io/",
},
matchingEngine: {
Base: {
Expand Down Expand Up @@ -598,6 +660,10 @@ module.exports = function buildList() {
address: "0x8c1F7817657aAe22E22ce84d552fE0C01bD8A254",
startBlock: 440605,
},
"Morph": {
address: "0xd7ABA1cbAd246249be6a0de9a449FB5EDEFf1E47",
startBlock: 556889,
},
},
tags: {},
logoURI: "https://avatars.githubusercontent.com/u/73440097?s=200&v=4",
Expand All @@ -614,6 +680,7 @@ module.exports = function buildList() {
...taiko,
...storyIliad,
...storyOdyssey,
...morph,
]
// sort them by symbol for easy readability
.sort((t1, t2) => {
Expand All @@ -634,6 +701,7 @@ module.exports = function buildList() {
...taikoPairs,
...storyIliadPairs,
...storyOdysseyPairs,
...morphPairs,
],
};
return bridgeUtils.chainify(l1List);
Expand Down
32 changes: 31 additions & 1 deletion src/const/customChains.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,34 @@ const StoryOdyssey = defineChain({
},
});

module.exports = { StoryOdyssey, StoryIliad };
const Morph = defineChain({
id: 2818,
name: "Morph",
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
rpcUrls: {
public: { http: ["https://rpc.morphl2.io"] },
default: {
http: ["https://rpc.morphl2.io"],
},
},
blockExplorers: {
etherscan: {
name: "Morph Scan",
url: "https://explorer.morphl2.io",
},
default: {
name: "Morph Scan",
url: "https://explorer.morphl2.io",
},
},
testnet: false,
contracts: {
multicall3: {
address: "0x35f965903A85e7528437C3Ce0b4bdfbc4E5Fc27c",
blockCreated:
52602,
},
},
})

module.exports = { StoryOdyssey, StoryIliad, Morph };
1 change: 1 addition & 0 deletions src/const/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const ChainIds = {
"Taiko Mainnet": 167000,
"Story Public Testnet": 1513,
"Story Odyssey Testnet": 1516,
"Morph Mainnet": 2818,
};

module.exports = { ChainIds }
143 changes: 143 additions & 0 deletions src/pairs/morph.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
[
{
"base": {
"chainId": 2818,
"address": "0x5300000000000000000000000000000000000011",
"name": "Ether",
"symbol": "ETH",
"decimals": 18,
"cgId": "ethereum",
"logoURI": "https://s2.coinmarketcap.com/static/img/coins/128x128/1027.png"
},
"quote": {
"chainId": 2818,
"address": "0xc7D67A9cBB121b3b0b9c053DD9f469523243379A",
"name": "Tether USD",
"symbol": "USDT",
"decimals": 18,
"cgId": "tether",
"logoURI": "https://raw.githubusercontent.com/morph-l2/morph-list/main/tokenIcons/USDT.svg"
},
"listing_price": 3347.96
},
{
"base": {
"chainId": 2818,
"address": "0x803DcE4D3f4Ae2e17AF6C51343040dEe320C149D",
"symbol": "BTC",
"name": "Wrapped Bitcoin",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WBTC.png"
},
"quote": {
"chainId": 2818,
"address": "0x5300000000000000000000000000000000000011",
"name": "Ether",
"symbol": "ETH",
"decimals": 18,
"cgId": "ethereum",
"logoURI": "https://s2.coinmarketcap.com/static/img/coins/128x128/1027.png"
},
"listing_price": 29.18
},
{
"base": {
"chainId": 2818,
"address": "0x803DcE4D3f4Ae2e17AF6C51343040dEe320C149D",
"symbol": "BTC",
"name": "Wrapped Bitcoin",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WBTC.png"
},
"quote": {
"chainId": 2818,
"address": "0xe34c91815d7fc18A9e2148bcD4241d0a5848b693",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"cgId": "usd-coin",
"logoURI": "https://raw.githubusercontent.com/morph-l2/morph-list/main/tokenIcons/USDC.svg"
},
"listing_price": 97736.38
},
{
"base": {
"chainId": 2818,
"address": "0x803DcE4D3f4Ae2e17AF6C51343040dEe320C149D",
"symbol": "BTC",
"name": "Wrapped Bitcoin",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/ubeswap/default-token-list/master/assets/asset_WBTC.png"
},
"quote": {
"chainId": 2818,
"address": "0xc7D67A9cBB121b3b0b9c053DD9f469523243379A",
"name": "Tether USD",
"symbol": "USDT",
"decimals": 18,
"cgId": "tether",
"logoURI": "https://raw.githubusercontent.com/morph-l2/morph-list/main/tokenIcons/USDT.svg"
},
"listing_price": 97736.38
},
{
"base": {
"chainId": 2818,
"address": "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",
"symbol": "DAI",
"name": "Dai",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/morph-l2/morph-list/main/tokenIcons/DAI.svg"
},
"quote": {
"chainId": 2818,
"address": "0x5300000000000000000000000000000000000011",
"name": "Ether",
"symbol": "ETH",
"decimals": 18,
"cgId": "ethereum",
"logoURI": "https://s2.coinmarketcap.com/static/img/coins/128x128/1027.png"
},
"listing_price": 0.00030
},
{
"base": {
"chainId": 2818,
"address": "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",
"symbol": "DAI",
"name": "Dai",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/morph-l2/morph-list/main/tokenIcons/DAI.svg"
},
"quote": {
"chainId": 2818,
"address": "0xe34c91815d7fc18A9e2148bcD4241d0a5848b693",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"cgId": "usd-coin",
"logoURI": "https://raw.githubusercontent.com/morph-l2/morph-list/main/tokenIcons/USDC.svg"
},
"listing_price": 1
},
{
"base": {
"chainId": 2818,
"address": "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",
"symbol": "DAI",
"name": "Dai",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/morph-l2/morph-list/main/tokenIcons/DAI.svg"
},
"quote": {
"chainId": 2818,
"address": "0xc7D67A9cBB121b3b0b9c053DD9f469523243379A",
"name": "Tether USD",
"symbol": "USDT",
"decimals": 18,
"cgId": "tether",
"logoURI": "https://raw.githubusercontent.com/morph-l2/morph-list/main/tokenIcons/USDT.svg"
},
"listing_price": 1
}
]
16 changes: 8 additions & 8 deletions src/pairs/story_odyssey.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"symbol": "WBTC",
"name": "Wrapped Bitcoin",
"decimals": 8,
"logoURI": "https://app.piperx.xyz/assets/icon_Story-0eb3cd42.png"
"logoURI": "https://assets.coingecko.com/coins/images/7598/standard/wrapped_bitcoin_wbtc.png?1696507857"
},
"quote": {
"chainId": 1516,
Expand All @@ -44,7 +44,7 @@
"symbol": "WBTC",
"name": "Wrapped Bitcoin",
"decimals": 8,
"logoURI": "https://app.piperx.xyz/assets/icon_Story-0eb3cd42.png"
"logoURI": "https://assets.coingecko.com/coins/images/7598/standard/wrapped_bitcoin_wbtc.png?1696507857"
},
"quote": {
"chainId": 1516,
Expand All @@ -63,15 +63,15 @@
"symbol": "WBTC",
"name": "Wrapped Bitcoin",
"decimals": 8,
"logoURI": "https://app.piperx.xyz/assets/icon_Story-0eb3cd42.png"
"logoURI": "https://assets.coingecko.com/coins/images/7598/standard/wrapped_bitcoin_wbtc.png?1696507857"
},
"quote": {
"address": "0x02F75bdBb4732cc6419aC15EeBeE6BCee66e826f",
"chainId": 1516,
"name": "Tether USD",
"symbol": "USDT",
"decimals": 6,
"logoURI": "https://app.piperx.xyz/assets/icon_Story-0eb3cd42.png"
"logoURI": "https://assets.coingecko.com/coins/images/325/standard/Tether.png?1696501661"
},
"listing_price": 7850.453
},
Expand All @@ -82,7 +82,7 @@
"symbol": "WETH",
"name": "Wrapped Ether",
"decimals": 18,
"logoURI": "https://app.piperx.xyz/assets/icon_Story-0eb3cd42.png"
"logoURI": "https://assets.coingecko.com/coins/images/2518/standard/weth.png?1696503332"
},
"quote": {
"chainId": 1516,
Expand All @@ -101,7 +101,7 @@
"symbol": "WETH",
"name": "Wrapped Ether",
"decimals": 18,
"logoURI": "https://app.piperx.xyz/assets/icon_Story-0eb3cd42.png"
"logoURI": "https://assets.coingecko.com/coins/images/2518/standard/weth.png?1696503332"
},
"quote": {
"chainId": 1516,
Expand All @@ -120,15 +120,15 @@
"symbol": "WETH",
"name": "Wrapped Ether",
"decimals": 18,
"logoURI": "https://app.piperx.xyz/assets/icon_Story-0eb3cd42.png"
"logoURI": "https://assets.coingecko.com/coins/images/2518/standard/weth.png?1696503332"
},
"quote": {
"address": "0x02F75bdBb4732cc6419aC15EeBeE6BCee66e826f",
"chainId": 1516,
"name": "Tether USD",
"symbol": "USDT",
"decimals": 6,
"logoURI": "https://app.piperx.xyz/assets/icon_Story-0eb3cd42.png"
"logoURI": "https://assets.coingecko.com/coins/images/325/standard/Tether.png?1696501661"
},
"listing_price": 957.9362
}
Expand Down
Loading

0 comments on commit a04989b

Please sign in to comment.