Skip to content

Commit

Permalink
add gnosis (#672)
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc authored Sep 12, 2024
1 parent 311400f commit cd40be9
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ DATABASE_URL=postgres://postgres:postgres@localhost:5432/grants_stack_indexer
#CELO_TESTNET_RPC_URL=
#LUKSO_MAINNET_RPC_URL=
#LUKSO_TESTNET_RPC_URL
# METIS_ANDROMEDA_RPC_URL
#METIS_ANDROMEDA_RPC_URL
#GNOSIS_RPC_URL

#COINGECKO_API_KEY=
#IPFS_GATEWAYs=[]
Expand Down
2 changes: 1 addition & 1 deletion fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ kill_timeout = "5s"
DEPLOYMENT_ENVIRONMENT = "production"
ENABLE_RESOURCE_MONITOR = "false"
ESTIMATES_LINEARQF_WORKER_POOL_SIZE = "10"
INDEXED_CHAINS = "mainnet,optimism,fantom,pgn-testnet,pgn-mainnet,arbitrum,polygon,sepolia,avalanche,avalanche-fuji,scroll,scroll-sepolia,base,zksync-era-mainnet,lukso-mainnet,lukso-testnet,celo-mainnet,celo-testnet,sei-mainnet,metisAndromeda"
INDEXED_CHAINS = "mainnet,optimism,fantom,pgn-testnet,pgn-mainnet,arbitrum,polygon,sepolia,avalanche,avalanche-fuji,scroll,scroll-sepolia,base,zksync-era-mainnet,lukso-mainnet,lukso-testnet,celo-mainnet,celo-testnet,sei-mainnet,metisAndromeda,gnosis"
LOG_LEVEL = "debug"
NODE_OPTIONS = "--max-old-space-size=4096"
PORT = "8080"
Expand Down
51 changes: 51 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type ChainId = number;
type CoingeckoSupportedChainId =
| 1
| 10
| 100
| 250
| 42161
| 43114
Expand Down Expand Up @@ -1765,6 +1766,56 @@ const CHAINS: Chain[] = [
},
],
},
{
id: 100,
name: "gnosis",
rpc: rpcUrl
.default("https://rpc.gnosischain.com")
.parse(process.env.GNOSIS_RPC_URL),
pricesFromTimestamp: Date.UTC(2024, 0, 1, 0, 0, 0),
tokens: [
{
code: "XDAI",
address: "0x0000000000000000000000000000000000000000",
decimals: 18,
priceSource: {
chainId: 100,
address: "0x0000000000000000000000000000000000000000",
},
},
{
code: "XDAI",
address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
decimals: 18,
priceSource: {
chainId: 100,
address: "0x0000000000000000000000000000000000000000",
},
},
{
code: "USDC",
address: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83",
decimals: 6,
priceSource: {
chainId: 100,
address: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83",
},
},
],
subscriptions: [
// Allo V2
{
contractName: "AlloV2/Registry/V1",
address: "0x4aacca72145e1df2aec137e1f3c5e3d75db8b5f3",
fromBlock: 35900000,
},
{
contractName: "AlloV2/Allo/V1",
address: "0x1133eA7Af70876e64665ecD07C0A0476d09465a1",
fromBlock: 35900000,
},
],
},
];

export const getDecimalsForToken = (
Expand Down
2 changes: 2 additions & 0 deletions src/prices/coinGecko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const platforms: { [key: number]: string } = {
42: "lukso",
42220: "celo",
1088: "metis",
100: "xdai",
};

const nativeTokens: { [key: number]: string } = {
Expand All @@ -29,6 +30,7 @@ const nativeTokens: { [key: number]: string } = {
42: "lukso-token",
42220: "celo",
1088: "metis-token",
100: "xdai",
};

type TimestampInMs = number;
Expand Down

0 comments on commit cd40be9

Please sign in to comment.