Skip to content
Merged
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
266 changes: 248 additions & 18 deletions src/deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import type { ChainConfigInput } from './types';
export const ETH_MAINNET: ChainConfigInput = {
chainId: 1,
rpcUrl: 'https://ethereum.publicnode.com',
entryUrl: 'https://api.o.cash',
entryUrl: 'https://api.2.o.cash',
ocashContractAddress: '0x428c850be686E933DD641eE43574BA35f550c94c',
relayerUrl: 'https://relayer.eth.o.cash',
merkleProofUrl: 'https://freezer.eth.o.cash',
relayerUrl: 'https://relayer.eth.2.o.cash',
merkleProofUrl: 'https://freezer.eth.2.o.cash',
tokens: [
{
id: '17545360559498738825600693637092498593896721537850539876701260384379485779337',
id: '17595164354743444723297698020223780983460773731069812515171506209398782871945',
symbol: 'ETH',
decimals: 18,
wrappedErc20: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
Expand All @@ -25,7 +25,7 @@ export const ETH_MAINNET: ChainConfigInput = {
withdrawMaxAmount: '400000000000000000',
},
{
id: '21694853498936857802878675918794851809547521289097726489923935218185698877320',
id: '21640204178991867425931911000767762491078084062079932328636009352966450175880',
symbol: 'USDT',
decimals: 6,
wrappedErc20: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
Expand All @@ -37,7 +37,7 @@ export const ETH_MAINNET: ChainConfigInput = {
withdrawMaxAmount: '1100000000',
},
{
id: '11226050049409498505939496770765866974660028682723870027960291963252866049316',
id: '11192412709160715871399434149700721052294584597621908376064430435865462269220',
symbol: 'USDC',
decimals: 6,
wrappedErc20: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
Expand All @@ -58,13 +58,13 @@ export const ETH_MAINNET: ChainConfigInput = {
export const BSC_MAINNET: ChainConfigInput = {
chainId: 56,
rpcUrl: 'https://bsc-dataseed.binance.org',
entryUrl: 'https://api.o.cash',
entryUrl: 'https://api.2.o.cash',
ocashContractAddress: '0x428c850be686E933DD641eE43574BA35f550c94c',
relayerUrl: 'https://relayer.bsc.o.cash',
merkleProofUrl: 'https://freezer.bsc.o.cash',
relayerUrl: 'https://relayer.bsc.2.o.cash',
merkleProofUrl: 'https://freezer.bsc.2.o.cash',
tokens: [
{
id: '11043839122927653445789373545236174803416089780038640455250920783766024405069',
id: '11037965086205566856217936103016949331395694702756569955099449753284561290317',
symbol: 'BNB',
decimals: 18,
wrappedErc20: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
Expand All @@ -76,7 +76,7 @@ export const BSC_MAINNET: ChainConfigInput = {
withdrawMaxAmount: '1200000000000000000',
},
{
id: '1969159127143780299399846218651451936750283610785389753103427789478696961889',
id: '1981631595594724228397744359312123956227540930622148727812873268331495737185',
symbol: 'USDT',
decimals: 18,
wrappedErc20: '0x55d398326f99059fF775485246999027B3197955',
Expand All @@ -88,7 +88,7 @@ export const BSC_MAINNET: ChainConfigInput = {
withdrawMaxAmount: '1100000000000000000000',
},
{
id: '3177497449629755193483757929553534539571803936948283825289458505284757894932',
id: '3192989405216818827563861819689583138579169414249476268811787508873339990804',
symbol: 'USDC',
decimals: 18,
wrappedErc20: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d',
Expand All @@ -104,15 +104,41 @@ export const BSC_MAINNET: ChainConfigInput = {

/**
* OCash mainnet deployment — Base (Chain ID 8453).
* Pools are loaded dynamically from contract.
* Pools: ETH, USDC.
*/
export const BASE_MAINNET: ChainConfigInput = {
chainId: 8453,
rpcUrl: 'https://mainnet.base.org',
entryUrl: 'https://api.2.o.cash',
ocashContractAddress: '0x428c850be686E933DD641eE43574BA35f550c94c',
relayerUrl: 'https://relayer.base.2.o.cash',
merkleProofUrl: 'https://freezer.base.2.o.cash',
tokens: [],
tokens: [
{
id: '17595164354743444723297698020223780983460773731069812515171506209398782871945',
symbol: 'ETH',
decimals: 18,
wrappedErc20: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
viewerPk: ['10431080094083715294994831484153042002358206676578707988845164128739412116223', '19779949618985856145522409496192533589639440661307361841631626271154462919413'],
freezerPk: ['4669474039172149691654565526011752760208335185174811747074129322851928951709', '13559226903331282409026052744251929479054127336193904689356637527155192056962'],
depositFeeBps: 0,
withdrawFeeBps: 25,
transferMaxAmount: '400000000000000000',
withdrawMaxAmount: '400000000000000000',
},
{
id: '2531989942665478148833409094551414387300614843936817930992888865663216104433',
symbol: 'USDC',
decimals: 6,
wrappedErc20: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
viewerPk: ['16408202230502737808122446059528930220029255337981840633285060802361479283836', '17528225055965774467947477739977284695101684174817111739322691798291270386094'],
freezerPk: ['15980098794435051556981682500054353051595366679414420688044679627547667214405', '2904968504476045233800601625384230437775402181939804897702328669440256553067'],
depositFeeBps: 0,
withdrawFeeBps: 25,
transferMaxAmount: '1100000000',
withdrawMaxAmount: '1100000000',
},
],
};

/**
Expand Down Expand Up @@ -193,8 +219,212 @@ export const BSC_TESTNET: ChainConfigInput = {
],
};

/** All mainnet chain configs. */
export const MAINNET_CHAINS: ChainConfigInput[] = [ETH_MAINNET, BSC_MAINNET, BASE_MAINNET];
const DEV_HASH = '4ec4cc67111f840b';
const DEV_CONTRACT = '0x3d8538C0CEDD632F12E258CcDD7397Bc9FC85b44' as const;
const devEntry = `https://${DEV_HASH}-entry.dev.o.cash`;
const devRelayer = (chain: string) => `https://${DEV_HASH}-relayer-${chain}.dev.o.cash`;
const devFreezer = (chain: string) => `https://${DEV_HASH}-freezer-${chain}.dev.o.cash`;

/** OCash dev deployment — ETH (Chain ID 1). Pools: ETH, USDT, USDC. */
export const ETH_DEV: ChainConfigInput = {
chainId: 1,
rpcUrl: 'https://ethereum.publicnode.com',
entryUrl: devEntry,
ocashContractAddress: DEV_CONTRACT,
relayerUrl: devRelayer('eth'),
merkleProofUrl: devFreezer('eth'),
tokens: [
{
id: '17595164354743444723297698020223780983460773731069812515171506209398782871945',
symbol: 'ETH',
decimals: 18,
wrappedErc20: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
viewerPk: ['10431080094083715294994831484153042002358206676578707988845164128739412116223', '19779949618985856145522409496192533589639440661307361841631626271154462919413'],
freezerPk: ['4669474039172149691654565526011752760208335185174811747074129322851928951709', '13559226903331282409026052744251929479054127336193904689356637527155192056962'],
depositFeeBps: 0,
withdrawFeeBps: 0,
transferMaxAmount: '400000000000000000',
withdrawMaxAmount: '400000000000000000',
},
{
id: '21640204178991867425931911000767762491078084062079932328636009352966450175880',
symbol: 'USDT',
decimals: 6,
wrappedErc20: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
viewerPk: ['16705602615272268567003522975712421097082383063417679753060534780702444376151', '14514464143093266825290311242522740387541372997639894559538766466467730361203'],
freezerPk: ['12575519572146277363559222067073217394207912146376135522069598095499837742570', '20535825957543427476664044300935290889134231934616628729189553228696621211842'],
depositFeeBps: 0,
withdrawFeeBps: 0,
transferMaxAmount: '1100000000',
withdrawMaxAmount: '1100000000',
},
{
id: '11192412709160715871399434149700721052294584597621908376064430435865462269220',
symbol: 'USDC',
decimals: 6,
wrappedErc20: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
viewerPk: ['16408202230502737808122446059528930220029255337981840633285060802361479283836', '17528225055965774467947477739977284695101684174817111739322691798291270386094'],
freezerPk: ['15980098794435051556981682500054353051595366679414420688044679627547667214405', '2904968504476045233800601625384230437775402181939804897702328669440256553067'],
depositFeeBps: 0,
withdrawFeeBps: 0,
transferMaxAmount: '1100000000',
withdrawMaxAmount: '1100000000',
},
],
};

/** OCash dev deployment — BSC (Chain ID 56). Pools: BNB, USDT, USDC. */
export const BSC_DEV: ChainConfigInput = {
chainId: 56,
rpcUrl: 'https://bsc-dataseed.binance.org',
entryUrl: devEntry,
ocashContractAddress: DEV_CONTRACT,
relayerUrl: devRelayer('bsc'),
merkleProofUrl: devFreezer('bsc'),
tokens: [
{
id: '11037965086205566856217936103016949331395694702756569955099449753284561290317',
symbol: 'BNB',
decimals: 18,
wrappedErc20: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
viewerPk: ['2309793049357517448142321114460369309441946778252028524336988707673525672394', '5292166541938152970826407775516613758839325710048237682058131618937496773037'],
freezerPk: ['15028649808275023419560920538322062726247816239833812196442442458279069670264', '7903652073623022193600601685964664648321872063306669757515720575130332270436'],
depositFeeBps: 0,
withdrawFeeBps: 0,
transferMaxAmount: '1200000000000000000',
withdrawMaxAmount: '1200000000000000000',
},
{
id: '1981631595594724228397744359312123956227540930622148727812873268331495737185',
symbol: 'USDT',
decimals: 18,
wrappedErc20: '0x55d398326f99059fF775485246999027B3197955',
viewerPk: ['8400168527137830145081217535414518411779514482117693172611259130549021548989', '1261397819989223099152893934461722757575091710731435255910419325283575812925'],
freezerPk: ['659749145987120603531117326148363604949154202537727562906479440611968845724', '17813396953204707572555397363539007301144589839857358093914040365539381830529'],
depositFeeBps: 0,
withdrawFeeBps: 0,
transferMaxAmount: '1100000000000000000000',
withdrawMaxAmount: '1100000000000000000000',
},
{
id: '3192989405216818827563861819689583138579169414249476268811787508873339990804',
symbol: 'USDC',
decimals: 18,
wrappedErc20: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d',
viewerPk: ['15426941078324356391962087739725964566987354126369627941001992221614158366184', '7926725070883903362121983237810319503556998500983795297359593812964095807270'],
freezerPk: ['12191455112750858004776142581318299249626585524485520874715090117200793071154', '9077996288718299849424958996852385225019490548278701136796749334245970034895'],
depositFeeBps: 0,
withdrawFeeBps: 0,
transferMaxAmount: '1100000000000000000000',
withdrawMaxAmount: '1100000000000000000000',
},
],
};

/** OCash dev deployment — Base (Chain ID 8453). Pools: ETH, USDC. */
export const BASE_DEV: ChainConfigInput = {
chainId: 8453,
rpcUrl: 'https://mainnet.base.org',
entryUrl: devEntry,
ocashContractAddress: DEV_CONTRACT,
relayerUrl: devRelayer('base'),
merkleProofUrl: devFreezer('base'),
tokens: [
{
id: '17595164354743444723297698020223780983460773731069812515171506209398782871945',
symbol: 'ETH',
decimals: 18,
wrappedErc20: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
viewerPk: ['10431080094083715294994831484153042002358206676578707988845164128739412116223', '19779949618985856145522409496192533589639440661307361841631626271154462919413'],
freezerPk: ['4669474039172149691654565526011752760208335185174811747074129322851928951709', '13559226903331282409026052744251929479054127336193904689356637527155192056962'],
depositFeeBps: 0,
withdrawFeeBps: 0,
transferMaxAmount: '400000000000000000',
withdrawMaxAmount: '400000000000000000',
},
{
id: '2531989942665478148833409094551414387300614843936817930992888865663216104433',
symbol: 'USDC',
decimals: 6,
wrappedErc20: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
viewerPk: ['16408202230502737808122446059528930220029255337981840633285060802361479283836', '17528225055965774467947477739977284695101684174817111739322691798291270386094'],
freezerPk: ['15980098794435051556981682500054353051595366679414420688044679627547667214405', '2904968504476045233800601625384230437775402181939804897702328669440256553067'],
depositFeeBps: 0,
withdrawFeeBps: 0,
transferMaxAmount: '1100000000',
withdrawMaxAmount: '1100000000',
},
],
};

/** OCash dev deployment — Sepolia (Chain ID 11155111). Pools: ETH, tUSDT. */
export const SEPOLIA_DEV: ChainConfigInput = {
chainId: 11155111,
rpcUrl: 'https://sepolia.drpc.org',
entryUrl: devEntry,
ocashContractAddress: DEV_CONTRACT,
relayerUrl: devRelayer('sepolia'),
merkleProofUrl: devFreezer('sepolia'),
tokens: [
{
id: '17595164354743444723297698020223780983460773731069812515171506209398782871945',
symbol: 'ETH',
decimals: 18,
wrappedErc20: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
viewerPk: ['10431080094083715294994831484153042002358206676578707988845164128739412116223', '19779949618985856145522409496192533589639440661307361841631626271154462919413'],
freezerPk: ['4669474039172149691654565526011752760208335185174811747074129322851928951709', '13559226903331282409026052744251929479054127336193904689356637527155192056962'],
depositFeeBps: 0,
withdrawFeeBps: 0,
transferMaxAmount: '340282366920938463463374607431768211455',
withdrawMaxAmount: '340282366920938463463374607431768211455',
},
{
id: '14880450956444241072894828158264802787637197896840919915927253631318375660820',
symbol: 'tUSDT',
decimals: 18,
wrappedErc20: '0xa88C08409342E95e5A05CB95f5EcC267E1F4f102',
viewerPk: ['16705602615272268567003522975712421097082383063417679753060534780702444376151', '14514464143093266825290311242522740387541372997639894559538766466467730361203'],
freezerPk: ['12575519572146277363559222067073217394207912146376135522069598095499837742570', '20535825957543427476664044300935290889134231934616628729189553228696621211842'],
depositFeeBps: 0,
withdrawFeeBps: 0,
transferMaxAmount: '340282366920938463463374607431768211455',
withdrawMaxAmount: '340282366920938463463374607431768211455',
},
],
};

/** All testnet chain configs. */
export const TESTNET_CHAINS: ChainConfigInput[] = [SEPOLIA_TESTNET, BSC_TESTNET];
/** OCash dev deployment — BSC Testnet (Chain ID 97). Pools: BNB, tUSDT. */
export const BSC_TESTNET_DEV: ChainConfigInput = {
chainId: 97,
rpcUrl: 'https://data-seed-prebsc-1-s1.bnbchain.org:8545',
entryUrl: devEntry,
ocashContractAddress: DEV_CONTRACT,
relayerUrl: devRelayer('bsctestnet'),
merkleProofUrl: devFreezer('bsctestnet'),
tokens: [
{
id: '17595164354743444723297698020223780983460773731069812515171506209398782871945',
symbol: 'BNB',
decimals: 18,
wrappedErc20: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
viewerPk: ['10431080094083715294994831484153042002358206676578707988845164128739412116223', '19779949618985856145522409496192533589639440661307361841631626271154462919413'],
freezerPk: ['4669474039172149691654565526011752760208335185174811747074129322851928951709', '13559226903331282409026052744251929479054127336193904689356637527155192056962'],
depositFeeBps: 0,
withdrawFeeBps: 0,
transferMaxAmount: '340282366920938463463374607431768211455',
withdrawMaxAmount: '340282366920938463463374607431768211455',
},
{
id: '691101997437781201062208285139214150313744022627571716486227682674885189667',
symbol: 'tUSDT',
decimals: 18,
wrappedErc20: '0xa7Ae7a38EB9929753Deb8B100627D2bfa060eC91',
viewerPk: ['16705602615272268567003522975712421097082383063417679753060534780702444376151', '14514464143093266825290311242522740387541372997639894559538766466467730361203'],
freezerPk: ['12575519572146277363559222067073217394207912146376135522069598095499837742570', '20535825957543427476664044300935290889134231934616628729189553228696621211842'],
depositFeeBps: 0,
withdrawFeeBps: 0,
transferMaxAmount: '340282366920938463463374607431768211455',
withdrawMaxAmount: '340282366920938463463374607431768211455',
},
],
};
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export { BABYJUBJUB_SCALAR_FIELD } from './crypto/babyJubjub';
export { calcTransferProofBinding, calcWithdrawProofBinding } from './utils/ocashBindings';
export { App_ABI } from './abi/app';
export { MemoryStore } from './store/memoryStore';
export { ETH_MAINNET, BSC_MAINNET, BASE_MAINNET, SEPOLIA_TESTNET, BSC_TESTNET, MAINNET_CHAINS, TESTNET_CHAINS } from './deployments';
export { ETH_MAINNET, BSC_MAINNET, BASE_MAINNET, SEPOLIA_TESTNET, BSC_TESTNET, ETH_DEV, BSC_DEV, BASE_DEV, SEPOLIA_DEV, BSC_TESTNET_DEV } from './deployments';
export { KeyValueStore, type KeyValueStoreOptions, type KeyValueClient } from './store/keyValueStore';
export { RedisStore, type RedisStoreOptions } from './store/redisStore';
export { SqliteStore, type SqliteStoreOptions } from './store/sqliteStore';
Expand Down