Skip to content

Commit ec2b8a2

Browse files
mgrabinagrothem
andauthored
feat: add Sonic's market [skip cypress] (#2377)
Co-authored-by: Mark Grothe <[email protected]>
1 parent 87a87a1 commit ec2b8a2

File tree

5 files changed

+44
-1
lines changed

5 files changed

+44
-1
lines changed

public/icons/networks/sonic.svg

Lines changed: 9 additions & 1 deletion
Loading

public/icons/tokens/s.svg

Lines changed: 1 addition & 0 deletions
Loading

public/icons/tokens/ws.svg

Lines changed: 1 addition & 0 deletions
Loading

src/ui-config/marketsConfig.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
AaveV3Scroll,
2222
AaveV3ScrollSepolia,
2323
AaveV3Sepolia,
24+
AaveV3Sonic,
2425
AaveV3ZkSync,
2526
} from '@bgd-labs/aave-address-book';
2627
import { ReactNode } from 'react';
@@ -94,6 +95,7 @@ export enum CustomMarket {
9495
proto_zksync_v3 = 'proto_zksync_v3',
9596
proto_etherfi_v3 = 'proto_etherfi_v3',
9697
proto_linea_v3 = 'proto_linea_v3',
98+
proto_sonic_v3 = 'proto_sonic_v3',
9799
// v2
98100
proto_mainnet = 'proto_mainnet',
99101
proto_avalanche = 'proto_avalanche',
@@ -699,4 +701,20 @@ export const marketsData: {
699701
COLLECTOR: AaveV3Linea.COLLECTOR,
700702
},
701703
},
704+
[CustomMarket.proto_sonic_v3]: {
705+
marketTitle: 'Sonic',
706+
market: CustomMarket.proto_sonic_v3,
707+
chainId: ChainId.sonic,
708+
v3: true,
709+
// subgraphUrl: ``, // TODO: add subgraph url (waiting for fix)
710+
addresses: {
711+
LENDING_POOL_ADDRESS_PROVIDER: AaveV3Sonic.POOL_ADDRESSES_PROVIDER,
712+
LENDING_POOL: AaveV3Sonic.POOL,
713+
WETH_GATEWAY: AaveV3Sonic.WETH_GATEWAY,
714+
WALLET_BALANCE_PROVIDER: AaveV3Sonic.WALLET_BALANCE_PROVIDER,
715+
UI_POOL_DATA_PROVIDER: AaveV3Sonic.UI_POOL_DATA_PROVIDER,
716+
UI_INCENTIVE_DATA_PROVIDER: AaveV3Sonic.UI_INCENTIVE_DATA_PROVIDER,
717+
COLLECTOR: AaveV3Sonic.COLLECTOR,
718+
},
719+
},
702720
} as const;

src/ui-config/permitConfig.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
import { ChainId } from '@aave/contract-helpers';
22

3+
/**
4+
* Maps token permit support by chain and token address.
5+
* Permit enables gasless approvals using signed messages (EIP-2612).
6+
*
7+
* To check if a token supports permit, check if the contract has a permit function in the chain's scanner
8+
* or in the contract's source code.
9+
*
10+
* @dev use addresses in lowercase
11+
*/
312
export const permitByChainAndToken: {
413
[chainId: number]: Record<string, boolean>;
514
} = {
@@ -46,4 +55,10 @@ export const permitByChainAndToken: {
4655
'0x2416092f143378750bb29b79ed961ab195cceea5': true, // ezETH
4756
'0xb5bedd42000b71fdde22d3ee8a79bd49a568fc8f': true, // wstETH
4857
},
58+
[ChainId.sonic]: {
59+
// adding these in false for clarity
60+
'0x50c42deacd8fc9773493ed674b675be577f2634b': false, // WETH
61+
'0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38': false, // wS
62+
'0x29219dd400f2bf60e5a23d13be72b486d4038894': false, // USDC.e
63+
},
4964
};

0 commit comments

Comments
 (0)