Skip to content
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
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
"test:coverage": "jest --coverage"
},
"dependencies": {
"@aave/contract-helpers": "1.36.1",
"@aave/graphql": "^0.10.0",
"@aave/math-utils": "1.36.1",
"@aave/react": "^0.8.1",
"@aave/contract-helpers": "1.37.0",
"@aave/graphql": "^0.11.0",
"@aave/math-utils": "1.37.0",
"@aave/react": "^0.8.2",
"@amplitude/analytics-browser": "^2.13.0",
"@bgd-labs/aave-address-book": "^4.36.3",
"@bgd-labs/aave-address-book": "^4.38.0",
"@cowprotocol/cow-sdk": "7.2.4",
"@cowprotocol/sdk-ethers-v5-adapter": "0.3.0",
"@cowprotocol/sdk-flash-loans": "1.6.0",
Expand Down
4 changes: 2 additions & 2 deletions pages/api/rpc-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const NETWORK_CONFIG: Record<number, { network: string; apiKey: string }> = {
[ChainId.sonic]: { network: 'sonic-mainnet', apiKey: process.env.SONIC_RPC_API_KEY || '' },
[ChainId.celo]: { network: 'celo-mainnet', apiKey: process.env.CELO_RPC_API_KEY || '' },
[ChainId.soneium]: { network: 'soneium-mainnet', apiKey: process.env.SONEIUM_RPC_API_KEY || '' },
[57073]: { network: 'ink-mainnet', apiKey: process.env.INK_RPC_API_KEY || '' },
[9745]: { network: 'plasma-mainnet', apiKey: process.env.PLASMA_RPC_API_KEY || '' },
[ChainId.ink]: { network: 'ink-mainnet', apiKey: process.env.INK_RPC_API_KEY || '' },
[ChainId.plasma]: { network: 'plasma-mainnet', apiKey: process.env.PLASMA_RPC_API_KEY || '' },

// Testnets
[ChainId.sepolia]: { network: 'eth-sepolia', apiKey: process.env.MAINNET_RPC_API_KEY || '' },
Expand Down
4 changes: 2 additions & 2 deletions src/components/transactions/Bridge/BridgeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ const prodConfig: Config[] = [
],
},
{
sourceChainId: 57073,
sourceChainId: ChainId.ink,
chainSelector: '3461204551265785888',
burnMintTokenPool: '0xDe6539018B095353A40753Dc54C91C68c9487D4E',
router: '0xca7c90A52B44E301AC01Cb5EB99b2fD99339433A',
Expand All @@ -216,7 +216,7 @@ const prodConfig: Config[] = [
symbol: 'ETH',
decimals: 18,
address: constants.AddressZero, // Use zero address for network token ccip
chainId: 57073,
chainId: ChainId.ink,
extensions: {
isNative: true,
},
Expand Down
7 changes: 4 additions & 3 deletions src/components/transactions/Bridge/BridgeModalContent.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ChainId } from '@aave/contract-helpers';
import { AaveV3InkWhitelabel } from '@bgd-labs/aave-address-book';
import { SwitchVerticalIcon } from '@heroicons/react/outline';
import { Trans } from '@lingui/macro';
Expand Down Expand Up @@ -58,11 +59,11 @@ const defaultNetwork = supportedNetworksWithBridge[0];
function getUseBridgeTokensParams(chainId: number): UseBridgeTokensParams {
const tokenOracle = getConfigFor(chainId).tokenOracle;

if (chainId === 57073) {
if (chainId === ChainId.ink) {
// no market config available yet for ink, so values are set here
return {
chainId,
ghoTokenAddress: '0xfc421aD3C883Bf9E7C4f42dE845C4e4405799e73',
ghoTokenAddress: AaveV3InkWhitelabel.ASSETS.GHO.UNDERLYING,
tokenOracle,
walletBalanceProviderAddress: AaveV3InkWhitelabel.WALLET_BALANCE_PROVIDER,
};
Expand Down Expand Up @@ -324,7 +325,7 @@ export const BridgeModalContent = () => {
);

// There's no market config available for ink yet, so skip showing gas station since it relies on having a market
const showGasStation = sourceNetworkObj.chainId !== 57073;
const showGasStation = sourceNetworkObj.chainId !== ChainId.ink;

return (
<>
Expand Down
22 changes: 11 additions & 11 deletions src/hooks/useMeritIncentives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,21 +632,21 @@ export const MERIT_DATA_MAP: Record<string, Record<string, MeritReserveIncentive
CELO: [
{
action: MeritAction.CELO_SUPPLY_CELO,
rewardTokenAddress: AaveV3Celo.ASSETS.cUSD.A_TOKEN,
rewardTokenAddress: AaveV3Celo.ASSETS.USDm.A_TOKEN,
rewardTokenSymbol: 'aCelUSDm',
protocolAction: ProtocolAction.supply,
customMessage: antiLoopMessage,
},
{
action: MeritAction.CELO_SUPPLY_MULTIPLE_BORROW_USDT,
rewardTokenAddress: AaveV3Celo.ASSETS.cUSD.A_TOKEN,
rewardTokenAddress: AaveV3Celo.ASSETS.USDm.A_TOKEN,
rewardTokenSymbol: 'aCelUSDm',
protocolAction: ProtocolAction.supply,
customMessage: celoSupplyMultipleBorrowUsdtMessage,
},
{
action: MeritAction.CELO_BORROW_CELO,
rewardTokenAddress: AaveV3Celo.ASSETS.cUSD.A_TOKEN,
rewardTokenAddress: AaveV3Celo.ASSETS.USDm.A_TOKEN,
rewardTokenSymbol: 'aCelUSDm',
protocolAction: ProtocolAction.borrow,
customMessage: antiLoopBorrowMessage,
Expand All @@ -655,21 +655,21 @@ export const MERIT_DATA_MAP: Record<string, Record<string, MeritReserveIncentive
['USD₮']: [
{
action: MeritAction.CELO_SUPPLY_USDT,
rewardTokenAddress: AaveV3Celo.ASSETS.cUSD.A_TOKEN,
rewardTokenAddress: AaveV3Celo.ASSETS.USDm.A_TOKEN,
rewardTokenSymbol: 'aCelUSDm',
protocolAction: ProtocolAction.supply,
customMessage: antiLoopMessage,
},
{
action: MeritAction.CELO_BORROW_USDT,
rewardTokenAddress: AaveV3Celo.ASSETS.cUSD.A_TOKEN,
rewardTokenAddress: AaveV3Celo.ASSETS.USDm.A_TOKEN,
rewardTokenSymbol: 'aCelUSDm',
protocolAction: ProtocolAction.borrow,
customMessage: antiLoopBorrowMessage,
},
{
action: MeritAction.CELO_SUPPLY_MULTIPLE_BORROW_USDT,
rewardTokenAddress: AaveV3Celo.ASSETS.cUSD.A_TOKEN,
rewardTokenAddress: AaveV3Celo.ASSETS.USDm.A_TOKEN,
rewardTokenSymbol: 'aCelUSDm',
protocolAction: ProtocolAction.borrow,
customMessage: celoSupplyMultipleBorrowUsdtMessage,
Expand All @@ -678,14 +678,14 @@ export const MERIT_DATA_MAP: Record<string, Record<string, MeritReserveIncentive
USDC: [
{
action: MeritAction.CELO_SUPPLY_USDC,
rewardTokenAddress: AaveV3Celo.ASSETS.cUSD.A_TOKEN,
rewardTokenAddress: AaveV3Celo.ASSETS.USDm.A_TOKEN,
rewardTokenSymbol: 'aCelUSDm',
protocolAction: ProtocolAction.supply,
customMessage: antiLoopMessage,
},
{
action: MeritAction.CELO_BORROW_USDC,
rewardTokenAddress: AaveV3Celo.ASSETS.cUSD.A_TOKEN,
rewardTokenAddress: AaveV3Celo.ASSETS.USDm.A_TOKEN,
rewardTokenSymbol: 'aCelUSDm',
protocolAction: ProtocolAction.borrow,
customMessage: antiLoopBorrowMessage,
Expand All @@ -694,21 +694,21 @@ export const MERIT_DATA_MAP: Record<string, Record<string, MeritReserveIncentive
WETH: [
{
action: MeritAction.CELO_SUPPLY_WETH,
rewardTokenAddress: AaveV3Celo.ASSETS.cUSD.A_TOKEN,
rewardTokenAddress: AaveV3Celo.ASSETS.USDm.A_TOKEN,
rewardTokenSymbol: 'aCelUSDm',
protocolAction: ProtocolAction.supply,
customMessage: antiLoopMessage,
},
{
action: MeritAction.CELO_SUPPLY_MULTIPLE_BORROW_USDT,
rewardTokenAddress: AaveV3Celo.ASSETS.cUSD.A_TOKEN,
rewardTokenAddress: AaveV3Celo.ASSETS.USDm.A_TOKEN,
rewardTokenSymbol: 'aCelUSDm',
protocolAction: ProtocolAction.supply,
customMessage: celoSupplyMultipleBorrowUsdtMessage,
},
{
action: MeritAction.CELO_BORROW_WETH,
rewardTokenAddress: AaveV3Celo.ASSETS.cUSD.A_TOKEN,
rewardTokenAddress: AaveV3Celo.ASSETS.USDm.A_TOKEN,
rewardTokenSymbol: 'aCelUSDm',
protocolAction: ProtocolAction.borrow,
customMessage: antiLoopBorrowMessage,
Expand Down
35 changes: 6 additions & 29 deletions src/services/UIPoolService.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import {
EmodeDataHumanized,
LegacyUiPoolDataProvider,
ReservesDataHumanized,
UiPoolDataProvider,
UserReserveDataHumanized,
} from '@aave/contract-helpers';
import { Provider } from '@ethersproject/providers';
import { CustomMarket, MarketDataType } from 'src/ui-config/marketsConfig';
import { ENABLE_TESTNET } from 'src/utils/marketsAndNetworksConfig';
import { MarketDataType } from 'src/ui-config/marketsConfig';

export type UserReservesDataHumanized = {
userReserves: UserReserveDataHumanized[];
Expand All @@ -19,32 +17,11 @@ export class UiPoolService {

private async getUiPoolDataService(marketData: MarketDataType) {
const provider = this.getProvider(marketData.chainId);
if (this.useLegacyUiPoolDataProvider(marketData)) {
return new LegacyUiPoolDataProvider({
uiPoolDataProviderAddress: marketData.addresses.UI_POOL_DATA_PROVIDER,
provider,
chainId: marketData.chainId,
});
} else {
return new UiPoolDataProvider({
uiPoolDataProviderAddress: marketData.addresses.UI_POOL_DATA_PROVIDER as string,
provider,
chainId: marketData.chainId,
});
}
}

private useLegacyUiPoolDataProvider(marketData: MarketDataType) {
if (marketData.market === CustomMarket.proto_base_sepolia_v3) {
return false;
}

if (ENABLE_TESTNET || !marketData.v3) {
// it's a v2 market, or it does not have v3.1 upgrade
return true;
}

return false;
return new UiPoolDataProvider({
uiPoolDataProviderAddress: marketData.addresses.UI_POOL_DATA_PROVIDER,
provider,
chainId: marketData.chainId,
});
}

async getReservesHumanized(marketData: MarketDataType): Promise<ReservesDataHumanized> {
Expand Down
4 changes: 2 additions & 2 deletions src/ui-config/governanceConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ export const governanceChainConfig: GovernanceChainConfig = {
[ChainId.sonic]: GovernanceV3Sonic.PC_DATA_HELPER,
[ChainId.celo]: GovernanceV3Celo.PC_DATA_HELPER,
[ChainId.soneium]: GovernanceV3Soneium.PC_DATA_HELPER,
[9745]: GovernanceV3Plasma.PC_DATA_HELPER,
[57073]: GovernanceV3Ink.PC_DATA_HELPER,
[ChainId.plasma]: GovernanceV3Plasma.PC_DATA_HELPER,
[ChainId.ink]: GovernanceV3Ink.PC_DATA_HELPER,
},
votingAssets: {
aaveTokenAddress: AaveV3Ethereum.ASSETS.AAVE.UNDERLYING,
Expand Down
24 changes: 12 additions & 12 deletions src/ui-config/marketsConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export const marketsData: {
SWAP_COLLATERAL_ADAPTER: AaveV3Base.SWAP_COLLATERAL_ADAPTER,
WITHDRAW_SWITCH_ADAPTER: AaveV3Base.WITHDRAW_SWAP_ADAPTER,
DEBT_SWITCH_ADAPTER: AaveV3Base.DEBT_SWAP_ADAPTER,
GHO_TOKEN_ADDRESS: '0x6bb7a212910682dcfdbd5bcbb3e28fb4e8da10ee',
GHO_TOKEN_ADDRESS: AaveV3Base.ASSETS.GHO.UNDERLYING,
},
},

Expand Down Expand Up @@ -315,12 +315,12 @@ export const marketsData: {
permitDisabled: true,
chainId: ChainId.base_sepolia,
addresses: {
LENDING_POOL_ADDRESS_PROVIDER: '0xE4C23309117Aa30342BFaae6c95c6478e0A4Ad00', // AaveV3BaseSepolia.POOL_ADDRESSES_PROVIDER,
LENDING_POOL: '0x8bAB6d1b75f19e9eD9fCe8b9BD338844fF79aE27', // AaveV3BaseSepolia.POOL,
WETH_GATEWAY: '0x0568130e794429D2eEBC4dafE18f25Ff1a1ed8b6', // AaveV3BaseSepolia.WETH_GATEWAY,
WALLET_BALANCE_PROVIDER: '0x2c4D1F4EC7F4FfA09a5E1C9e74fD3A10f21Bd811', // AaveV3BaseSepolia.WALLET_BALANCE_PROVIDER,
UI_POOL_DATA_PROVIDER: '0x6a9D64f93DB660EaCB2b6E9424792c630CdA87d8', // AaveV3BaseSepolia.UI_POOL_DATA_PROVIDER,
UI_INCENTIVE_DATA_PROVIDER: '0xDB1412acf288D5bE057f8e90fd7b1BF4f84bB3B1', // AaveV3BaseSepolia.UI_INCENTIVE_DATA_PROVIDER,
LENDING_POOL_ADDRESS_PROVIDER: AaveV3BaseSepolia.POOL_ADDRESSES_PROVIDER,
LENDING_POOL: AaveV3BaseSepolia.POOL,
WETH_GATEWAY: AaveV3BaseSepolia.WETH_GATEWAY,
WALLET_BALANCE_PROVIDER: AaveV3BaseSepolia.WALLET_BALANCE_PROVIDER,
UI_POOL_DATA_PROVIDER: '0xd3815B9f70E0cD7F17F7d5e4A8bc8dd7e53CAe44', // AaveV3BaseSepolia.UI_POOL_DATA_PROVIDER,
UI_INCENTIVE_DATA_PROVIDER: AaveV3BaseSepolia.UI_INCENTIVE_DATA_PROVIDER,
L2_ENCODER: AaveV3BaseSepolia.L2_ENCODER,
FAUCET: '0xD9145b5F45Ad4519c7ACcD6E0A4A82e83bB8A6Dc',
},
Expand Down Expand Up @@ -436,7 +436,7 @@ export const marketsData: {
// REPAY_WITH_COLLATERAL_ADAPTER: AaveV3EthereumLido.REPAY_WITH_COLLATERAL_ADAPTER,
// SWAP_COLLATERAL_ADAPTER: AaveV3EthereumLido.SWAP_COLLATERAL_ADAPTER,
WALLET_BALANCE_PROVIDER: '0xd8F7829ceB2692C90e418e0963b5Cbcbafc260Bd',
UI_POOL_DATA_PROVIDER: '0x2581d1f2Ce3860b651bF84AF416e7d28d9500D7F',
UI_POOL_DATA_PROVIDER: AaveV3Ethereum.UI_POOL_DATA_PROVIDER,
UI_INCENTIVE_DATA_PROVIDER: '0xC5E1717BEafC680E0148DD561591410b69650a5F',
COLLECTOR: '0x8b8d44751a933f190dde25A69E8cC6F9101b5435',
// WITHDRAW_SWITCH_ADAPTER: AaveV3EthereumLido.WITHDRAW_SWAP_ADAPTER,
Expand All @@ -446,15 +446,15 @@ export const marketsData: {
[CustomMarket.proto_plasma_v3]: {
marketTitle: 'Plasma',
market: CustomMarket.proto_plasma_v3,
chainId: 9745 as ChainId,
chainId: ChainId.plasma,
v3: true,
logo: '/icons/networks/plasma.svg',
addresses: {
LENDING_POOL_ADDRESS_PROVIDER: AaveV3Plasma.POOL_ADDRESSES_PROVIDER,
LENDING_POOL: AaveV3Plasma.POOL,
WETH_GATEWAY: AaveV3Plasma.WETH_GATEWAY,
WALLET_BALANCE_PROVIDER: AaveV3Plasma.WALLET_BALANCE_PROVIDER,
UI_POOL_DATA_PROVIDER: '0xc851e6147dcE6A469CC33BE3121b6B2D4CaD2763', //AaveV3Plasma.UI_POOL_DATA_PROVIDER,
UI_POOL_DATA_PROVIDER: AaveV3Plasma.UI_POOL_DATA_PROVIDER,
UI_INCENTIVE_DATA_PROVIDER: AaveV3Plasma.UI_INCENTIVE_DATA_PROVIDER,
COLLECTOR: AaveV3Plasma.COLLECTOR,
},
Expand Down Expand Up @@ -490,15 +490,15 @@ export const marketsData: {
[CustomMarket.proto_ink_v3]: {
marketTitle: 'Ink',
market: CustomMarket.proto_ink_v3,
chainId: 57073 as ChainId,
chainId: ChainId.ink,
v3: true,
logo: '/icons/networks/ink.svg',
addresses: {
LENDING_POOL_ADDRESS_PROVIDER: AaveV3InkWhitelabel.POOL_ADDRESSES_PROVIDER,
LENDING_POOL: AaveV3InkWhitelabel.POOL,
WETH_GATEWAY: AaveV3InkWhitelabel.WETH_GATEWAY,
WALLET_BALANCE_PROVIDER: AaveV3InkWhitelabel.WALLET_BALANCE_PROVIDER,
UI_POOL_DATA_PROVIDER: '0xc851e6147dcE6A469CC33BE3121b6B2D4CaD2763', // custom as doesnt work utils
UI_POOL_DATA_PROVIDER: AaveV3InkWhitelabel.UI_POOL_DATA_PROVIDER,
UI_INCENTIVE_DATA_PROVIDER: AaveV3InkWhitelabel.UI_INCENTIVE_DATA_PROVIDER,
// COLLECTOR: AaveV3InkWhitelabel.COLLECTOR,
},
Expand Down
10 changes: 3 additions & 7 deletions src/ui-config/networksConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,7 @@ export const testnetConfig: Record<string, BaseNetworkConfig> = {
},
[ChainId.base_sepolia]: {
name: 'Base Sepolia',
publicJsonRPCUrl: [
'https://base-sepolia.blockpi.network/v1/rpc/public',
'https://sepolia.base.org',
'https://base-sepolia.gateway.tenderly.co',
],
publicJsonRPCUrl: ['https://sepolia.base.org', 'https://base-sepolia.gateway.tenderly.co'],
baseUniswapAdapter: '0x0',
baseAssetSymbol: 'ETH',
wrappedBaseAssetSymbol: 'WETH',
Expand Down Expand Up @@ -431,7 +427,7 @@ export const prodNetworkConfig: Record<string, BaseNetworkConfig> = {
},
wagmiChain: soneium,
},
[9745]: {
[ChainId.plasma]: {
name: 'Plasma',
publicJsonRPCUrl: ['https://rpc.plasma.to'],
baseAssetSymbol: 'XPL',
Expand All @@ -446,7 +442,7 @@ export const prodNetworkConfig: Record<string, BaseNetworkConfig> = {
url: 'https://stargate.finance/bridge?srcChain=ethereum&srcToken=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE&dstChain=plasma&dstToken=0x9895D81bB462A195b4922ED7De0e3ACD007c32CB',
},
},
[57073]: {
[ChainId.ink]: {
name: 'Ink',
publicJsonRPCUrl: ['https://ink.drpc.org'],
baseAssetSymbol: 'ETH',
Expand Down
Loading
Loading