Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 42 additions & 21 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
29 changes: 28 additions & 1 deletion src/Constants.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/constants/price_connectors.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,7 @@
],
"fraxtal": [
{"address" :"0xfc00000000000000000000000000000000000005", "createdBlock": 0 }
],
"soneium": [
]
}