Skip to content

Commit

Permalink
add story iliad
Browse files Browse the repository at this point in the history
  • Loading branch information
hskang9 committed Sep 2, 2024
1 parent 0c2f9ca commit 8cb2d6f
Show file tree
Hide file tree
Showing 8 changed files with 258 additions and 7 deletions.
Binary file added assets/story_iliad/IP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions src/buildList.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const mode = require("./tokens/mode.json");
const scroll = require("./tokens/scroll.json");
const neon = require("./tokens/neon.json");
const taiko = require("./tokens/taiko.json");
const storyIliad = require("./tokens/story_iliad.json");

// pairs
const basePairs = require("./pairs/base.json");
Expand All @@ -19,6 +20,7 @@ const fraxtalPairs = require("./pairs/fraxtal.json");
const scrollPairs = require("./pairs/scroll.json");
const neonPairs = require("./pairs/neon.json");
const taikoPairs = require("./pairs/taiko.json");
const storyIliadPairs = require("./pairs/story_iliad.json");

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

Expand Down Expand Up @@ -116,6 +118,14 @@ module.exports = function buildList() {
logoURI:
"https://assets.coingecko.com/coins/images/279/standard/ethereum.png?1696501628",
},
"Story Public Testnet": {
"chainId": 1513,
"address": "0x6e990040Fd9b06F98eFb62A147201696941680b5",
"name": "IP",
"symbol": "IP",
"decimals": 18,
"logoURI": "https://app.piperx.xyz/assets/icon_Story-0eb3cd42.png"
},
},
defaultPair: {
Base: {
Expand Down Expand Up @@ -285,6 +295,24 @@ module.exports = function buildList() {
"https://assets.coingecko.com/coins/images/9956/standard/Badge_Dai.png?1696509996",
},
},
"Story Public Testnet": {
"base": {
"chainId": 1513,
"address": "0x6e990040Fd9b06F98eFb62A147201696941680b5",
"name": "IP",
"symbol": "IP",
"decimals": 18,
"logoURI": "https://app.piperx.xyz/assets/icon_Story-0eb3cd42.png"
},
"quote": {
"chainId": 1513,
"address": "0x700722D24f9256Be288f56449E8AB1D27C4a70ca",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png"
}
}
},
scannerLink: {
Base: "https://basescan.org/",
Expand All @@ -296,6 +324,7 @@ module.exports = function buildList() {
Scroll: "https://scrollscan.com/",
"Neon EVM MainNet": "https://neonscan.org/",
"Taiko Mainnet": "https://taikoscan.io/",
"Story Public Testnet": "https://testnet.storyrpc.io/",
},
matchingEngine: {
Base: {
Expand Down Expand Up @@ -334,6 +363,10 @@ module.exports = function buildList() {
address: "0xd7ABA1cbAd246249be6a0de9a449FB5EDEFf1E47",
startBlock: 342912,
},
"Story Public Testnet": {
address: "0xd7ABA1cbAd246249be6a0de9a449FB5EDEFf1E47",
startBlock: 217636,
}
},
stndxp: {
Base: {
Expand Down Expand Up @@ -372,6 +405,10 @@ module.exports = function buildList() {
address: "0xEA98008F20e06636470b6a3C7ddA9caE63B668EC",
startBlock: 5389919,
},
"Story Public Testnet": {
address: "0xEA98008F20e06636470b6a3C7ddA9caE63B668EC",
startBlock: 5389919,
},
},
tags: {},
logoURI: "https://avatars.githubusercontent.com/u/73440097?s=200&v=4",
Expand All @@ -386,6 +423,7 @@ module.exports = function buildList() {
...scrollPairs,
...neonPairs,
...taikoPairs,
...storyIliadPairs
],
tokens: [
...base,
Expand All @@ -397,6 +435,7 @@ module.exports = function buildList() {
...scroll,
...neon,
...taiko,
...storyIliad,
]
// sort them by symbol for easy readability
.sort((t1, t2) => {
Expand Down
33 changes: 33 additions & 0 deletions src/const/customChains.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

const { defineChain } = require("viem");

const StoryIliad = defineChain({
id: 1513,
name: "Story Public Testnet",
nativeCurrency: { name: "IP", symbol: "IP", decimals: 18 },
rpcUrls: {
public: { http: ["https://testnet.storyrpc.io/"] },
default: {
http: ["https://testnet.storyrpc.io/"],
},
},
blockExplorers: {
etherscan: {
name: "Story Testnet Scan",
url: "https://testnet.storyscan.xyz",
},
default: {
name: "Story Testnet Scan",
url: "https://testnet.storyscan.xyz",
},
},
testnet: true,
contracts: {
multicall3: {
address: "0xcA11bde05977b3631167028862bE2a173976CA11",
blockCreated: 1566,
},
},
});

module.exports = { StoryIliad }
3 changes: 2 additions & 1 deletion src/const/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const ChainIds = {
"Kroma": 255,
"Morph Holesky": 2810,
"Scroll": 534352,
"Taiko Mainnet": 167000
"Taiko Mainnet": 167000,
"Story Public Testnet": 1513,
};

module.exports = { ChainIds }
135 changes: 135 additions & 0 deletions src/pairs/story_iliad.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
[
{
"base": {
"chainId": 1513,
"address": "0x6e990040Fd9b06F98eFb62A147201696941680b5",
"name": "IP",
"symbol": "IP",
"decimals": 18,
"logoURI": "https://app.piperx.xyz/assets/icon_Story-0eb3cd42.png"
},
"quote": {
"chainId": 1513,
"address": "0x700722D24f9256Be288f56449E8AB1D27C4a70ca",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png"
},
"listing_price": 10
},
{
"base": {
"chainId": 1513,
"address": "0x153B112138C6dE2CAD16D66B4B6448B7b88CAEF3",
"symbol": "WBTC",
"name": "Wrapped Bitcoin",
"decimals": 8,
"logoURI": "https://s2.coinmarketcap.com/static/img/coins/64x64/3717.png"
},
"quote": {
"chainId": 1513,
"address": "0x6e990040Fd9b06F98eFb62A147201696941680b5",
"name": "IP",
"symbol": "IP",
"decimals": 18,
"logoURI": "https://app.piperx.xyz/assets/icon_Story-0eb3cd42.png"
},
"listing_price": 0.00017125
},
{
"base": {
"chainId": 1513,
"address": "0x153B112138C6dE2CAD16D66B4B6448B7b88CAEF3",
"symbol": "WBTC",
"name": "Wrapped Bitcoin",
"decimals": 8,
"logoURI": "https://s2.coinmarketcap.com/static/img/coins/64x64/3717.png"
},
"quote": {
"chainId": 1513,
"address": "0x700722D24f9256Be288f56449E8AB1D27C4a70ca",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png"
},
"listing_price": 58388.62
},
{
"base": {
"chainId": 1513,
"address": "0x153B112138C6dE2CAD16D66B4B6448B7b88CAEF3",
"symbol": "WBTC",
"name": "Wrapped Bitcoin",
"decimals": 8,
"logoURI": "https://s2.coinmarketcap.com/static/img/coins/64x64/3717.png"
},
"quote": {
"chainId": 1513,
"address": "0x8812d810EA7CC4e1c3FB45cef19D6a7ECBf2D85D",
"name": "Tether USD",
"symbol": "USDT",
"decimals": 6,
"logoURI": "https://ethereum-optimism.github.io/data/USDT/logo.png"
},
"listing_price": 58388.62
},
{
"base": {
"chainId": 1513,
"address": "0x968B9a5603ddEb2A78Aa08182BC44Ece1D9E5bf0",
"symbol": "WETH",
"name": "Wrapped Ether",
"decimals": 18,
"logoURI": "https://ethereum-optimism.github.io/data/WETH/logo.png"
},
"quote": {
"chainId": 1513,
"address": "0x6e990040Fd9b06F98eFb62A147201696941680b5",
"name": "IP",
"symbol": "IP",
"decimals": 18,
"logoURI": "https://app.piperx.xyz/assets/icon_Story-0eb3cd42.png"
},
"listing_price": 252.416
},
{
"base": {
"chainId": 1513,
"address": "0x968B9a5603ddEb2A78Aa08182BC44Ece1D9E5bf0",
"symbol": "WETH",
"name": "Wrapped Ether",
"decimals": 18,
"logoURI": "https://ethereum-optimism.github.io/data/WETH/logo.png"
},
"quote": {
"chainId": 1513,
"address": "0x700722D24f9256Be288f56449E8AB1D27C4a70ca",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png"
},
"listing_price": 2524.16
},
{
"base": {
"chainId": 1513,
"address": "0x968B9a5603ddEb2A78Aa08182BC44Ece1D9E5bf0",
"symbol": "WETH",
"name": "Wrapped Ether",
"decimals": 18,
"logoURI": "https://ethereum-optimism.github.io/data/WETH/logo.png"
},
"quote": {
"chainId": 1513,
"address": "0x8812d810EA7CC4e1c3FB45cef19D6a7ECBf2D85D",
"name": "Tether USD",
"symbol": "USDT",
"decimals": 6,
"logoURI": "https://ethereum-optimism.github.io/data/USDT/logo.png"
},
"listing_price": 2524.16
}
]
9 changes: 5 additions & 4 deletions src/scripts/addPairs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { createWalletClient, http, parseUnits } = require("viem");
const { privateKeyToAccount } = require("viem/accounts");
const { StoryIliad } = require("../const/customChains");
const { base, kroma, morphHolesky, scroll, neonMainnet, taiko} = require("viem/chains");
//const { MatchingEngineABI } = require('./abis/matchingEngineAbi');
const { ChainIds } = require("../const");
Expand Down Expand Up @@ -68,18 +69,18 @@ async function main() {
const account = privateKeyToAccount(process.env.ADMIN_PRIVATE_KEY);
const walletClient = createWalletClient({
account,
chain: taiko,
transport: http(process.env.TAIKO_RPC),
chain: StoryIliad,
transport: http(process.env.STORY_RPC),
});

const abi = MatchingEngineABI;

const pairs = await getPairs("Taiko Mainnet");
const pairs = await getPairs("Story Public Testnet");

console.log("Pairs to add:", pairs.length);
// make contract call on each pair in the list
const matchingEngine =
defaultTokenList.matchingEngine["Taiko Mainnet"].address;
defaultTokenList.matchingEngine["Story Public Testnet"].address;

for (const pair of pairs) {
await addPair(pair, matchingEngine, walletClient, abi);
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/generateDefaultPairs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// replace path with path to desired network tokenlist
const tokenlist = require("../tokens/taiko.json");
const tokenlist = require("../tokens/story_iliad.json");

function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
Expand Down Expand Up @@ -28,7 +28,7 @@ async function getCoinPrice(coinId) {
async function adddefaultPairs() {
const stablecoin2 = tokenlist.find((token) => token.symbol === "USDT");
const stablecoin = tokenlist.find((token) => token.symbol === "USDC");
const eth = tokenlist.find((token) => token.symbol === "ETH");
const eth = tokenlist.find((token) => token.symbol === "IP");

const remainingTokens = tokenlist.filter(
(token) =>
Expand Down
42 changes: 42 additions & 0 deletions src/tokens/story_iliad.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"chainId": 1513,
"address": "0x6e990040Fd9b06F98eFb62A147201696941680b5",
"name": "IP",
"symbol": "IP",
"decimals": 18,
"logoURI": "https://app.piperx.xyz/assets/icon_Story-0eb3cd42.png"
},
{
"chainId": 1513,
"address": "0x700722D24f9256Be288f56449E8AB1D27C4a70ca",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png"
},
{
"chainId": 1513,
"address": "0x8812d810EA7CC4e1c3FB45cef19D6a7ECBf2D85D",
"name": "Tether USD",
"symbol": "USDT",
"decimals": 6,
"logoURI": "https://ethereum-optimism.github.io/data/USDT/logo.png"
},
{
"chainId": 1513,
"address": "0x153B112138C6dE2CAD16D66B4B6448B7b88CAEF3",
"name": "Wrapped Bitcoin",
"symbol": "WBTC",
"decimals": 8,
"logoURI": "https://s2.coinmarketcap.com/static/img/coins/64x64/3717.png"
},
{
"chainId": 1513,
"address": "0x968B9a5603ddEb2A78Aa08182BC44Ece1D9E5bf0",
"name": "Wrapped Ether",
"symbol": "WETH",
"decimals": 18,
"logoURI": "https://ethereum-optimism.github.io/data/WETH/logo.png"
}
]

0 comments on commit 8cb2d6f

Please sign in to comment.