Skip to content

Commit

Permalink
feat: add Sonic's market [skip cypress] (#2377)
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Grothe <[email protected]>
  • Loading branch information
mgrabina and grothem authored Mar 3, 2025
1 parent 87a87a1 commit ec2b8a2
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 1 deletion.
10 changes: 9 additions & 1 deletion public/icons/networks/sonic.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/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
},
};

1 comment on commit ec2b8a2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

Please sign in to comment.