Skip to content

Commit

Permalink
chore(merge): merge main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
palace22 committed Nov 15, 2024
2 parents dc2d5f7 + 5f5b333 commit c06e160
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/empty-papayas-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@folks-finance/xchain-sdk": patch
---

Added testnet token CCIP-BnM
24 changes: 24 additions & 0 deletions src/chains/evm/common/constants/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ export const CONTRACT_SLOT: Partial<
balanceOf: 9n,
allowance: 10n,
},
[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM]: {
balanceOf: 0n,
allowance: 1n,
},
},
},
[EVM_FOLKS_CHAIN_ID.BASE_SEPOLIA]: {
Expand All @@ -111,6 +115,10 @@ export const CONTRACT_SLOT: Partial<
balanceOf: 9n,
allowance: 10n,
},
[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM]: {
balanceOf: 0n,
allowance: 1n,
},
},
},
[EVM_FOLKS_CHAIN_ID.ARBITRUM_SEPOLIA]: {
Expand All @@ -119,6 +127,10 @@ export const CONTRACT_SLOT: Partial<
balanceOf: 9n,
allowance: 10n,
},
[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM]: {
balanceOf: 0n,
allowance: 1n,
},
},
},
[EVM_FOLKS_CHAIN_ID.ETHEREUM_SEPOLIA]: {
Expand All @@ -131,6 +143,18 @@ export const CONTRACT_SLOT: Partial<
balanceOf: 0n,
allowance: 1n,
},
[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM]: {
balanceOf: 0n,
allowance: 1n,
},
},
},
[EVM_FOLKS_CHAIN_ID.BSC_TESTNET]: {
erc20: {
[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM]: {
balanceOf: 0n,
allowance: 1n,
},
},
},
} as const;
12 changes: 12 additions & 0 deletions src/chains/evm/hub/constants/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,18 @@ export const HUB_CHAIN: Record<NetworkType, HubChain> = {
poolAddress: convertToGenericAddress("0x424E02262874AD74562B08487628093b0456Ac9E" as EvmAddress, ChainType.EVM),
supportedLoanTypes: new Set([LoanTypeId.DEPOSIT, LoanTypeId.GENERAL]),
},
[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM]: {
token: {
type: TokenType.CROSS_CHAIN,
adapters: [AdapterType.CCIP_TOKEN],
address: convertToGenericAddress("0xD21341536c5cF5EB1bcb58f6723cE26e8D8E90e4" as EvmAddress, ChainType.EVM),
decimals: 18,
},
folksTokenId: TESTNET_FOLKS_TOKEN_ID.CCIP_BnM,
poolId: TESTNET_POOLS[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM],
poolAddress: convertToGenericAddress("0x99A15c2529ba1020814E9601F3CcAcC413747935" as EvmAddress, ChainType.EVM),
supportedLoanTypes: new Set([LoanTypeId.DEPOSIT, LoanTypeId.GENERAL]),
},
} satisfies Record<TestnetFolksTokenId, HubTokenData>,
rewardsV1Address: convertToGenericAddress(
"0xB8Aa9782d5922B00fC63e7def85F276059B4aCd0" as EvmAddress,
Expand Down
74 changes: 74 additions & 0 deletions src/common/constants/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,20 @@ export const SPOKE_CHAIN: Record<NetworkType, Partial<Record<FolksChainId, Spoke
ChainType.EVM,
),
},
[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM]: {
token: {
type: TokenType.CROSS_CHAIN,
adapters: [AdapterType.CCIP_TOKEN],
address: convertToGenericAddress("0xD21341536c5cF5EB1bcb58f6723cE26e8D8E90e4" as EvmAddress, ChainType.EVM),
decimals: 18,
},
folksTokenId: TESTNET_FOLKS_TOKEN_ID.CCIP_BnM,
poolId: TESTNET_POOLS[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM],
spokeAddress: convertToGenericAddress(
"0xd22f35b7c441F09649D54d8fD53dc92DD3831f5E" as EvmAddress,
ChainType.EVM,
),
},
},
},
[FOLKS_CHAIN_ID.ETHEREUM_SEPOLIA]: {
Expand Down Expand Up @@ -665,6 +679,20 @@ export const SPOKE_CHAIN: Record<NetworkType, Partial<Record<FolksChainId, Spoke
ChainType.EVM,
),
},
[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM]: {
token: {
type: TokenType.CROSS_CHAIN,
adapters: [AdapterType.CCIP_TOKEN],
address: convertToGenericAddress("0xFd57b4ddBf88a4e07fF4e34C487b99af2Fe82a05" as EvmAddress, ChainType.EVM),
decimals: 18,
},
folksTokenId: TESTNET_FOLKS_TOKEN_ID.CCIP_BnM,
poolId: TESTNET_POOLS[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM],
spokeAddress: convertToGenericAddress(
"0xD941FC73D3ba27d5f2110bEA8E5208a4aAa036B2" as EvmAddress,
ChainType.EVM,
),
},
},
},
[FOLKS_CHAIN_ID.BASE_SEPOLIA]: {
Expand Down Expand Up @@ -722,6 +750,20 @@ export const SPOKE_CHAIN: Record<NetworkType, Partial<Record<FolksChainId, Spoke
ChainType.EVM,
),
},
[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM]: {
token: {
type: TokenType.CROSS_CHAIN,
adapters: [AdapterType.CCIP_TOKEN],
address: convertToGenericAddress("0x88A2d74F47a237a62e7A51cdDa67270CE381555e" as EvmAddress, ChainType.EVM),
decimals: 18,
},
folksTokenId: TESTNET_FOLKS_TOKEN_ID.CCIP_BnM,
poolId: TESTNET_POOLS[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM],
spokeAddress: convertToGenericAddress(
"0x810c0299ED1FB9a3e36583e0835a697766810dBa" as EvmAddress,
ChainType.EVM,
),
},
},
},
[FOLKS_CHAIN_ID.BSC_TESTNET]: {
Expand All @@ -743,6 +785,10 @@ export const SPOKE_CHAIN: Record<NetworkType, Partial<Record<FolksChainId, Spoke
"0xE4C1cdE52ab51DD9495dbB938EA0BE332C37519A" as EvmAddress,
ChainType.EVM,
),
[AdapterType.CCIP_TOKEN]: convertToGenericAddress(
"0x4B466063f81E1a4aD6D730ab836D92D709F9D7a6" as EvmAddress,
ChainType.EVM,
),
},
tokens: {
[TESTNET_FOLKS_TOKEN_ID.BNB]: {
Expand All @@ -757,6 +803,20 @@ export const SPOKE_CHAIN: Record<NetworkType, Partial<Record<FolksChainId, Spoke
ChainType.EVM,
),
},
[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM]: {
token: {
type: TokenType.CROSS_CHAIN,
adapters: [AdapterType.CCIP_TOKEN],
address: convertToGenericAddress("0xbFA2ACd33ED6EEc0ed3Cc06bF1ac38d22b36B9e9" as EvmAddress, ChainType.EVM),
decimals: 18,
},
folksTokenId: TESTNET_FOLKS_TOKEN_ID.CCIP_BnM,
poolId: TESTNET_POOLS[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM],
spokeAddress: convertToGenericAddress(
"0x2fD94F6B9A56879f31c14Ef1723F1315eff81d42" as EvmAddress,
ChainType.EVM,
),
},
},
},
[FOLKS_CHAIN_ID.ARBITRUM_SEPOLIA]: {
Expand Down Expand Up @@ -814,6 +874,20 @@ export const SPOKE_CHAIN: Record<NetworkType, Partial<Record<FolksChainId, Spoke
ChainType.EVM,
),
},
[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM]: {
token: {
type: TokenType.CROSS_CHAIN,
adapters: [AdapterType.CCIP_TOKEN],
address: convertToGenericAddress("0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D" as EvmAddress, ChainType.EVM),
decimals: 18,
},
folksTokenId: TESTNET_FOLKS_TOKEN_ID.CCIP_BnM,
poolId: TESTNET_POOLS[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM],
spokeAddress: convertToGenericAddress(
"0x5699D9efdF6F618e838E62db2C4A8d341C329EC8" as EvmAddress,
ChainType.EVM,
),
},
},
},
} satisfies Record<TestnetFolksChainId, SpokeChain>,
Expand Down
1 change: 1 addition & 0 deletions src/common/constants/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const TESTNET_POOLS = {
[TESTNET_FOLKS_TOKEN_ID.ETH_arb_sep]: 132,
[TESTNET_FOLKS_TOKEN_ID.LINK_eth_sep]: 133,
[TESTNET_FOLKS_TOKEN_ID.BNB]: 134,
[TESTNET_FOLKS_TOKEN_ID.CCIP_BnM]: 135,
} as const satisfies Record<TestnetFolksTokenId, number>;

export const FOLKS_TOKEN_IDS_FROM_POOL = Object.fromEntries(
Expand Down
1 change: 1 addition & 0 deletions src/common/constants/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export const CROSS_CHAIN_FOLKS_TOKEN_ID: Array<FolksTokenId> = [
MAINNET_FOLKS_TOKEN_ID.USDC,
MAINNET_FOLKS_TOKEN_ID.SolvBTC,
TESTNET_FOLKS_TOKEN_ID.USDC,
TESTNET_FOLKS_TOKEN_ID.CCIP_BnM,
];
1 change: 1 addition & 0 deletions src/common/types/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const TESTNET_FOLKS_TOKEN_ID = {
ETH_arb_sep: "ETH_arb_sep",
LINK_eth_sep: "LINK_eth_sep",
BNB: "BNB",
CCIP_BnM: "CCIP_BnM",
} as const;
export type TestnetFolksTokenId = (typeof TESTNET_FOLKS_TOKEN_ID)[keyof typeof TESTNET_FOLKS_TOKEN_ID];

Expand Down

0 comments on commit c06e160

Please sign in to comment.