diff --git a/config.yaml b/config.yaml index aca2db5f..85f6fe0a 100644 --- a/config.yaml +++ b/config.yaml @@ -80,27 +80,6 @@ contracts: events: - event: NotifyReward(address indexed from, uint256 amount) networks: - - id: 34443 # Mode - start_block: 0 - contracts: - - name: NFPM - address: - - 0x991d5546c4b442b4c5fdc4c8b8b8d131deb24702 - - name: PoolFactory - address: - - 0x31832f2a97Fd20664D76Cc421207669b55CE4BC0 - - name: CLFactory - address: - - 0x04625B046C69577EfC40e6c0Bb83CDBAfab5a55F - - name: Pool - address: - - name: SuperchainLeafVoter - address: - - 0x97cDBCe21B6fd0585d29E539B1B99dAd328a1123 - - name: VotingReward - address: - - name: CLPool - address: - id: 10 # Optimism start_block: 0 contracts: @@ -156,6 +135,48 @@ networks: address: - name: CLPool address: +- id: 1863 # Soneium + start_block: 0 + contracts: + - name: NFPM + address: + - 0x991d5546c4b442b4c5fdc4c8b8b8d131deb24702 + - name: PoolFactory + address: + - 0x31832f2a97Fd20664D76Cc421207669b55CE4BC0 + - name: CLFactory + address: + - 0x04625B046C69577EfC40e6c0Bb83CDBAfab5a55F + - name: Pool + address: + - name: SuperchainLeafVoter + address: + - 0x97cDBCe21B6fd0585d29E539B1B99dAd328a1123 + - name: VotingReward + address: + - name: CLPool + address: + - id: 34443 # Mode + start_block: 0 + contracts: + - name: NFPM + address: + - 0x991d5546c4b442b4c5fdc4c8b8b8d131deb24702 + - name: PoolFactory + address: + - 0x31832f2a97Fd20664D76Cc421207669b55CE4BC0 + - name: CLFactory + address: + - 0x04625B046C69577EfC40e6c0Bb83CDBAfab5a55F + - name: Pool + address: + - name: SuperchainLeafVoter + address: + - 0x97cDBCe21B6fd0585d29E539B1B99dAd328a1123 + - name: VotingReward + address: + - name: CLPool + address: - id: 1135 # Lisk start_block: 0 contracts: diff --git a/src/Constants.ts b/src/Constants.ts index 3740534a..7f913cbf 100644 --- a/src/Constants.ts +++ b/src/Constants.ts @@ -1,6 +1,6 @@ import dotenv from "dotenv"; import { Web3 } from "web3"; -import { optimism, base, lisk, mode, fraxtal } from 'viem/chains'; +import { optimism, base, lisk, mode, fraxtal, soneium } from 'viem/chains'; import { createPublicClient, http, PublicClient } from 'viem'; import PriceConnectors from "./constants/price_connectors.json"; @@ -35,6 +35,9 @@ export const LISK_PRICE_CONNECTORS: PriceConnector[] = export const FRAXTAL_PRICE_CONNECTORS: PriceConnector[] = PriceConnectors.fraxtal as PriceConnector[]; +export const SONEIUM_PRICE_CONNECTORS: PriceConnector[] = + PriceConnectors.soneium as PriceConnector[]; + export const toChecksumAddress = (address: string) => Web3.utils.toChecksumAddress(address); @@ -153,6 +156,30 @@ const MODE_CONSTANTS: chainConstants = { }) as PublicClient, }; +// Constants for Soneium +const SONEIUM_CONSTANTS: chainConstants = { + weth: "0x4200000000000000000000000000000000000006", + usdc: "0xbA9986D2381edf1DA03B0B9c1f8b00dc4AacC369", + oracle: { + getAddress: (blockNumber: number) => { + return "0xE50621a0527A43534D565B67D64be7C79807F269"; + }, + startBlock: 0, // TODO: Get start block + updateDelta: 60 * 60, // 1 hour + priceConnectors: SONEIUM_PRICE_CONNECTORS, + }, + rewardToken: (blockNumber: number) => + "0x7f9AdFbd38b669F03d1d11000Bc76b9AaEA28A81", + eth_client: createPublicClient({ + chain: soneium, + transport: http(process.env.ENVIO_SONEIUM_RPC_URL || "https://rpc.soneium.com", { + retryCount: 10, + retryDelay: 1000, + }), + }) as PublicClient, +}; + + // Constants for Fraxtal const FRAXTAL_CONSTANTS: chainConstants = { weth: "0xFC00000000000000000000000000000000000006", diff --git a/src/constants/price_connectors.json b/src/constants/price_connectors.json index 3d4c158d..6f59bc9d 100644 --- a/src/constants/price_connectors.json +++ b/src/constants/price_connectors.json @@ -32,5 +32,7 @@ ], "fraxtal": [ {"address" :"0xfc00000000000000000000000000000000000005", "createdBlock": 0 } + ], + "soneium": [ ] } \ No newline at end of file