Skip to content

Commit

Permalink
chore: adds celo config
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianschu committed Jan 20, 2024
1 parent 96c2f03 commit d61f001
Show file tree
Hide file tree
Showing 10 changed files with 208 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/constants/pool-lists/csp-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const NO_RECOVERY_EXIT_POOL_IDS: Record<Network, string[]> = {
[Network.GOERLI]: [],
[Network.OPTIMISM]: [],
[Network.ALFAJORES]: [],
[Network.CELO]: [],
};

export const CSP_ISSUE_POOL_IDS: Record<Network, string[]> = {

Check failure on line 33 in src/constants/pool-lists/csp-issue.ts

View workflow job for this annotation

GitHub Actions / Test

Property '[Network.CELO]' is missing in type '{ 1: string[]; 137: string[]; 42161: string[]; 100: string[]; 1101: string[]; 43114: string[]; 8453: never[]; 44787: never[]; 11155111: string[]; 250: never[]; 5: never[]; 10: string[]; }' but required in type 'Record<Network, string[]>'.
Expand Down
31 changes: 31 additions & 0 deletions src/lib/config/celo/contracts.ts
Original file line number Diff line number Diff line change
@@ -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;
70 changes: 70 additions & 0 deletions src/lib/config/celo/index.ts
Original file line number Diff line number Diff line change
@@ -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;
7 changes: 7 additions & 0 deletions src/lib/config/celo/keys.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Keys } from '../types';

const keys: Keys = {
infura: 'dc513f59a9df4edca4329dc46c8295b6',
};

export default keys;
55 changes: 55 additions & 0 deletions src/lib/config/celo/pools.ts
Original file line number Diff line number Diff line change
@@ -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;
10 changes: 10 additions & 0 deletions src/lib/config/celo/rateProviders.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { convertKeysToLowerCase } from '@/lib/utils/objects';
import { RateProviders } from '../types';

const rateProviders: RateProviders = {
'*': {
'0x0000000000000000000000000000000000000000': true,
},
};

export default convertKeysToLowerCase(rateProviders);
12 changes: 12 additions & 0 deletions src/lib/config/celo/tokenlists.ts
Original file line number Diff line number Diff line change
@@ -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;
19 changes: 19 additions & 0 deletions src/lib/config/celo/tokens.ts
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 2 additions & 0 deletions src/lib/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 | number, Config> = {
[Network.MAINNET]: mainnet,
Expand All @@ -24,6 +25,7 @@ const config: Record<Network | number, Config> = {
[Network.SEPOLIA]: sepolia,
[Network.BASE]: base,
[Network.ALFAJORES]: alfajores,
[Network.CELO]: celo,
};

export default config;
1 change: 1 addition & 0 deletions src/lib/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export enum Network {
AVALANCHE = 43114,
SEPOLIA = 11155111,
ALFAJORES = 44787,
CELO = 42220,
}

export interface Config {
Expand Down

0 comments on commit d61f001

Please sign in to comment.