From d61f001d62614698b5bb9ec81e5510808f25e538 Mon Sep 17 00:00:00 2001 From: Fabian Scherer <48454910+fabianschu@users.noreply.github.com> Date: Sat, 20 Jan 2024 22:13:59 +0700 Subject: [PATCH] chore: adds celo config --- src/constants/pool-lists/csp-issue.ts | 1 + src/lib/config/celo/contracts.ts | 31 ++++++++++++ src/lib/config/celo/index.ts | 70 +++++++++++++++++++++++++++ src/lib/config/celo/keys.ts | 7 +++ src/lib/config/celo/pools.ts | 55 +++++++++++++++++++++ src/lib/config/celo/rateProviders.ts | 10 ++++ src/lib/config/celo/tokenlists.ts | 12 +++++ src/lib/config/celo/tokens.ts | 19 ++++++++ src/lib/config/index.ts | 2 + src/lib/config/types.ts | 1 + 10 files changed, 208 insertions(+) create mode 100644 src/lib/config/celo/contracts.ts create mode 100644 src/lib/config/celo/index.ts create mode 100644 src/lib/config/celo/keys.ts create mode 100644 src/lib/config/celo/pools.ts create mode 100644 src/lib/config/celo/rateProviders.ts create mode 100644 src/lib/config/celo/tokenlists.ts create mode 100644 src/lib/config/celo/tokens.ts diff --git a/src/constants/pool-lists/csp-issue.ts b/src/constants/pool-lists/csp-issue.ts index 06c5e855f..44f6a44d1 100644 --- a/src/constants/pool-lists/csp-issue.ts +++ b/src/constants/pool-lists/csp-issue.ts @@ -27,6 +27,7 @@ export const NO_RECOVERY_EXIT_POOL_IDS: Record = { [Network.GOERLI]: [], [Network.OPTIMISM]: [], [Network.ALFAJORES]: [], + [Network.CELO]: [], }; export const CSP_ISSUE_POOL_IDS: Record = { diff --git a/src/lib/config/celo/contracts.ts b/src/lib/config/celo/contracts.ts new file mode 100644 index 000000000..5ce27c9c2 --- /dev/null +++ b/src/lib/config/celo/contracts.ts @@ -0,0 +1,31 @@ +import { Contracts } from '../types'; +import * as celo from '@/assets/data/contracts/alfajores.json'; + +const contracts: Contracts = { + merkleRedeem: '', + merkleOrchard: '', + merkleOrchardV2: '', + multicall: celo.Multicall, + authorizer: celo.Authorizer, + vault: celo.Vault, + weightedPoolFactory: celo.WeightedPoolFactory, + stablePoolFactory: '', + lidoRelayer: '', + balancerHelpers: celo.BalancerHelpers, + batchRelayer: '', + gaugeFactory: '', + balancerMinter: '', + gaugeController: '', + tokenAdmin: '', + veBAL: '', + veDelegationProxy: '', + veBALHelpers: '', + feeDistributor: '', + feeDistributorDeprecated: '', + faucet: '', + gaugeRewardsHelper: '', + gaugeWorkingBalanceHelper: '', + gaugeCheckpointer: '', +}; + +export default contracts; diff --git a/src/lib/config/celo/index.ts b/src/lib/config/celo/index.ts new file mode 100644 index 000000000..783ef583b --- /dev/null +++ b/src/lib/config/celo/index.ts @@ -0,0 +1,70 @@ +import { Config } from '../types'; +import keys from './keys'; +import contracts from './contracts'; +import pools from './pools'; +import tokenlists from './tokenlists'; +import tokens from './tokens'; +import rateProviders from './rateProviders'; + +const config: Config = { + key: '42220', + chainId: 42220, + chainName: 'Celo', + name: 'Celo', + shortName: 'Celo', + slug: 'celo', + network: 'celo', + unknown: false, + visibleInUI: true, + testNetwork: false, + rpc: `https://celo.infura.io/v3/${keys.infura}`, + ws: ``, + publicRpc: 'https://forno.celo.org', + explorer: 'https://celoscan.io/', + explorerName: 'Celoscan', + subgraph: + 'https://api.studio.thegraph.com/query/63886/refi-celo/version/latest', + balancerApi: '', + poolsUrlV2: '', + subgraphs: { + main: [ + 'https://api.studio.thegraph.com/query/63886/refi-celo/version/latest', + ], + aave: '', + gauge: '', + blocks: '', + }, + bridgeUrl: 'https://optics.app/', + supportsEIP1559: false, + supportsElementPools: false, + blockTime: 5, + nativeAsset: { + name: 'Celo', + address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', + symbol: 'CELO', + decimals: 18, + deeplinkId: 'ether', + logoURI: 'tokens/celo.png', + minTransactionBuffer: '0.05', + }, + thirdParty: { + coingecko: { + nativeAssetId: 'celo', + platformId: 'celo', + }, + }, + addresses: { + ...contracts, + }, + pools, + tokens, + keys, + gauges: { + type: 3, + weight: 0, + }, + tokenlists, + rateProviders, +}; + +export default config; diff --git a/src/lib/config/celo/keys.ts b/src/lib/config/celo/keys.ts new file mode 100644 index 000000000..976fb2e5e --- /dev/null +++ b/src/lib/config/celo/keys.ts @@ -0,0 +1,7 @@ +import { Keys } from '../types'; + +const keys: Keys = { + infura: 'dc513f59a9df4edca4329dc46c8295b6', +}; + +export default keys; diff --git a/src/lib/config/celo/pools.ts b/src/lib/config/celo/pools.ts new file mode 100644 index 000000000..bf566aa4a --- /dev/null +++ b/src/lib/config/celo/pools.ts @@ -0,0 +1,55 @@ +import { CSP_ISSUE_POOL_IDS } from '@/constants/pool-lists/csp-issue'; +import { Pools } from '@/types/pools'; +import { Network } from '../types'; + +const pools: Pools = { + IdsMap: {}, + Pagination: { + PerPage: 10, + PerPool: 10, + PerPoolInitial: 5, + }, + BoostsEnabled: false, + DelegateOwner: '0xba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b', + ZeroAddress: '0x0000000000000000000000000000000000000000', + DynamicFees: { + Gauntlet: [], + }, + BlockList: [''], + IncludedPoolTypes: ['Weighted'], + Stable: { + AllowList: [], + }, + Investment: { + AllowList: [], + }, + Weighted: { + // Only effective after given timestamp here: usePool.ts#createdAfterTimestamp + // see useDisabledJoinPool.ts#nonAllowedWeightedPoolAfterTimestamp for logic. + AllowList: [], + }, + Factories: { + '0xEB1055c017a1427726F01368C8247649c5A79bF9': 'weightedPool', // Weighted v4 + // '0x8ea89804145c007e7d226001a96955ad53836087': 'composableStablePool', // ComposableStable V4 + // '0x956ccab09898c0af2aca5e6c229c3ad4e93d9288': 'composableStablePool', + // '0x6b1da720be2d11d95177ccfc40a917c2688f396c': 'erc4626Linear', // ERC4626 LinearPool + // '0x5d56ea1b2595d2dbe4f5014b967c78ce75324f0c': 'gyroE', + }, + Stakable: { + VotingGaugePools: [], + AllowList: [], + }, + Metadata: {}, + Deep: [], + Deprecated: {}, + GaugeMigration: {}, + BoostedApr: [], + DisabledJoins: [...CSP_ISSUE_POOL_IDS[Network.ZKEVM]], + Risks: {}, + Issues: { + // [PoolWarning.CspPoolVulnWarning]: CSP_ISSUE_POOL_IDS[Network.ZKEVM], + }, + BrandedRedirect: {}, +}; + +export default pools; diff --git a/src/lib/config/celo/rateProviders.ts b/src/lib/config/celo/rateProviders.ts new file mode 100644 index 000000000..52b936a37 --- /dev/null +++ b/src/lib/config/celo/rateProviders.ts @@ -0,0 +1,10 @@ +import { convertKeysToLowerCase } from '@/lib/utils/objects'; +import { RateProviders } from '../types'; + +const rateProviders: RateProviders = { + '*': { + '0x0000000000000000000000000000000000000000': true, + }, +}; + +export default convertKeysToLowerCase(rateProviders); diff --git a/src/lib/config/celo/tokenlists.ts b/src/lib/config/celo/tokenlists.ts new file mode 100644 index 000000000..84523ea25 --- /dev/null +++ b/src/lib/config/celo/tokenlists.ts @@ -0,0 +1,12 @@ +import { TokenListURLMap } from '@/types/TokenList'; + +// TODO +const tokenlists: TokenListURLMap = { + Balancer: { + Allowlisted: + 'https://raw.githubusercontent.com/fabianschu/tokenlists/main/generated/balancer.tokenlist.json', + }, + External: [], +}; + +export default tokenlists; diff --git a/src/lib/config/celo/tokens.ts b/src/lib/config/celo/tokens.ts new file mode 100644 index 000000000..36ed3e191 --- /dev/null +++ b/src/lib/config/celo/tokens.ts @@ -0,0 +1,19 @@ +import { TokenConstants } from '../types'; + +const tokens: TokenConstants = { + Popular: { + Symbols: ['CELO', 'cUSD', 'cEUR'], + }, + InitialSwapTokens: { + input: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', + output: '0x765de816845861e75a25fca122bb6898b8b1282a', // cUSD + }, + Addresses: { + nativeAsset: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', + wNativeAsset: '0x471EcE3750Da237f93B8E339c536989b8978a438', // CELO + WETH: '0x66803FB87aBd4aaC3cbB3fAd7C3aa01f6F3FB207', + BAL: '', // TODO + }, +}; + +export default tokens; diff --git a/src/lib/config/index.ts b/src/lib/config/index.ts index dc2bb07a4..3531e4a7a 100644 --- a/src/lib/config/index.ts +++ b/src/lib/config/index.ts @@ -11,6 +11,7 @@ import polygon from './polygon'; import sepolia from './sepolia'; import zkevm from './zkevm'; import alfajores from './alfajores'; +import celo from './celo'; const config: Record = { [Network.MAINNET]: mainnet, @@ -24,6 +25,7 @@ const config: Record = { [Network.SEPOLIA]: sepolia, [Network.BASE]: base, [Network.ALFAJORES]: alfajores, + [Network.CELO]: celo, }; export default config; diff --git a/src/lib/config/types.ts b/src/lib/config/types.ts index 2acf4c7c3..cd73eb8fc 100644 --- a/src/lib/config/types.ts +++ b/src/lib/config/types.ts @@ -88,6 +88,7 @@ export enum Network { AVALANCHE = 43114, SEPOLIA = 11155111, ALFAJORES = 44787, + CELO = 42220, } export interface Config {