Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add celo #20

Merged
merged 8 commits into from
Jan 20, 2024
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
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@graphql-codegen/typescript-operations": "^2.2.0",
"@graphql-codegen/typescript-resolvers": "2.4.1",
"@intlify/unplugin-vue-i18n": "^0.8.1",
"@kolektivo-labs/sdk": "0.0.2-beta",
"@kolektivo-labs/sdk": "0.0.3-beta",
"@layerzerolabs/scan-client": "^0.0.5",
"@metamask/detect-provider": "^1.2.0",
"@popperjs/core": "^2.9.2",
Expand Down
72 changes: 72 additions & 0 deletions src/assets/data/contracts/celo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"AaveLinearPoolFactory": "",
"Authorizer": "0x41def10bCA43d6564b02c82368A4344110B8D191",
"AuthorizerAdaptor": "",
"AuthorizerAdaptorEntrypoint": "",
"AuthorizerWithAdaptorValidation": "",
"BalancerHelpers": "0x35c2FA3d9f6DDdb5Fe932Af5CB4824EAf2a94607",
"BalancerQueries": "",
"BalancerRelayer": "",
"BalancerPoolDataQueries": "",
"BatchRelayerLibrary": "",
"ChainlinkRateProviderFactory": "",
"ChildChainGauge": "",
"ChildChainGaugeFactory": "",
"ChildChainGaugeRewardHelper": "",
"ChildChainGaugeTokenAdder": "",
"ChildChainLiquidityGaugeFactory": "",
"ChildChainStreamer": "",
"ChildChainGaugeWorkingBalanceHelper": "",
"ChildChainGaugeCheckpointer": "",
"CircuitBreakerLib": "",
"ComposableStablePoolFactory": "",
"DoubleEntrypointFixRelayer": "",
"ERC4626LinearPoolFactory": "",
"ExternalWeightedMath": "",
"GaugeWorkingBalanceHelper": "",
"GearboxLinearPoolFactory": "",
"InvestmentPoolFactory": "",
"L2BalancerPseudoMinter": "",
"L2LayerZeroBridgeForwarder": "",
"LiquidityBootstrappingPoolFactory": "",
"ManagedPoolAddRemoveTokenLib": "",
"ManagedPoolAmmLib": "",
"ManagedPoolFactory": "",
"MerkleOrchard": "",
"MerkleRedeem": "",
"MetaStablePoolFactory": "",
"MockAaveLendingPool": "",
"MockAaveLinearPool": "",
"MockComposableStablePool": "",
"MockERC4626LinearPool": "",
"MockLiquidityBootstrappingPool": "",
"MockERC4626Token": "",
"MockGearboxDieselToken": "",
"MockGearboxLinearPool": "",
"MockGearboxVault": "",
"MockManagedPool": "",
"MockStaticAToken": "",
"MockWeightedPool": "0x5cf777d514da7f74aca81a537066040CAe75B1d1",
"MockYearnLinearPool": "",
"MockYearnTokenVault": "",
"NoProtocolFeeLiquidityBootstrappingPoolFactory": "",
"NullVotingEscrow": "",
"PoolRecoveryHelper": "",
"ProtocolFeePercentagesProvider": "0xE5ae349Db84Ae3F43C8d95e91b4a2478D692aEAE",
"ProtocolFeesCollector": "0x150B1b3BF3De6a0ED6AAa34639ed17a27031B201",
"ProtocolFeesWithdrawer": "",
"ProtocolIdRegistry": "",
"QueryProcessor": "",
"RecoveryModeHelper": "",
"RewardsOnlyGauge": "",
"StablePhantomPoolFactory": "",
"StablePoolFactory": "",
"TestBalancerToken": "",
"UnbuttonAaveLinearPoolFactory": "",
"Vault": "0xaD314e606616702223d351184041C2a3DdB6D217",
"VotingEscrowDelegationProxy": "",
"WeightedPool2TokensFactory": "",
"WeightedPoolFactory": "0xEB1055c017a1427726F01368C8247649c5A79bF9",
"YearnLinearPoolFactory": "",
"Multicall": "0xca11bde05977b3631167028862be2a173976ca11"
}
2 changes: 2 additions & 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[]> = {
Expand Down Expand Up @@ -377,6 +378,7 @@ export const CSP_ISSUE_POOL_IDS: Record<Network, string[]> = {
],
[Network.BASE]: [],
[Network.ALFAJORES]: [],
[Network.CELO]: [],
[Network.SEPOLIA]: [
'0x027a946ac5a861b66a50cca0e8fb8766718b485100000000000000000000002c',
],
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/celo.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-mainnet.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: '0x471EcE3750Da237f93B8E339c536989b8978a438',
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