Skip to content

Commit

Permalink
feat: add joe (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
palace22 authored Dec 19, 2024
1 parent 5f9ee3f commit cbef524
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/five-mirrors-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@folks-finance/xchain-sdk": patch
---

Added JOE ERC-20 token
4 changes: 4 additions & 0 deletions src/chains/evm/common/constants/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export const CONTRACT_SLOT: Partial<
balanceOf: BigInt("37439836327923360225337895871394760624280537466773280374265222508165906222592"),
allowance: BigInt("37439836327923360225337895871394760624280537466773280374265222508165906222593"),
},
[MAINNET_FOLKS_TOKEN_ID.JOE]: {
balanceOf: 0n,
allowance: 1n,
},
},
},
[EVM_FOLKS_CHAIN_ID.ETHEREUM]: {
Expand Down
10 changes: 10 additions & 0 deletions src/chains/evm/hub/constants/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,16 @@ export const HUB_CHAIN: Record<NetworkType, HubChain> = {
poolAddress: convertToGenericAddress("0x307bCEC89624660Ed06C97033EDb7eF49Ab0EB2D" as EvmAddress, ChainType.EVM),
supportedLoanTypes: new Set([LoanTypeId.DEPOSIT, LoanTypeId.GENERAL]),
},
[MAINNET_FOLKS_TOKEN_ID.JOE]: {
token: {
type: TokenType.ERC20,
decimals: 18,
},
folksTokenId: MAINNET_FOLKS_TOKEN_ID.JOE,
poolId: MAINNET_POOLS[MAINNET_FOLKS_TOKEN_ID.JOE],
poolAddress: convertToGenericAddress("0x5e5a2007a8D613C4C98F425097166095C875e6eE" as EvmAddress, ChainType.EVM),
supportedLoanTypes: new Set([LoanTypeId.DEPOSIT, LoanTypeId.GENERAL]),
},
} satisfies Record<MainnetFolksTokenId, HubTokenData>,
rewardsV1Address: convertToGenericAddress(
"0x7c532A6209350cF27EfC3D06E82E35ACFd362C7C" as EvmAddress,
Expand Down
13 changes: 13 additions & 0 deletions src/common/constants/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,19 @@ export const SPOKE_CHAIN: Record<NetworkType, Partial<Record<FolksChainId, Spoke
ChainType.EVM,
),
},
[MAINNET_FOLKS_TOKEN_ID.JOE]: {
token: {
type: TokenType.ERC20,
address: convertToGenericAddress("0x6e84a6216ea6dacc71ee8e6b0a5b7322eebc0fdd" as EvmAddress, ChainType.EVM),
decimals: 18,
},
folksTokenId: MAINNET_FOLKS_TOKEN_ID.JOE,
poolId: MAINNET_POOLS[MAINNET_FOLKS_TOKEN_ID.JOE],
spokeAddress: convertToGenericAddress(
"0x3b1C2eC8B7cdE241E0890C9742C14dD7867aA812" as EvmAddress,
ChainType.EVM,
),
},
},
},
[FOLKS_CHAIN_ID.ETHEREUM]: {
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 @@ -19,6 +19,7 @@ export const MAINNET_POOLS = {
[MAINNET_FOLKS_TOKEN_ID.ETH_arb]: 13,
[MAINNET_FOLKS_TOKEN_ID.ARB]: 14,
[MAINNET_FOLKS_TOKEN_ID.SolvBTC]: 15,
[MAINNET_FOLKS_TOKEN_ID.JOE]: 16,
} as const satisfies Record<MainnetFolksTokenId, number>;

export const TESTNET_POOLS = {
Expand Down
1 change: 1 addition & 0 deletions src/common/types/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const MAINNET_FOLKS_TOKEN_ID = {
ETH_arb: "ETH_arb",
ARB: "ARB",
SolvBTC: "SolvBTC",
JOE: "JOE",
} as const;
export type MainnetFolksTokenId = (typeof MAINNET_FOLKS_TOKEN_ID)[keyof typeof MAINNET_FOLKS_TOKEN_ID];

Expand Down

0 comments on commit cbef524

Please sign in to comment.