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 Sonic's market [skip cypress] #2377

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions public/icons/tokens/s.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 public/icons/tokens/ws.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions src/ui-config/marketsConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
AaveV3Scroll,
AaveV3ScrollSepolia,
AaveV3Sepolia,
AaveV3Sonic,
AaveV3ZkSync,
} from '@bgd-labs/aave-address-book';
import { ReactNode } from 'react';
Expand Down Expand Up @@ -94,6 +95,7 @@ export enum CustomMarket {
proto_zksync_v3 = 'proto_zksync_v3',
proto_etherfi_v3 = 'proto_etherfi_v3',
proto_linea_v3 = 'proto_linea_v3',
proto_sonic_v3 = 'proto_sonic_v3',
// v2
proto_mainnet = 'proto_mainnet',
proto_avalanche = 'proto_avalanche',
Expand Down Expand Up @@ -699,4 +701,20 @@ export const marketsData: {
COLLECTOR: AaveV3Linea.COLLECTOR,
},
},
[CustomMarket.proto_sonic_v3]: {
marketTitle: 'Sonic',
market: CustomMarket.proto_sonic_v3,
chainId: ChainId.sonic,
v3: true,
// subgraphUrl: ``, // TODO: add subgraph url (waiting for fix)
addresses: {
LENDING_POOL_ADDRESS_PROVIDER: AaveV3Sonic.POOL_ADDRESSES_PROVIDER,
LENDING_POOL: AaveV3Sonic.POOL,
WETH_GATEWAY: AaveV3Sonic.WETH_GATEWAY,
WALLET_BALANCE_PROVIDER: AaveV3Sonic.WALLET_BALANCE_PROVIDER,
UI_POOL_DATA_PROVIDER: AaveV3Sonic.UI_POOL_DATA_PROVIDER,
UI_INCENTIVE_DATA_PROVIDER: AaveV3Sonic.UI_INCENTIVE_DATA_PROVIDER,
COLLECTOR: AaveV3Sonic.COLLECTOR,
},
},
} as const;
15 changes: 15 additions & 0 deletions src/ui-config/permitConfig.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import { ChainId } from '@aave/contract-helpers';

/**
* Maps token permit support by chain and token address.
* Permit enables gasless approvals using signed messages (EIP-2612).
*
* To check if a token supports permit, check if the contract has a permit function in the chain's scanner
* or in the contract's source code.
*
* @dev use addresses in lowercase
*/
export const permitByChainAndToken: {
[chainId: number]: Record<string, boolean>;
} = {
Expand Down Expand Up @@ -46,4 +55,10 @@ export const permitByChainAndToken: {
'0x2416092f143378750bb29b79ed961ab195cceea5': true, // ezETH
'0xb5bedd42000b71fdde22d3ee8a79bd49a568fc8f': true, // wstETH
},
[ChainId.sonic]: {
// adding these in false for clarity
'0x50c42deacd8fc9773493ed674b675be577f2634b': false, // WETH
'0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38': false, // wS
'0x29219dd400f2bf60e5a23d13be72b486d4038894': false, // USDC.e
},
};
Loading