Skip to content
Open
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
8 changes: 6 additions & 2 deletions config/default.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export default {
aws: [
{
region: 'us-east-2',
region: 'us-west-2',
secretID: 'eco-solver-secrets-dev',
},
{
region: 'us-east-2',
region: 'us-west-2',
secretID: 'eco-solver-configs-dev',
},
],
Expand Down Expand Up @@ -82,6 +82,7 @@ export default {
proofs: {
storage_duration_seconds: 604800,
hyperlane_duration_seconds: 3600,
metalayer_duration_seconds: 3600,
},
},
liquidityManager: {
Expand All @@ -92,6 +93,9 @@ export default {
deficit: 0.2,
},
},
fulfillment: {
run: 'single',
},
externalAPIs: {},
logger: {
usePino: true,
Expand Down
85 changes: 52 additions & 33 deletions config/development.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,68 +28,87 @@ export default {
},
},
},
/*
if (id === "33111-pre") {
return {
// Prover: "0xac3f4357d650109a94c4a977f6c327b140cbac37";
IntentSource: "0xD7f316e387107b90dFBBDCb07bEC7280A729ce88",
Inbox: "0x04fA0CeB5eaAf33084DDd4A7cda74F01767B4507",
HyperProver: "0x3e27B444B5E543cbFF449115DE4a36705a891F82",
};
} else if (id === "3441006-pre") {
return {
IntentSource: "0x7e0400Eb1508f4c8A2C33a46c7Ce308C650ccDe6",
Inbox: "0xC8CFd1aA8153Ec5F41d8F6FBCf8ec4B1AD8b779c",
HyperProver: "0x7d89991BFF4B2665f7Ace724789Cf2ACBBF46A39", // this is the metalayerprover: "0xCd906dD3b534a7ab400F510f4F951ca07357a7Bc",
};
}
*/
intentSources: [
{
network: 'opt-sepolia',
chainID: 11155420,
network: 'Curtis',
chainID: 33111,
tokens: [
'0x5fd84259d66Cd46123540766Be93DFE6D43130D7', //usdc
'0x8327Db9040811545C13331A453aBe9C7AA1aCDf8',
'0x368d7C52B0F62228907C133204605a5B11A1dB6d',
'0x00D2d1162c689179e8bA7a3b936f80A010A0b5CF',
'0x3328C29843F7c7dfF7381aF54A03C7423431Eaa4',
'0xd3F4Bef596a04e2be4fbeB17Dd70f02F717c5a6c',
'0x93551e3F61F8E3EE73DDc096BddbC1ADc52f5A3a',
'0x804AAA73AA2732B2f84bB5E768Dc50003F0b3f78', //usdc
'0x8Cb9a6A8692D3379F237CDE946B69888462D3c77', //usdt
],
provers: ['0x9592E6bA1Cec5d85D0EeF477703814857acFa921'],
provers: ['0x3e27B444B5E543cbFF449115DE4a36705a891F82'],
},
{
network: 'base-sepolia',
chainID: 84532,
network: 'manta-sepolia',
chainID: 3441006,
tokens: [
'0xAb1D243b07e99C91dE9E4B80DFc2B07a8332A2f7', //usdc
'0x8bDa9F5C33FBCB04Ea176ea5Bc1f5102e934257f',
'0x93551e3F61F8E3EE73DDc096BddbC1ADc52f5A3a',
'0x6E4D0AEC0fd8081E1Fd1f17B9769600efC72B51c', //usdc
'0x1a8Eff33abcB8E7754daeA05582F4f7c93a9c75F', //usdt
],
provers: ['0x9592E6bA1Cec5d85D0EeF477703814857acFa921'],
provers: ['0x7d89991BFF4B2665f7Ace724789Cf2ACBBF46A39'],
},
],
solvers: {
//base sepolia
84532: {
33111: {
solverAddress: '0x04fA0CeB5eaAf33084DDd4A7cda74F01767B4507',
targets: {
//base sepolia USDC
'0xAb1D243b07e99C91dE9E4B80DFc2B07a8332A2f7': {
'0x804AAA73AA2732B2f84bB5E768Dc50003F0b3f78': {
contractType: 'erc20',
selectors: ['transfer(address,uint256)'],
minBalance: 1000,
targetBalance: 20000,
},
'0x8bDa9F5C33FBCB04Ea176ea5Bc1f5102e934257f': {
'0x8Cb9a6A8692D3379F237CDE946B69888462D3c77': {
contractType: 'erc20',
selectors: ['transfer(address,uint256)'],
minBalance: 1000,
targetBalance: 20000,
},
'0x93551e3F61F8E3EE73DDc096BddbC1ADc52f5A3a': {
},
network: 'Curtis',
chainID: 33111,
},
3441006: {
solverAddress: '0xC8CFd1aA8153Ec5F41d8F6FBCf8ec4B1AD8b779c',
targets: {
'0x6E4D0AEC0fd8081E1Fd1f17B9769600efC72B51c': {
contractType: 'erc20',
selectors: ['transfer(address,uint256)'],
minBalance: 1000,
targetBalance: 20000,
},
},
network: 'base-sepolia',
chainID: 84532,
},
//op sepolia
11155420: {
targets: {
//op sepolia USDC
'0x5fd84259d66Cd46123540766Be93DFE6D43130D7': {
'0x1a8Eff33abcB8E7754daeA05582F4f7c93a9c75F': {
contractType: 'erc20',
selectors: ['transfer(address,uint256)'],
minBalance: 1000,
targetBalance: 20000,
},
},
network: 'opt-sepolia',
chainID: 11155420,
network: 'manta-sepolia',
chainID: 3441006,
},
},
intentConfigs: {
proofs: {
storage_duration_seconds: 60,
hyperlane_duration_seconds: 120,
metalayer_duration_seconds: 180,
},
},
}
4 changes: 2 additions & 2 deletions config/preproduction.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export default {
aws: [
{
region: 'us-east-2',
region: 'us-west-2',
secretID: 'eco-solver-secrets-pre-prod',
},
{
region: 'us-east-2',
region: 'us-west-2',
secretID: 'eco-solver-configs-pre-prod',
},
],
Expand Down
4 changes: 2 additions & 2 deletions config/production.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export default {
aws: [
{
region: 'us-east-2',
region: 'us-west-2',
secretID: 'eco-solver-secrets-prod',
},
{
region: 'us-east-2',
region: 'us-west-2',
secretID: 'eco-solver-configs-prod',
},
],
Expand Down
4 changes: 2 additions & 2 deletions config/staging.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export default {
aws: [
{
region: 'us-east-2',
region: 'us-west-2',
secretID: 'eco-solver-secrets-staging',
},
{
region: 'us-east-2',
region: 'us-west-2',
secretID: 'eco-solver-configs-staging',
},
],
Expand Down
2 changes: 1 addition & 1 deletion config/test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
aws: {
region: 'test-us-east-2',
region: 'test-us-west-2',
secretID: 'test-eco-solver-secrets',
},
test: 'hi',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"lodash": "^4.17.21",
"mongoose": "^8.5.0",
"nestjs-pino": "^4.1.0",
"permissionless": "^0.2.11",
"permissionless": "^0.2.33",
"pino-http": "^10.2.0",
"redlock": "^5.0.0-beta.2",
"reflect-metadata": "^0.2.0",
Expand Down
5 changes: 2 additions & 3 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ProverModule } from './prover/prover.module'
import { HealthModule } from './health/health.module'
import { ProcessorModule } from './bullmq/processors/processor.module'
import { SolverModule } from './solver/solver.module'
import { FlagsModule } from './flags/flags.module'
//import { FlagsModule } from './flags/flags.module'
import { LiquidityManagerModule } from '@/liquidity-manager/liquidity-manager.module'
import { ApiModule } from '@/api/api.module'
import { WatchModule } from '@/watch/watch.module'
Expand All @@ -25,8 +25,7 @@ import { FeeModule } from '@/fee/fee.module'
BalanceModule,
ChainMonitorModule,
EcoConfigModule.withAWS(),
FeeModule,
FlagsModule,
// FlagsModule,
HealthModule,
IntentModule,
SignModule,
Expand Down
6 changes: 3 additions & 3 deletions src/balance/balance.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ export class BalanceService implements OnApplicationBootstrap {
const [balance = 0n, decimals = 0] = [results[index * 2], results[index * 2 + 1]]
//throw if we suddenly start supporting tokens with not 6 decimals
//audit conversion of validity to see its support
if ((decimals as number) != 6) {
throw EcoError.BalanceServiceInvalidDecimals(tokenAddress)
}
// if ((decimals as number) != 6) {
// throw EcoError.BalanceServiceInvalidDecimals(tokenAddress)
// }
tokenBalances[tokenAddress] = {
address: tokenAddress,
balance: balance as bigint,
Expand Down
19 changes: 19 additions & 0 deletions src/common/chains/definitions/curtis.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Chain } from 'viem'
import { curtis as vcurtis } from 'viem/chains'

export const curtis: Chain = {
...vcurtis,
rpcUrls: {
//...vcurtis.rpcUrls,
default: {
http: ['https://curtis.rpc.caldera.xyz/direct-http-01'],
},
},
contracts: {
...vcurtis.contracts,
multicall3: {
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
blockCreated: 7290821,
},
},
}
13 changes: 13 additions & 0 deletions src/common/chains/definitions/mantasepolia.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Chain } from 'viem'
import { mantaSepoliaTestnet as vmantaSepoliaTestnet } from 'viem/chains'

export const mantaSepoliaTestnet: Chain = {
...vmantaSepoliaTestnet,
rpcUrls: {
//...vmantaSepoliaTestnet.rpcUrls,
default: {
http: ['https://manta-sepolia.rpc.caldera.xyz/direct-http'],
},
},

}
31 changes: 31 additions & 0 deletions src/common/chains/definitions/zeriontestnet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Chain } from 'viem'

export const zerionTestnet: Chain = {

id: 4457845,
name: 'zerion testnet',
nativeCurrency: {
decimals: 18,
name: 'ETH',
symbol: 'ETH',
},
rpcUrls: {
default: {
http: ['https://zerion.calderachain.xyz/http'],
},
},
blockExplorers: {
default: {
name: 'zerion Testnet Explorer',
url: 'https://zero-explorer.vercel.app/',
apiUrl: 'https://zero-explorer.vercel.app//api',
},
},
// contracts: {
// multicall3: {
// address: '0xca54918f7B525C8df894668846506767412b53E3',
// blockCreated: 479584,
// },
// },
testnet: true,
}
6 changes: 6 additions & 0 deletions src/common/chains/supported.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { base, baseSepolia } from './definitions/base'
import { arbitrum } from './definitions/arbitrum'
import { mantle } from './definitions/mantle'
import { polygon } from './definitions/polygon'
import { curtis } from './definitions/curtis'
import { mantaSepoliaTestnet } from './definitions/mantasepolia'
import { zerionTestnet } from './definitions/zeriontestnet'
import { ethereum, sepolia } from './definitions/ethereum'

/**
Expand All @@ -21,6 +24,9 @@ export const ChainsSupported: Chain[] = [
arbitrum,
mantle,
polygon,
curtis,
mantaSepoliaTestnet,
zerionTestnet,
ethereum,
sepolia,
]
4 changes: 3 additions & 1 deletion src/contracts/prover.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
export const PROOF_STORAGE = 0
export const PROOF_HYPERLANE = 1
export const PROOF_METALAYER = 2

export type ProofType = typeof PROOF_STORAGE | typeof PROOF_HYPERLANE
export type ProofType = typeof PROOF_STORAGE | typeof PROOF_HYPERLANE | typeof PROOF_METALAYER

export const Proofs: Record<string, ProofType> = {
Storage: PROOF_STORAGE,
Hyperlane: PROOF_HYPERLANE,
Metalayer: PROOF_METALAYER,
}
6 changes: 3 additions & 3 deletions src/eco-configs/eco-config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ export class EcoConfigService implements OnModuleInit {
}

// Get the launch darkly configs
getLaunchDarkly(): EcoConfigType['launchDarkly'] {
return this.get('launchDarkly')
}
// getLaunchDarkly(): EcoConfigType['launchDarkly'] {
// return this.get('launchDarkly')
// }

getDatabaseConfig(): EcoConfigType['database'] {
return this.get('database')
Expand Down
13 changes: 7 additions & 6 deletions src/eco-configs/eco-config.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as Redis from 'ioredis'
import { Settings } from 'redlock'
import { JobsOptions, RepeatOptions } from 'bullmq'
import { Hex } from 'viem'
import { LDOptions } from '@launchdarkly/node-server-sdk'
//import { LDOptions } from '@launchdarkly/node-server-sdk'
import { CacheModuleOptions } from '@nestjs/cache-manager'

// The config type that we store in json
Expand All @@ -19,7 +19,7 @@ export type EcoConfigType = {
intentConfigs: IntentConfig
alchemy: AlchemyConfigType
cache: CacheModuleOptions
launchDarkly: LaunchDarklyConfig
//launchDarkly: LaunchDarklyConfig
eth: {
privateKey: string
simpleAccount: {
Expand Down Expand Up @@ -68,10 +68,10 @@ export type EcoConfigKeys = keyof EcoConfigType
/**
* The config type for the launch darkly feature flagging service
*/
export type LaunchDarklyConfig = {
apiKey: string
options?: LDOptions
}
// export type LaunchDarklyConfig = {
// apiKey: string
// options?: LDOptions
// }

/**
* The configs for the fulfillment params
Expand Down Expand Up @@ -122,6 +122,7 @@ export type IntentConfig = {
proofs: {
storage_duration_seconds: number
hyperlane_duration_seconds: number
metalayer_duration_seconds: number
}
}

Expand Down
Loading