Skip to content

Commit

Permalink
feat: add fraxtal and mode networks (#5817)
Browse files Browse the repository at this point in the history
* chore: Remove etherfi and update renzo multiple (#5622)

* Update pools.ts

adding new pool 80REG-20GNO

* Create funding.json (#5812)

* Create funding.json

* chore: Fix syntax

---------

Co-authored-by: Gareth Fuller <[email protected]>

* feat: add fraxtal and mode networks

* feat: add icons

* feat: add rpc urls

* chore: Add multicalls

* fix: Rate providers

* chore: Add pool type labels

* chore: Fix Frax tokens

* chore: Update mode tokens

* chore: change fraxtal subgraph urls

* fix: types

* add pools to stakable

* fix: Tests

---------

Co-authored-by: Gareth Fuller <[email protected]>
Co-authored-by: eklureuil <[email protected]>
Co-authored-by: Alberto Gualis <[email protected]>
Co-authored-by: franzns <[email protected]>
Co-authored-by: ZeKraken <[email protected]>
  • Loading branch information
6 people committed Jun 27, 2024
1 parent 70c05ca commit 14825b4
Show file tree
Hide file tree
Showing 25 changed files with 501 additions and 9 deletions.
5 changes: 5 additions & 0 deletions funding.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"opRetro": {
"projectId": "0x1c33980ce1d1290b5300719114dbe2cade0b820cb2b45321b715fd53d7abc8d2"
}
}
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 @@ -42,7 +42,7 @@
"devDependencies": {
"@aave/protocol-js": "^4.3.0",
"@balancer-labs/assets": "github:balancer-labs/assets#master",
"@balancer-labs/sdk": "^1.1.6-beta.19",
"@balancer-labs/sdk": "^1.1.6-beta.20",
"@balancer-labs/typechain": "^1.0.0",
"@balancer-labs/v2-deployments": "^3.2.0",
"@cowprotocol/contracts": "^1.3.1",
Expand Down
29 changes: 29 additions & 0 deletions src/assets/data/contracts/fraxtal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"ComposableStablePoolFactory": "0x4bdCc2fb18AEb9e2d281b0278D946445070EAda7",
"ManagedPoolFactory": "0x7A2535f5fB47b8e44c02Ef5D9990588313fe8F05",
"WeightedPoolFactory": "0x9dA18982a33FD0c7051B19F0d7C76F2d5E7e017c",
"BalancerQueries": "0x4132f7AcC9dB7A6cF7BE2Dd3A9DC8b30C7E6E6c8",
"BalancerRelayer": "0xb541765F540447646A9545E0A4800A0Bacf9E13D",
"BatchRelayerLibrary": "0x662112B8CB18889e81459b92CA0f894a2ef2c1B8",
"ProtocolFeePercentagesProvider": "0xf23b4DB826DbA14c0e857029dfF076b1c0264843",
"Vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8",
"Authorizer": "0xE39B5e3B6D74016b2F6A9673D7d7493B6DF549d5",
"AuthorizerAdaptor": "0x36caC20dd805d128c1a6Dd16eeA845C574b5A17C",
"AuthorizerAdaptorEntrypoint": "0xb9F8AB3ED3F3aCBa64Bc6cd2DcA74B7F38fD7B88",
"AuthorizerWithAdaptorValidation": "0x6817149cb753BF529565B4D023d7507eD2ff4Bc0",
"ChildChainGauge": "0x4fb47126Fa83A8734991E41B942Ac29A3266C968",
"ChildChainGaugeFactory": "0xc3ccacE87f6d3A81724075ADcb5ddd85a8A1bB68",
"L2LayerZeroBridgeForwarder": "0xa523f47A933D5020b23629dDf689695AA94612Dc",
"ProtocolFeesCollector": "0xce88686553686DA562CE7Cea497CE749DA109f9F",
"ProtocolFeesWithdrawer": "0x85a80afee867aDf27B50BdB7b76DA70f1E853062",
"VotingEscrowDelegationProxy": "0xE3881627B8DeeBCCF9c23B291430a549Fc0bE5F7",
"BalancerHelpers": "0x8E9aa87E45e92bad84D5F8DD1bff34Fb92637dE9",
"BatchRelayerQueryLibrary": "0x4DdFc173C8F67808AE8F7913DccFfa6bdBFE5b0e",
"ChainlinkRateProviderFactory": "0x3f170631ed9821Ca51A59D996aB095162438DC10",
"GaugeWorkingBalanceHelper": "0x83E443EF4f9963C77bd860f94500075556668cb8",
"L2BalancerPseudoMinter": "0x9805dcfD25e6De36bad8fe9D3Fe2c9b44B764102",
"MockLiquidityBootstrappingPool": "0xaeace3B34BcA1BFe585e4B0Bb303e60e0771F139",
"NoProtocolFeeLiquidityBootstrappingPoolFactory": "0x956CCab09898C0AF2aCa5e6C229c3aD4E93d9288",
"NullVotingEscrow": "0x5cF4928a3205728bd12830E1840F7DB85c62a4B9",
"ProtocolIdRegistry": "0x9dd5Db2d38b50bEF682cE532bCca5DfD203915E1"
}
27 changes: 27 additions & 0 deletions src/assets/data/contracts/mode.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"ComposableStablePoolFactory": "0x5DbAd78818D4c8958EfF2d5b95b28385A22113Cd",
"ManagedPoolFactory": "0x043A2daD730d585C44FB79D2614F295D2d625412",
"WeightedPoolFactory": "0xc3ccacE87f6d3A81724075ADcb5ddd85a8A1bB68",
"BalancerQueries": "0x36caC20dd805d128c1a6Dd16eeA845C574b5A17C",
"BalancerRelayer": "0xb541765F540447646A9545E0A4800A0Bacf9E13D",
"BatchRelayerLibrary": "0x662112B8CB18889e81459b92CA0f894a2ef2c1B8",
"ProtocolFeePercentagesProvider": "0x85a80afee867aDf27B50BdB7b76DA70f1E853062",
"Vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8",
"Authorizer": "0xE39B5e3B6D74016b2F6A9673D7d7493B6DF549d5",
"AuthorizerAdaptor": "0xf23b4DB826DbA14c0e857029dfF076b1c0264843",
"AuthorizerAdaptorEntrypoint": "0x76578ecf9a141296Ec657847fb45B0585bCDa3a6",
"AuthorizerWithAdaptorValidation": "0x013D4382F291be5688AFBcc741Ee8A24C66B2C92",
"ChildChainGauge": "0xE3881627B8DeeBCCF9c23B291430a549Fc0bE5F7",
"ChildChainGaugeFactory": "0x4fb47126Fa83A8734991E41B942Ac29A3266C968",
"ProtocolFeesCollector": "0xce88686553686DA562CE7Cea497CE749DA109f9F",
"ProtocolFeesWithdrawer": "0x9Ac3E70dB606659Bf32D4BdFbb687AD193FD1F5B",
"VotingEscrowDelegationProxy": "0x9805dcfD25e6De36bad8fe9D3Fe2c9b44B764102",
"BalancerHelpers": "0x8E9aa87E45e92bad84D5F8DD1bff34Fb92637dE9",
"BatchRelayerQueryLibrary": "0x4DdFc173C8F67808AE8F7913DccFfa6bdBFE5b0e",
"ChainlinkRateProviderFactory": "0x96484f2aBF5e58b15176dbF1A799627B53F13B6d",
"L2BalancerPseudoMinter": "0x5cF4928a3205728bd12830E1840F7DB85c62a4B9",
"MockLiquidityBootstrappingPool": "0x197868C915E50cD7eB34EB2F56009E0BF9aa09EB",
"NoProtocolFeeLiquidityBootstrappingPoolFactory": "0xE42FFA682A26EF8F25891db4882932711D42e467",
"NullVotingEscrow": "0x9dd5Db2d38b50bEF682cE532bCca5DfD203915E1",
"ProtocolIdRegistry": "0xb9F8AB3ED3F3aCBa64Bc6cd2DcA74B7F38fD7B88"
}
1 change: 1 addition & 0 deletions src/assets/images/icons/networks/fraxtal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/images/icons/networks/mode.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,7 @@ it('calculates networkFilters', async () => {
expiredGauges
);

expect(networkFilters).toEqual([1, 10, 100, 137, 1101, 8453, 42161, 43114]);
expect(networkFilters).toEqual([
1, 10, 100, 137, 252, 1101, 8453, 42161, 43114,
]);
});
4 changes: 4 additions & 0 deletions src/constants/pool-lists/csp-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export const NO_RECOVERY_EXIT_POOL_IDS: Record<Network, string[]> = {
[Network.FANTOM]: [],
[Network.GOERLI]: [],
[Network.OPTIMISM]: [],
[Network.FRAXTAL]: [],
[Network.MODE]: [],
};

export const CSP_ISSUE_POOL_IDS: Record<Network, string[]> = {
Expand Down Expand Up @@ -417,6 +419,8 @@ export const CSP_ISSUE_POOL_IDS: Record<Network, string[]> = {
'0x593acbfb1eaf3b6ec86fa60325d816996fdcbc0d000000000000000000000038',
'0xd1af4974fcc995cf36ba40b189caa92964a9126d0000000000000000000000f1',
],
[Network.FRAXTAL]: [],
[Network.MODE]: [],
};

export const HIGH_RISK_POOL_IDS: string[] = [
Expand Down
28 changes: 28 additions & 0 deletions src/lib/config/fraxtal/contracts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Contracts } from '../types';
import * as fraxtal from '@/assets/data/contracts/fraxtal.json';

const contracts: Contracts = {
merkleRedeem: '',
merkleOrchard: '',
multicall: '0xcA11bde05977b3631167028862bE2a173976CA11',
authorizer: fraxtal.Authorizer,
vault: fraxtal.Vault,
weightedPoolFactory: fraxtal.WeightedPoolFactory,
stablePoolFactory: fraxtal.ComposableStablePoolFactory,
lidoRelayer: '',
balancerHelpers: fraxtal.BalancerHelpers,
batchRelayer: fraxtal.BalancerRelayer,
gaugeFactory: fraxtal.ChildChainGaugeFactory,
balancerMinter: fraxtal.L2BalancerPseudoMinter,
gaugeController: '',
tokenAdmin: '',
veBAL: '',
veDelegationProxy: fraxtal.VotingEscrowDelegationProxy,
veBALHelpers: '',
feeDistributor: '',
feeDistributorDeprecated: '',
faucet: '',
gaugeWorkingBalanceHelper: fraxtal.GaugeWorkingBalanceHelper,
};

export default contracts;
76 changes: 76 additions & 0 deletions src/lib/config/fraxtal/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { Config } from '../types';
import contracts from './contracts';
import pools from './pools';
import tokenlists from './tokenlists';
import tokens from './tokens';
import rateProviders from './rateProviders';

const config: Config = {
key: '252',
chainId: 252,
layerZeroChainId: 255,
chainName: 'Fraxtal',
name: 'Fraxtal',
shortName: 'Fraxtal',
monorepoName: 'fraxtal',
slug: 'fraxtal',
network: 'fraxtal',
trustWalletNetwork: 'fraxtal',
unknown: false,
visibleInUI: true,
testNetwork: false,
rpc: 'https://rpc.frax.com/',
ws: '',
blockTime: 13,
explorer: 'https://fraxscan.com/',
explorerName: 'The Fraxtal Explorer',
subgraph:
'https://api.goldsky.com/api/public/project_clwhu1vopoigi01wmbn514m1z/subgraphs/balancer-fraxtal-v2/latest/gn',
balancerApi: 'https://api.balancer.fi',
poolsUrlV2: '',
subgraphs: {
main: [
'https://api.goldsky.com/api/public/project_clwhu1vopoigi01wmbn514m1z/subgraphs/balancer-fraxtal-v2/latest/gn',
],
aave: '',
gauge:
'https://api.goldsky.com/api/public/project_clwhu1vopoigi01wmbn514m1z/subgraphs/balancer-gauges-fraxtal/latest/gn',
blocks: '',
},
bridgeUrl: '',
supportsEIP1559: false,
supportsElementPools: false,
supportsVeBalSync: true,
nativeAsset: {
name: 'FraxEther',
address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
symbol: 'frxETH',
decimals: 18,
deeplinkId: 'ether',
logoURI: 'tokens/eth.png',
minTransactionBuffer: '0.005',
},
thirdParty: {
coingecko: {
nativeAssetId: 'frax-ether',
platformId: 'fraxtal',
},
},
addresses: {
...contracts,
},
keys: {
infura: '',
alchemy: '',
},
gauges: {
type: 5,
weight: 0,
},
pools,
tokenlists,
tokens,
rateProviders,
};

export default config;
62 changes: 62 additions & 0 deletions src/lib/config/fraxtal/pools.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { CSP_ISSUE_POOL_IDS } from '@/constants/pool-lists/csp-issue';
import { PoolWarning, Pools } from '@/types/pools';
import { Network } from '../types';

const pools: Pools = {
IdsMap: {},
Pagination: {
PerPage: 10,
PerPool: 10,
PerPoolInitial: 5,
},
BoostsEnabled: true,
DelegateOwner: '0xba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b',
ZeroAddress: '0x0000000000000000000000000000000000000000',
DynamicFees: {
Gauntlet: [],
},
BlockList: [],
IncludedPoolTypes: [
'Weighted',
'Stable',
'MetaStable',
'GyroE',
'ComposableStable',
],
Stable: {
AllowList: [],
},
Investment: {
AllowList: [],
},
Weighted: {
AllowList: [],
},
Factories: {
'0x4bdcc2fb18aeb9e2d281b0278d946445070eada7': 'composableStablePool',
'0x9da18982a33fd0c7051b19f0d7c76f2d5e7e017c': 'weightedPool',
},
Stakable: {
VotingGaugePools: [
'0xa0b92b33beafce388ce0092afdcd0ca77323eb12000000000000000000000006',
'0xa0af0b88796c1aa67e93db89fead2ab7aa3d6747000000000000000000000007',
'0x33251abecb0364df98a27a8d5d7b5ccddc774c42000000000000000000000008',
'0x1570315476480fa80cec1fff07a20c1df1adfd53000200000000000000000009',
],
AllowList: [],
},
Deep: [],
BoostedApr: [],
Metadata: {},
DisabledJoins: [],
BrandedRedirect: {
Gyro2: 'gyro',
Gyro3: 'gyro',
GyroE: 'gyro',
},
Issues: {
[PoolWarning.CspPoolVulnWarning]: CSP_ISSUE_POOL_IDS[Network.MODE],
},
};

export default pools;
10 changes: 10 additions & 0 deletions src/lib/config/fraxtal/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);
11 changes: 11 additions & 0 deletions src/lib/config/fraxtal/tokenlists.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { TokenListURLMap } from '@/types/TokenList';

const tokenlists: TokenListURLMap = {
Balancer: {
Allowlisted:
'https://raw.githubusercontent.com/balancer/tokenlists/main/generated/balancer.tokenlist.json',
},
External: [],
};

export default tokenlists;
19 changes: 19 additions & 0 deletions src/lib/config/fraxtal/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: ['USDT', 'DAI', 'USDC', 'BAL', 'wfrxETH'],
},
InitialSwapTokens: {
input: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
output: '0xfc00000000000000000000000000000000000006',
},
Addresses: {
nativeAsset: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
wNativeAsset: '0xfc00000000000000000000000000000000000006',
WETH: '',
BAL: '',
},
};

export default tokens;
1 change: 1 addition & 0 deletions src/lib/config/gnosis-chain/pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const pools: Pools = {
'0x72a040c63496c9306ab3409a11dff73176e203fd00000000000000000000006a', // sBAL3/crvUSD
'0xc9f00c3a713008ddf69b768d90d4978549bfdf9400000000000000000000006d', // crvUSD/sDAI
'0x7644fa5d0ea14fcf3e813fdf93ca9544f8567655000000000000000000000066', // stabal3
'0x95a2e3f73cdcef576a7d9b9e0d11efb5df90f166000200000000000000000088', // 80REG-20GNO
'0xC66936A47E6D40DD050A8419B4352825D9082241000000000000000000000090',
],
},
Expand Down
4 changes: 4 additions & 0 deletions src/lib/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import optimism from './optimism';
import polygon from './polygon';
import sepolia from './sepolia';
import zkevm from './zkevm';
import fraxtal from './fraxtal';
import mode from './mode';

const config: Record<Network | number, Config> = {
[Network.MAINNET]: mainnet,
Expand All @@ -22,6 +24,8 @@ const config: Record<Network | number, Config> = {
[Network.AVALANCHE]: avalanche,
[Network.SEPOLIA]: sepolia,
[Network.BASE]: base,
[Network.FRAXTAL]: fraxtal,
[Network.MODE]: mode,
};

export default config;
Loading

0 comments on commit 14825b4

Please sign in to comment.