diff --git a/apps/indexer/.env-sample b/apps/indexer/.env-sample index 8d6c745e8..f2a93eb39 100644 --- a/apps/indexer/.env-sample +++ b/apps/indexer/.env-sample @@ -4,3 +4,4 @@ SEPOLIA_RPC=https://eth-sepolia.g.alchemy.com/v2/xxx ISSUER_KEY=xxx ISSUER_ADDRESS=0x DFUSE_API_KEY=server_xxx +ALCHEMY_API_KEY=xxx \ No newline at end of file diff --git a/apps/indexer/package.json b/apps/indexer/package.json index ca2e8f2c2..c89d5e6a9 100644 --- a/apps/indexer/package.json +++ b/apps/indexer/package.json @@ -19,15 +19,15 @@ "@repo/supabase": "workspace:*", "@sentry/node": "^8.19.0", "@supabase/supabase-js": "^2.44.4", + "app-contracts": "workspace:*", + "app-env": "workspace:*", + "app-lib": "workspace:*", "axios": "^1.7.2", "bn.js": "^5.2.1", "express": "^4.19.2", "lodash": "^4.17.21", "node-fetch": "2.6.4", "resend": "^3.5.0", - "app-contracts": "workspace:*", - "app-env": "workspace:*", - "app-lib": "workspace:*", "viem": "latest", "ws": "^8.18.0" }, diff --git a/apps/indexer/src/index.ts b/apps/indexer/src/index.ts index 3041c421b..927bde688 100644 --- a/apps/indexer/src/index.ts +++ b/apps/indexer/src/index.ts @@ -1,14 +1,16 @@ import { getErrorMessage } from 'app-lib' -import { startAuctionIndexer } from './modules/auction' -import { startSwapsService } from './modules/swaps' +// import { startAuctionIndexer } from './modules/auction' +// import { startSwapsService } from './modules/swaps' import { startExpress } from './routes/healthcheck' +import { startPresaleService } from './modules/presale' async function main() { console.log(`Launchpad indexer starting up ...`) try { startExpress() - startAuctionIndexer() - startSwapsService() + startPresaleService() + // startAuctionIndexer() + // startSwapsService() } catch (error) { console.log('ERROR:' + getErrorMessage(error), JSON.stringify(error)) } diff --git a/apps/indexer/src/lib/evm-client.ts b/apps/indexer/src/lib/issuer-client.ts similarity index 63% rename from apps/indexer/src/lib/evm-client.ts rename to apps/indexer/src/lib/issuer-client.ts index 2eae608e7..10abb03ab 100644 --- a/apps/indexer/src/lib/evm-client.ts +++ b/apps/indexer/src/lib/issuer-client.ts @@ -1,13 +1,7 @@ import { http, createPublicClient, PublicClient, createWalletClient } from 'viem' -import { sepolia } from 'viem/chains' import { appenv } from '../config' import { eosEvmTestnet } from 'app-env' -export const client: PublicClient = createPublicClient({ - chain: eosEvmTestnet, - transport: http(), -}) - export const walletClient = createWalletClient({ chain: eosEvmTestnet, transport: http(), @@ -15,20 +9,12 @@ export const walletClient = createWalletClient({ account: appenv.evm.issuerAccount, }) -export const sepoliaClient: PublicClient = createPublicClient({ - chain: { - ...sepolia, - rpcUrls: { - default: { - http: [appenv.evm.sepoliaApi], - }, - }, - }, - transport: http(), -}) - export async function getCurrentBlockHeight() { try { + const client = createPublicClient({ + chain: eosEvmTestnet, + transport: http(), + }) const blockNumber = await client.getBlockNumber() return blockNumber } catch (error) { diff --git a/apps/indexer/src/lib/utils.ts b/apps/indexer/src/lib/utils.ts index c1046d5c1..70cf5a84a 100644 --- a/apps/indexer/src/lib/utils.ts +++ b/apps/indexer/src/lib/utils.ts @@ -1,7 +1,7 @@ import fs from 'fs/promises' import { erc20Abi } from 'abitype/abis' -import { client } from './evm-client' -import { Abi, Address, parseUnits } from 'viem' +import {Abi, Address, parseUnits, http, createPublicClient} from 'viem'; +import {eosEvmTestnet} from 'app-env'; export async function writeToFile(data: string, filePath: string) { try { @@ -38,6 +38,10 @@ export function runPromisesInSeries( } export async function getTokenDetails({ address }: { address: Address }) { + const client = createPublicClient({ + chain: eosEvmTestnet, + transport: http(), + }) const results = await client.multicall({ contracts: [ { diff --git a/apps/indexer/src/modules/auction/auction-indexer.ts b/apps/indexer/src/modules/auction/auction-indexer.ts index ca8c399b1..bdd344051 100644 --- a/apps/indexer/src/modules/auction/auction-indexer.ts +++ b/apps/indexer/src/modules/auction/auction-indexer.ts @@ -1,5 +1,4 @@ -import { Log, stringify } from 'viem' -import { client } from '~/lib/evm-client' +import {Log, stringify, http, createPublicClient} from 'viem'; import { TestnetEasyAuction } from 'app-contracts' import { bigintToPostgresTimestamp, @@ -7,8 +6,7 @@ import { getTokenDetails, runPromisesInSeries, } from '~/lib/utils' -import { NewAuctionEvent, NewSellOrderEvent, NewUserEvent } from '~/modules/auction/auction.type' - +import { NewAuctionEvent, NewSellOrderEvent, NewUserEvent } from './auction.type' import BN from 'bn.js' import { eosEvmTestnet } from 'app-env' import { upsertAuctionDetail, upsertOrder } from '~/lib/supabase-client' @@ -16,6 +14,12 @@ import { upsertAuctionDetail, upsertOrder } from '~/lib/supabase-client' export async function startAuctionIndexer() { console.log('indexing starting') + // TODO: create client for + const client = createPublicClient({ + chain: eosEvmTestnet, + transport: http(), + }) + // await writeToFile(stringify(TestnetEasyAuction.getEvents(), null, 2), './events.json') // Get historical event logs const blockNumber = await client.getBlockNumber() diff --git a/apps/indexer/src/modules/auction/easyauction.ts b/apps/indexer/src/modules/auction/easyauction.ts index 804fe5287..4bf6717f4 100644 --- a/apps/indexer/src/modules/auction/easyauction.ts +++ b/apps/indexer/src/modules/auction/easyauction.ts @@ -1,6 +1,11 @@ -import { getContract } from 'viem' -import { client } from '../../lib/evm-client' +import {getContract, http, createPublicClient} from 'viem'; import { TestnetEasyAuction } from 'app-contracts' +import {eosEvmTestnet} from 'app-env'; + + const client = createPublicClient({ + chain: eosEvmTestnet, + transport: http(), + }) export const easyAuction = getContract({ ...TestnetEasyAuction, diff --git a/apps/indexer/src/modules/presale/eos-contributions.ts b/apps/indexer/src/modules/presale/eos-contributions.ts index a70535d2f..cf5ad8a0e 100644 --- a/apps/indexer/src/modules/presale/eos-contributions.ts +++ b/apps/indexer/src/modules/presale/eos-contributions.ts @@ -1,7 +1,7 @@ import { smartsaleEnv } from 'app-env' import { stringify } from 'viem/utils' import { createFirehoseSubscription } from '~/lib/dfuse-client' -import { issueTokens } from './presale-issuer' +import { issuePresaleTokens } from './presale-issuer' // https://docs.dfuse.eosnation.io/platform/public-apis/search-query-language/ // https://docs.dfuse.eosnation.io/eosio/public-apis/reference/search/terms/ @@ -30,7 +30,7 @@ export async function listenToEosContributions(env: 'test' | 'prod' = 'test') { async function handleDeposit(data: { trxId: string; from: string; quantity: string }) { console.log('handle deposit', data) - const response = await issueTokens( + const response = await issuePresaleTokens( '0x7472312e4e1a373df751f84bd871a4c7a16128fa', BigInt(data.quantity), ) diff --git a/apps/indexer/src/modules/presale/evm-contributions.ts b/apps/indexer/src/modules/presale/evm-contributions.ts index 86880c854..8a2fc4805 100644 --- a/apps/indexer/src/modules/presale/evm-contributions.ts +++ b/apps/indexer/src/modules/presale/evm-contributions.ts @@ -1,12 +1,11 @@ -import { EVMTokenContractData, SepoliaUSDT, TestnetUSDT } from 'app-contracts' +import { EVMTokenContractData, appContracts } from 'app-contracts' import { runPromisesInSeries } from '~/lib/utils' - import { Address, Log, PublicClient, createPublicClient, http, parseAbiItem, stringify } from 'viem' import { TransferEvent } from '~/modules/auction/auction.type' import { sepolia } from 'viem/chains' -import { smartsaleChains } from 'app-env' -const tokens: EVMTokenContractData[] = [SepoliaUSDT, TestnetUSDT] +const presaleWallet = '0xf7bb6BD787FFbA43539219560E3B8162Ba8EEF09' +const tokens: EVMTokenContractData[] = appContracts.dev.tokens.evm && appContracts.prod.tokens.evm export async function listenToEvmContributions() { console.log('subscribing to evm usdt transfers ...') @@ -14,11 +13,9 @@ export async function listenToEvmContributions() { } async function listenToEvmTransfersFn(token: EVMTokenContractData) { - const chain = smartsaleChains.dev.get(token.chainId) - if (!chain) return - console.log(`listening usdt transfers for token ${token.symbol} on chain ${chain.name}`) + console.log(`listening usdt transfers for token ${token.symbol} on chain ${token.chain.name}`) const client: PublicClient = createPublicClient({ - chain, + chain: token.chain, transport: http(), }) try { @@ -28,7 +25,7 @@ async function listenToEvmTransfersFn(token: EVMTokenContractData) { 'event Transfer(address indexed from, address indexed to, uint256 value)', ), args: { - to: '0x2C9DAAb3F463d6c6D248aCbeaAEe98687936374a', + to: presaleWallet, }, fromBlock: BigInt(token.indexFromBlock), }) @@ -43,7 +40,7 @@ async function listenToEvmTransfersFn(token: EVMTokenContractData) { 'event Transfer(address indexed from, address indexed to, uint256 value)', ), args: { - to: '0x2C9DAAb3F463d6c6D248aCbeaAEe98687936374a', + to: presaleWallet, }, onLogs: (logs) => { console.log('real time transfer', stringify(logs, null, 2)) @@ -88,30 +85,16 @@ async function handleTransfer(log: TransferEvent) { amount: log.args.value, token: log.address, chain_id: sepolia.id, - type: 'deposit', + type: 'presale', } - // const result = await db.transfers.upsert({ - // where: { - // trx_hash: log.transactionHash!, - // }, - // update: data, - // create: data, - // }) + console.log('new transfer') + console.log(data) // console.log('result', result) // if (result.usdcred_trx || data.from === '0x0000000000000000000000000000000000000000') return - // const usdcred_trx = (await issueTokens(data.from, data.amount)) as Address - - // if (!usdcred_trx) return - - // await db.transfers.update({ - // where: { - // trx_hash: log.transactionHash!, - // }, - // data: { usdcred_trx }, - // }) + // const usdcred_trx = (await issuePresaleTokens(data.from, data.amount)) as Address // console.log('tokens issued', { usdcred_trx, trx: log.transactionHash }) } diff --git a/apps/indexer/src/modules/presale/index.ts b/apps/indexer/src/modules/presale/index.ts index b32750218..370ee565c 100644 --- a/apps/indexer/src/modules/presale/index.ts +++ b/apps/indexer/src/modules/presale/index.ts @@ -2,6 +2,7 @@ import { listenToEosContributions } from './eos-contributions' import { listenToEvmContributions } from './evm-contributions' export function startPresaleService() { - listenToEosContributions() + console.log('starting presale service') + // listenToEosContributions() listenToEvmContributions() } diff --git a/apps/indexer/src/modules/presale/presale-issuer.ts b/apps/indexer/src/modules/presale/presale-issuer.ts index 1014aebf9..e53995de3 100644 --- a/apps/indexer/src/modules/presale/presale-issuer.ts +++ b/apps/indexer/src/modules/presale/presale-issuer.ts @@ -1,10 +1,10 @@ -import { TestnetUSDCred } from 'app-contracts' +import { TestnetBLPL } from 'app-contracts' import { eosEvmTestnet } from 'app-env' import { createWalletClient } from 'viem' import { appenv } from '~/config' import { Address, http } from 'viem' -export async function issueTokens(to: Address, amount: bigint) { +export async function issuePresaleTokens(to: Address, amount: bigint) { console.log('issueTokens', { args: [to, amount], }) @@ -17,8 +17,8 @@ export async function issueTokens(to: Address, amount: bigint) { account: appenv.evm.issuerAccount, }) return walletClient.writeContract({ - address: TestnetUSDCred.address, - abi: TestnetUSDCred.abi, + address: TestnetBLPL.address, + abi: TestnetBLPL.abi, functionName: 'issue', args: [to, amount], }) diff --git a/apps/indexer/src/modules/swaps/evm-transfers.ts b/apps/indexer/src/modules/swaps/evm-transfers.ts index 84615820b..94796bc4d 100644 --- a/apps/indexer/src/modules/swaps/evm-transfers.ts +++ b/apps/indexer/src/modules/swaps/evm-transfers.ts @@ -1,12 +1,12 @@ -import { EVMTokenContractData, SepoliaUSDT, TestnetUSDT } from 'app-contracts' +import { EVMTokenContractData, SepoliaUSDT, TestnetUSDT, appContracts } from 'app-contracts' import { runPromisesInSeries } from '~/lib/utils' import { Address, Log, PublicClient, createPublicClient, http, parseAbiItem, stringify } from 'viem' import { TransferEvent } from '~/modules/auction/auction.type' import { sepolia } from 'viem/chains' -import { smartsaleChains } from 'app-env' +import { appChains } from 'app-env' -const tokens: EVMTokenContractData[] = [SepoliaUSDT, TestnetUSDT] +const tokens: EVMTokenContractData[] = appContracts.dev.tokens.evm export async function listenToEvmTransfers() { console.log('subscribing to evm usdt transfers ...') @@ -14,7 +14,7 @@ export async function listenToEvmTransfers() { } async function listenToEvmTransfersFn(token: EVMTokenContractData) { - const chain = smartsaleChains.dev.get(token.chainId) + const chain = appChains.dev.get(token.chainId) if (!chain) return console.log(`listening usdt transfers for token ${token.symbol} on chain ${chain.name}`) const client: PublicClient = createPublicClient({ diff --git a/apps/indexer/src/routes/healthcheck.ts b/apps/indexer/src/routes/healthcheck.ts index 80ac68115..84f683f7f 100644 --- a/apps/indexer/src/routes/healthcheck.ts +++ b/apps/indexer/src/routes/healthcheck.ts @@ -1,5 +1,5 @@ import express from 'express' -import { getCurrentBlockHeight } from '../lib/evm-client' +import { getCurrentBlockHeight } from '../lib/issuer-client' export function startExpress() { const app = express() diff --git a/bun.lockb b/bun.lockb index 670be8102..7c97f07e9 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/hardhat/erc20-token/bun.lockb b/hardhat/erc20-token/bun.lockb new file mode 100755 index 000000000..97ba7b749 Binary files /dev/null and b/hardhat/erc20-token/bun.lockb differ diff --git a/hardhat/erc20-token/contracts/BLPLToken.sol b/hardhat/erc20-token/contracts/BLPLToken.sol new file mode 100644 index 000000000..68486ac65 --- /dev/null +++ b/hardhat/erc20-token/contracts/BLPLToken.sol @@ -0,0 +1,35 @@ + +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.0 <0.8.0; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; + +import "@openzeppelin/contracts/access/Ownable.sol"; + +contract BLPLToken is ERC20, Ownable { + constructor(uint256 initialSupply) ERC20("Bitlauncher Prelaunch Token", "BLPL") { + _mint(msg.sender, initialSupply); + } + + // use 6 decimals + function decimals() public view virtual override returns (uint8) { + return 6; + } + + /** + * @dev Issues a specific amount of tokens. + * @param recipient The address to which the issued tokens will be sent. + * @param amount The amount of tokens to be issued. + */ + function issue(address recipient, uint256 amount) public onlyOwner { + _mint(recipient, amount); + } + + /** + * @dev Burns a specific amount of tokens. + * @param amount The amount of tokens to be burned. + */ + function burn(uint256 amount) public { + _burn(msg.sender, amount); + } +} diff --git a/hardhat/erc20-token/package.json b/hardhat/erc20-token/package.json index 641ba3078..dae391e5b 100644 --- a/hardhat/erc20-token/package.json +++ b/hardhat/erc20-token/package.json @@ -6,7 +6,8 @@ "deployUSDCredMainnet": " hardhat run scripts/deployUSDCred.js --network eosevm_mainnet", "deployMBOTSPLTestnet": " hardhat run scripts/deployMBOTSPLWithFaucet.js --network eosevm_testnet", "deployUSDTSepolia": " hardhat run scripts/deployUSDTWithFaucet.js --network sepolia", - "deployUSDTTestnet": " hardhat run scripts/deployUSDTWithFaucet.js --network eosevm_testnet" + "deployUSDTTestnet": " hardhat run scripts/deployUSDTWithFaucet.js --network eosevm_testnet", + "deployBLPL": "hardhat run scripts/deployBLPL.js --network eosevm_testnet" }, "devDependencies": { "@nomiclabs/hardhat-ethers": "^2.0.2", @@ -15,5 +16,8 @@ "ethereum-waffle": "^3.4.0", "ethers": "^5.7.2", "hardhat": "^2.6.4" + }, + "dependencies": { + "@openzeppelin/contracts": "^3.3.0" } } \ No newline at end of file diff --git a/hardhat/erc20-token/scripts/deployBLPL.js b/hardhat/erc20-token/scripts/deployBLPL.js new file mode 100644 index 000000000..c844f5215 --- /dev/null +++ b/hardhat/erc20-token/scripts/deployBLPL.js @@ -0,0 +1,16 @@ + +const { ethers } = require("hardhat"); + +async function main() { + const BLPLToken = await ethers.getContractFactory("BLPLToken"); + const token = await BLPLToken.deploy(ethers.utils.parseUnits("1000000", 18)); + + await token.deployed(); + + console.log("BLPLToken deployed to:", token.address); +} + +main().catch((error) => { + console.error(error); + process.exitCode = 1; +}); diff --git a/hardhat/erc20-token/tsconfig.json b/hardhat/erc20-token/tsconfig.json new file mode 100644 index 000000000..db3499063 --- /dev/null +++ b/hardhat/erc20-token/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + // ... existing options ... + "module": "NodeNext", + "moduleResolution": "NodeNext" + }, + // ... existing options ... +} \ No newline at end of file diff --git a/packages/app-contracts/src/dev/testnet-allow-list.ts b/packages/app-contracts/src/dev/auction/testnet-allow-list.ts similarity index 94% rename from packages/app-contracts/src/dev/testnet-allow-list.ts rename to packages/app-contracts/src/dev/auction/testnet-allow-list.ts index 112873509..64e5ea3c1 100644 --- a/packages/app-contracts/src/dev/testnet-allow-list.ts +++ b/packages/app-contracts/src/dev/auction/testnet-allow-list.ts @@ -1,4 +1,5 @@ -import { EVMContractData } from "../types"; +import { sepolia } from "viem/chains"; +import { EVMContractData } from "../../types"; export const TestnetAllowList: EVMContractData = { address: "0x3D18904711fe451356eBA461B7747EA3Abff6c93", @@ -6,6 +7,7 @@ export const TestnetAllowList: EVMContractData = { chainId: 15557, chainType: "evm", chainName: "Sepolia", + chain: sepolia, abi: [ { inputs: [], diff --git a/packages/app-contracts/src/dev/testnet-deposit-order.ts b/packages/app-contracts/src/dev/auction/testnet-deposit-order.ts similarity index 94% rename from packages/app-contracts/src/dev/testnet-deposit-order.ts rename to packages/app-contracts/src/dev/auction/testnet-deposit-order.ts index 7e5b8c4e1..989c822a9 100644 --- a/packages/app-contracts/src/dev/testnet-deposit-order.ts +++ b/packages/app-contracts/src/dev/auction/testnet-deposit-order.ts @@ -1,4 +1,5 @@ -import { EVMContractData } from "../types"; +import { sepolia } from "viem/chains"; +import { EVMContractData } from "../../types"; export const TestnetDepositOrder: EVMContractData = { address: "0x4faA684A1E0Cdd7cb271b5424a12A2D039624D78", @@ -6,6 +7,7 @@ export const TestnetDepositOrder: EVMContractData = { chainId: 15557, chainType: "evm", chainName: "EOS EVM Tesnet", + chain: sepolia, abi: [ { inputs: [ diff --git a/packages/app-contracts/src/dev/testnet-easy-auction.ts b/packages/app-contracts/src/dev/auction/testnet-easy-auction.ts similarity index 99% rename from packages/app-contracts/src/dev/testnet-easy-auction.ts rename to packages/app-contracts/src/dev/auction/testnet-easy-auction.ts index ccd0e8fc3..fadea6d75 100644 --- a/packages/app-contracts/src/dev/testnet-easy-auction.ts +++ b/packages/app-contracts/src/dev/auction/testnet-easy-auction.ts @@ -1,4 +1,5 @@ -import { EVMContractData } from "../types"; +import { sepolia } from "viem/chains"; +import { EVMContractData } from "../../types"; export const TestnetEasyAuction: EVMContractData = { address: "0x8d37219725eB0088360f744A5d894035D0f88F82", @@ -6,6 +7,7 @@ export const TestnetEasyAuction: EVMContractData = { chainId: 15557, chainType: "evm", chainName: "EOS EVM Tesnet", + chain: sepolia, abi: [ { inputs: [], diff --git a/packages/app-contracts/src/dev/index.ts b/packages/app-contracts/src/dev/index.ts index 92e6e04c6..56e2c369f 100644 --- a/packages/app-contracts/src/dev/index.ts +++ b/packages/app-contracts/src/dev/index.ts @@ -1,8 +1,47 @@ -export * from "./testnet-easy-auction"; -export * from "./testnet-deposit-order"; -export * from "./testnet-usd-cred"; -export * from "./testnet-mbots-prelaunch"; -export * from "./sepolia-usdt"; -export * from "./testnet-usdt"; -export * from "./eos-fake-bitusd"; -export * from "./eos-fake-usdt"; + +import { TestnetEasyAuction } from "./auction/testnet-easy-auction"; +import { TestnetDepositOrder } from "./auction/testnet-deposit-order"; +import { TestnetUSDCred } from "./tokens/testnet-usd-cred"; +import { TestnetMBOTSPL } from "./tokens/testnet-mbots-prelaunch"; +import { SepoliaUSDT } from "./tokens/sepolia-usdt"; +import { TestnetUSDT } from "./tokens/testnet-usdt"; +import { EOSFakeBITUSD } from "./tokens/eos-fake-bitusd"; +import { EOSFakeUSDT } from "./tokens/eos-fake-usdt"; +import { TestnetBLPL } from "./tokens/testnet-blpl"; +import {ContractData, EOSTokenContractData, EVMTokenContractData} from '../types'; + + const evmTokens: EVMTokenContractData[] = [ + TestnetUSDCred, + TestnetMBOTSPL, + SepoliaUSDT, + TestnetUSDT, + TestnetBLPL +] + +const eosTokens: EOSTokenContractData[] = [ + EOSFakeBITUSD, + EOSFakeUSDT, +] + + const auctions: ContractData[] = [ + TestnetEasyAuction, + TestnetDepositOrder, +] + +export const devContracts = { + tokens: { + evm: evmTokens, + eos: eosTokens + }, + auctions +} + +export * from "./auction/testnet-easy-auction"; +export * from "./auction/testnet-deposit-order"; +export * from "./tokens/testnet-usd-cred"; +export * from "./tokens/testnet-mbots-prelaunch"; +export * from "./tokens/sepolia-usdt"; +export * from "./tokens/testnet-usdt"; +export * from "./tokens/eos-fake-bitusd"; +export * from "./tokens/eos-fake-usdt"; +export * from "./tokens/testnet-blpl"; diff --git a/packages/app-contracts/src/dev/eos-fake-bitusd.ts b/packages/app-contracts/src/dev/tokens/eos-fake-bitusd.ts similarity index 72% rename from packages/app-contracts/src/dev/eos-fake-bitusd.ts rename to packages/app-contracts/src/dev/tokens/eos-fake-bitusd.ts index d5fe50957..6c1a446d0 100644 --- a/packages/app-contracts/src/dev/eos-fake-bitusd.ts +++ b/packages/app-contracts/src/dev/tokens/eos-fake-bitusd.ts @@ -1,6 +1,6 @@ -import { TokenContractData } from "../types"; +import { EOSTokenContractData} from '../../types'; -export const EOSFakeBITUSD: TokenContractData = { +export const EOSFakeBITUSD: EOSTokenContractData = { address: "bkbtokentest", name: "BITUSD", symbol: "BITUSD", diff --git a/packages/app-contracts/src/dev/eos-fake-usdt.ts b/packages/app-contracts/src/dev/tokens/eos-fake-usdt.ts similarity index 72% rename from packages/app-contracts/src/dev/eos-fake-usdt.ts rename to packages/app-contracts/src/dev/tokens/eos-fake-usdt.ts index 2ae8a23fd..9a19f1c2a 100644 --- a/packages/app-contracts/src/dev/eos-fake-usdt.ts +++ b/packages/app-contracts/src/dev/tokens/eos-fake-usdt.ts @@ -1,6 +1,6 @@ -import { TokenContractData } from "../types"; +import { EOSTokenContractData} from '../../types'; -export const EOSFakeUSDT: TokenContractData = { +export const EOSFakeUSDT: EOSTokenContractData = { address: "bkbmocktoken", name: "Fake EOS USDT", symbol: "USDT", diff --git a/packages/app-contracts/src/dev/sepolia-usdt.ts b/packages/app-contracts/src/dev/tokens/sepolia-usdt.ts similarity index 98% rename from packages/app-contracts/src/dev/sepolia-usdt.ts rename to packages/app-contracts/src/dev/tokens/sepolia-usdt.ts index c97f1514a..ace3cb4d0 100644 --- a/packages/app-contracts/src/dev/sepolia-usdt.ts +++ b/packages/app-contracts/src/dev/tokens/sepolia-usdt.ts @@ -1,4 +1,5 @@ -import { EVMTokenContractData } from "../types"; +import { sepolia } from "viem/chains"; +import { EVMTokenContractData } from "../../types"; export const SepoliaUSDT: EVMTokenContractData = { address: "0x5b148580635e8b67184bcb496741e423f2c326bf", @@ -9,6 +10,7 @@ export const SepoliaUSDT: EVMTokenContractData = { chainId: 11155111, // sepolia chainType: "evm", chainName: "Sepolia", + chain: sepolia, abi: [ { inputs: [ diff --git a/packages/app-contracts/src/dev/tokens/testnet-blpl.ts b/packages/app-contracts/src/dev/tokens/testnet-blpl.ts new file mode 100644 index 000000000..a527ce49d --- /dev/null +++ b/packages/app-contracts/src/dev/tokens/testnet-blpl.ts @@ -0,0 +1,16 @@ +import { erc20Abi } from "viem"; +import { EVMTokenContractData } from "../../types"; +import {eosEvmTestnet} from '../../../../app-env/src/chains'; + +export const TestnetBLPL: EVMTokenContractData = { + address: "0x2BF8feebD09B2520E69f27294768774544c98985", + name: "Bitlauncher Prelaunch Token", + symbol: "BLPL", + decimals: 18, + indexFromBlock: 30051449, + chainId: 15557, // eos_evm + chainType: "evm", + chainName: "EOS EVM Tesnet", + chain: eosEvmTestnet, + abi: erc20Abi, +} as const; diff --git a/packages/app-contracts/src/dev/testnet-mbots-prelaunch.ts b/packages/app-contracts/src/dev/tokens/testnet-mbots-prelaunch.ts similarity index 98% rename from packages/app-contracts/src/dev/testnet-mbots-prelaunch.ts rename to packages/app-contracts/src/dev/tokens/testnet-mbots-prelaunch.ts index 8e82dfb0d..be46b1bdd 100644 --- a/packages/app-contracts/src/dev/testnet-mbots-prelaunch.ts +++ b/packages/app-contracts/src/dev/tokens/testnet-mbots-prelaunch.ts @@ -1,4 +1,5 @@ -import { EVMTokenContractData } from "../types"; +import { EVMTokenContractData } from "../../types"; +import {eosEvmTestnet} from '../../../../app-env/src/chains'; export const TestnetMBOTSPL: EVMTokenContractData = { address: "0x357752b66961021524b44523cD90a8B3861803E5", @@ -9,6 +10,7 @@ export const TestnetMBOTSPL: EVMTokenContractData = { chainId: 15557, chainType: "evm", chainName: "EOS EVM Tesnet", + chain: eosEvmTestnet, abi: [ { inputs: [ diff --git a/packages/app-contracts/src/dev/testnet-usd-cred.ts b/packages/app-contracts/src/dev/tokens/testnet-usd-cred.ts similarity index 98% rename from packages/app-contracts/src/dev/testnet-usd-cred.ts rename to packages/app-contracts/src/dev/tokens/testnet-usd-cred.ts index 108c3021d..82164416d 100644 --- a/packages/app-contracts/src/dev/testnet-usd-cred.ts +++ b/packages/app-contracts/src/dev/tokens/testnet-usd-cred.ts @@ -1,4 +1,5 @@ -import { EVMTokenContractData } from "../types"; +import { EVMTokenContractData } from "../../types"; +import {eosEvmTestnet} from '../../../../app-env/src/chains'; export const TestnetUSDCred: EVMTokenContractData = { address: "0x1d5A4C37e60cAd0C72c057E3c191352429cDB38e", @@ -9,6 +10,7 @@ export const TestnetUSDCred: EVMTokenContractData = { chainId: 15557, chainType: "evm", chainName: "EOS EVM Tesnet", + chain: eosEvmTestnet, abi: [ { inputs: [ diff --git a/packages/app-contracts/src/dev/testnet-usdt.ts b/packages/app-contracts/src/dev/tokens/testnet-usdt.ts similarity index 97% rename from packages/app-contracts/src/dev/testnet-usdt.ts rename to packages/app-contracts/src/dev/tokens/testnet-usdt.ts index 7bb757599..4eb6e66df 100644 --- a/packages/app-contracts/src/dev/testnet-usdt.ts +++ b/packages/app-contracts/src/dev/tokens/testnet-usdt.ts @@ -1,4 +1,5 @@ -import { EVMTokenContractData } from "../types"; +import { EVMTokenContractData } from "../../types"; +import {eosEvmTestnet} from '../../../../app-env/src/chains'; export const TestnetUSDT: EVMTokenContractData = { address: "0xE561021FCB5FFB86b439ae9e6AeCE0370e2394eC", @@ -9,6 +10,7 @@ export const TestnetUSDT: EVMTokenContractData = { chainId: 15557, // eos_evm chainType: "evm", chainName: "EOS EVM Tesnet", + chain: eosEvmTestnet, abi: [ { inputs: [ diff --git a/packages/app-contracts/src/dev/usdc.ts b/packages/app-contracts/src/dev/usdc.ts deleted file mode 100644 index 99610ab61..000000000 --- a/packages/app-contracts/src/dev/usdc.ts +++ /dev/null @@ -1,181 +0,0 @@ -import { TokenContractData } from "../types"; -import { erc20Abi } from 'abitype/abis' - -export const usdcContracts: TokenContractData[] = [ - { - address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 42161, // Arbitrum Mainnet - chainType: "evm", - chainName: "Arbitrum", - abi: erc20Abi, - }, - { - address: "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 421611, // Arbitrum Testnet - chainType: "evm", - chainName: "Arbitrum", - abi: erc20Abi, - }, - { - address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 43114, // Avalanche Mainnet - chainType: "evm", - chainName: "Avalanche", - abi: erc20Abi, - }, - { - address: "0x5425890298aed601595a70ab815c96711a31bc65", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 43113, // Avalanche Testnet - chainType: "evm", - chainName: "Avalanche", - abi: erc20Abi, - }, - { - address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 8453, // Base Mainnet - chainType: "evm", - chainName: "Base", - abi: erc20Abi, - }, - { - address: "0x036CbD53842c5426634e7929541eC2318f3dCF7e", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 84531, // Base Testnet - chainType: "evm", - chainName: "Base", - abi: erc20Abi, - }, - { - address: "0xcebA9300f2b948710d2653dD7B07f33A8B32118C", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 42220, // Celo Mainnet - chainType: "evm", - chainName: "Celo", - abi: erc20Abi, - }, - { - address: "0x2F25deB3848C207fc8E0c34035B3Ba7fC157602B", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 44787, // Celo Testnet - chainType: "evm", - chainName: "Celo", - abi: erc20Abi, - }, - { - address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 1, // Ethereum Mainnet - chainType: "evm", - chainName: "Ethereum", - abi: erc20Abi, - }, - { - address: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 11155111, // Ethereum Testnet - chainType: "evm", - chainName: "Ethereum", - abi: erc20Abi, - }, - { - address: "0x0b2c639c533813f4aa9d7837caf62653d097ff85", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 10, // OP Mainnet - chainType: "evm", - chainName: "Optimism", - abi: erc20Abi, - }, - { - address: "0x5fd84259d66Cd46123540766Be93DFE6D43130D7", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 420, // OP Testnet - chainType: "evm", - chainName: "Optimism", - abi: erc20Abi, - }, - { - address: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 137, // Polygon PoS Mainnet - chainType: "evm", - chainName: "Polygon", - abi: erc20Abi, - }, - { - address: "0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 80001, // Polygon PoS Testnet - chainType: "evm", - chainName: "Polygon", - abi: erc20Abi, - }, - { - address: "0x1d17CBcF0D6D143135aE902365D2E5e2A16538D4", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 324, // ZKsync Mainnet - chainType: "evm", - chainName: "ZKsync", - abi: erc20Abi, - }, - { - address: "0xAe045DE5638162fa134807Cb558E15A3F5A7F853", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 280, // ZKsync Testnet - chainType: "evm", - chainName: "ZKsync", - abi: erc20Abi, - }, -] diff --git a/packages/app-contracts/src/dev/usdt.ts b/packages/app-contracts/src/dev/usdt.ts deleted file mode 100644 index 13d7ff6e3..000000000 --- a/packages/app-contracts/src/dev/usdt.ts +++ /dev/null @@ -1,171 +0,0 @@ -import { TokenContractData } from "../types"; -import { erc20Abi } from 'abitype/abis' - - -export const usdtContracts: TokenContractData[] = [ - { - address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 1, // Ethereum Mainnet - chainType: "evm", - chainName: "Ethereum", - abi: erc20Abi, - }, - { - address: "0xFD086BC7CD5C481DCC9C85E0C3AC0A4A5404C120", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 42161, // Arbitrum Mainnet - chainType: "evm", - chainName: "Arbitrum", - abi: erc20Abi, - }, - { - address: "0xc7198437980c041c805A1EDcbA50c1Ce5db95118", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 43114, // Avalanche Mainnet - chainType: "evm", - chainName: "Avalanche", - abi: erc20Abi, - }, - { - address: "0x55d398326f99059fF775485246999027B3197955", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 56, // Binance Smart Chain Mainnet - chainType: "evm", - chainName: "Binance Smart Chain", - abi: erc20Abi, - }, - { - address: "0x049d68029688eAbF473097a2fC38ef61633A3C7A", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 250, // Fantom Mainnet - chainType: "evm", - chainName: "Fantom", - abi: erc20Abi, - }, - { - address: "0x3813e82e6f7098b9583FC0F33a962D02018B6803", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 137, // Polygon Mainnet - chainType: "evm", - chainName: "Polygon", - abi: erc20Abi, - }, - { - address: "TD9iWjeY9yLbzgpqv9E5uFZy9vNExS6EN5", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 1, // Tron Mainnet (TRC-20) - chainType: "evm", - chainName: "Tron", - abi: erc20Abi, - }, - { - address: "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 10, // Optimism Mainnet - chainType: "evm", - chainName: "Optimism", - abi: erc20Abi, - }, - { - address: "0x224E64ec1BDce3870a6a6c777eDd450454068FEC", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 1666600000, // Harmony Mainnet - chainType: "evm", - chainName: "Harmony", - abi: erc20Abi, - }, - { - address: "0x8e76f63A2dC3F3bE6f00e3F4a1ddC133D52f4866", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 1284, // Moonbeam Mainnet - chainType: "evm", - chainName: "Moonbeam", - abi: erc20Abi, - }, - { - address: "0x6175F5a135dF205eD2E6FCab46dEc8df3feBf60a", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 25, // Cronos Mainnet - chainType: "evm", - chainName: "Cronos", - abi: erc20Abi, - }, - { - address: "0x33bD5cD41aE43Fd478C14d0FF16B23E92cb9d015", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 2222, // Kava Mainnet - chainType: "evm", - chainName: "Kava", - abi: erc20Abi, - }, - { - address: "0x29db9dAF5b1D73f5A3265B5Edb2Dd9d2b99D6A3A", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 1088, // Metis Mainnet - chainType: "evm", - chainName: "Metis", - abi: erc20Abi, - }, - { - address: "0x4ecb6e9aEa4C7D2b16B65F6375A7b88d14524eC9", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 100, // Gnosis Mainnet - chainType: "evm", - chainName: "Gnosis", - abi: erc20Abi, - }, - { - address: "0x4988a896b1227218e4A686fdE5EabdcAbd91571f", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 1313161554, // Aurora Mainnet - chainType: "evm", - chainName: "Aurora", - abi: erc20Abi, - }, -] \ No newline at end of file diff --git a/packages/app-contracts/src/index.ts b/packages/app-contracts/src/index.ts index 4511d0bc6..ce161bb38 100644 --- a/packages/app-contracts/src/index.ts +++ b/packages/app-contracts/src/index.ts @@ -1,4 +1,13 @@ -export * from "./dev"; -export * from "./prod"; -export * from "./types"; +import {devContracts} from "./dev" +import {prodContracts} from "./prod" + +export * from './dev' +export * from './prod' +export * from "./types" + +export const appContracts = { + dev: devContracts, + prod: prodContracts +} + diff --git a/packages/app-contracts/src/prod/index.ts b/packages/app-contracts/src/prod/index.ts index 6ca661e1b..d1c43f4d9 100644 --- a/packages/app-contracts/src/prod/index.ts +++ b/packages/app-contracts/src/prod/index.ts @@ -1,4 +1,33 @@ -export * from './eos-usdt' -export * from './eos-bitusd' -export * from './usdt' -export * from './usdc' \ No newline at end of file + +export * from './tokens/eos-usdt' +export * from './tokens/eos-bitusd' +export * from './tokens/usdt' +export * from './tokens/usdc' + +import {usdtContracts} from './tokens/usdt' +// import {usdcContracts} from './tokens/usdc' +import {EOSUSDT} from './tokens/eos-usdt'; +import {EOSBITUSD} from './tokens/eos-bitusd'; +import { ContractData, EOSTokenContractData, EVMTokenContractData } from '../types' + +const evmTokens: EVMTokenContractData[] = [ + ...usdtContracts, + // ...usdcContracts +] + +const eosTokens: EOSTokenContractData[] =[ + EOSUSDT, + EOSBITUSD +] + +const auctions:ContractData[] = [ + +] + +export const prodContracts = { + tokens: { + evm: evmTokens, + eos: eosTokens + }, + auctions +} \ No newline at end of file diff --git a/packages/app-contracts/src/prod/eos-bitusd.ts b/packages/app-contracts/src/prod/tokens/eos-bitusd.ts similarity index 72% rename from packages/app-contracts/src/prod/eos-bitusd.ts rename to packages/app-contracts/src/prod/tokens/eos-bitusd.ts index 7fc48615f..4a90f512c 100644 --- a/packages/app-contracts/src/prod/eos-bitusd.ts +++ b/packages/app-contracts/src/prod/tokens/eos-bitusd.ts @@ -1,6 +1,6 @@ -import { TokenContractData } from "../types"; +import { EOSTokenContractData} from '../../types'; -export const EOSBITUSD: TokenContractData = { +export const EOSBITUSD: EOSTokenContractData = { address: "bkbtokentest", name: "BITUSD", symbol: "BITUSD", diff --git a/packages/app-contracts/src/prod/eos-usdt.ts b/packages/app-contracts/src/prod/tokens/eos-usdt.ts similarity index 73% rename from packages/app-contracts/src/prod/eos-usdt.ts rename to packages/app-contracts/src/prod/tokens/eos-usdt.ts index 57bb456c9..3461e7418 100644 --- a/packages/app-contracts/src/prod/eos-usdt.ts +++ b/packages/app-contracts/src/prod/tokens/eos-usdt.ts @@ -1,6 +1,6 @@ -import { TokenContractData } from "../types"; +import { EOSTokenContractData} from '../../types'; -export const EOSUSDT: TokenContractData = { +export const EOSUSDT: EOSTokenContractData = { address: "tethertether", name: "EOS USDT", symbol: "USDT", diff --git a/packages/app-contracts/src/prod/tokens/usdc.ts b/packages/app-contracts/src/prod/tokens/usdc.ts new file mode 100644 index 000000000..49d39c045 --- /dev/null +++ b/packages/app-contracts/src/prod/tokens/usdc.ts @@ -0,0 +1,106 @@ +import { EVMTokenContractData } from "../../types"; +import { erc20Abi } from 'abitype/abis' +import { arbitrum, avalanche, polygon, zkSync } from 'viem/chains' + +export const usdcContracts: EVMTokenContractData[] = [ + { + address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831", + name: "USDC", + symbol: "USDC", + decimals: 6, + indexFromBlock: 1045000, + chainId: 42161, // Arbitrum Mainnet + chainType: "evm", + chainName: "Arbitrum", + abi: erc20Abi, + chain: arbitrum, + }, + { + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + name: "USDC", + symbol: "USDC", + decimals: 6, + indexFromBlock: 48843700, + chainId: 43114, // Avalanche Mainnet + chainType: "evm", + chainName: "Avalanche", + abi: erc20Abi, + chain: avalanche, + }, + // TODO: this is throwing a backend error + // { + // address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + // name: "USDC", + // symbol: "USDC", + // decimals: 6, + // indexFromBlock: 1000000, + // chainId: 8453, // Base Mainnet + // chainType: "evm", + // chainName: "Base", + // abi: erc20Abi, + // chain: base, + // }, + // TODO: celo times out + // { + // address: "0xcebA9300f2b948710d2653dD7B07f33A8B32118C", + // name: "USDC", + // symbol: "USDC", + // decimals: 6, + // indexFromBlock: 1000000, + // chainId: 42220, // Celo Mainnet + // chainType: "evm", + // chainName: "Celo", + // abi: erc20Abi, + // chain: celo, + // }, + // TODO: this throws invalid params + // { + // address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + // name: "USDC", + // symbol: "USDC", + // decimals: 6, + // indexFromBlock: 20457027, + // chainId: 1, // Ethereum Mainnet + // chainType: "evm", + // chainName: "Ethereum", + // abi: erc20Abi, + // chain: mainnet, + // }, + // TODO: 'Block range is too large', + // { + // address: "0x0b2c639c533813f4aa9d7837caf62653d097ff85", + // name: "USDC", + // symbol: "USDC", + // decimals: 6, + // indexFromBlock: 12359955, + // chainId: 10, // OP Mainnet + // chainType: "evm", + // chainName: "Optimism", + // abi: erc20Abi, + // chain: optimism, + // }, + { + address: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", + name: "USDC", + symbol: "USDC", + decimals: 6, + indexFromBlock: 5000000, + chainId: 137, // Polygon PoS Mainnet + chainType: "evm", + chainName: "Polygon", + abi: erc20Abi, + chain: polygon, + }, + { + address: "0x1d17CBcF0D6D143135aE902365D2E5e2A16538D4", + name: "USDC", + symbol: "USDC", + decimals: 6, + indexFromBlock: 1000000, + chainId: 324, // ZKsync Mainnet + chainType: "evm", + chainName: "ZKsync", + abi: erc20Abi, + chain: zkSync, + }, +] diff --git a/packages/app-contracts/src/prod/tokens/usdt.ts b/packages/app-contracts/src/prod/tokens/usdt.ts new file mode 100644 index 000000000..e6442f54c --- /dev/null +++ b/packages/app-contracts/src/prod/tokens/usdt.ts @@ -0,0 +1,212 @@ +import { EVMTokenContractData } from '../../types' +import { erc20Abi } from 'abitype/abis' +import { arbitrum, avalanche, bsc, fantom, gnosis, polygon } from 'viem/chains' + +export const usdtContracts: EVMTokenContractData[] = [ + // TODO: 'Double check you have provided the correct parameters.', + // { + // address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", + // name: "USDT", + // symbol: "USDT", + // decimals: 6, + // indexFromBlock: 20432827, + // chainId: 1, // Ethereum Mainnet + // chainType: "evm", + // chainName: "Ethereum", + // abi: erc20Abi, + // chain: mainnet, + // }, + { + address: "0xFD086BC7CD5C481DCC9C85E0C3AC0A4A5404C120", + name: "USDT", + symbol: "USDT", + decimals: 6, + indexFromBlock: 1045000, + chainId: 42161, // Arbitrum Mainnet + chainType: "evm", + chainName: "Arbitrum", + abi: erc20Abi, + chain: arbitrum, + }, + { + address: "0xc7198437980c041c805A1EDcbA50c1Ce5db95118", + name: "USDT", + symbol: "USDT", + decimals: 6, + indexFromBlock: 48845519, + chainId: 43114, // Avalanche Mainnet + chainType: "evm", + chainName: "Avalanche", + abi: erc20Abi, + chain: avalanche, + }, + { + address: "0x55d398326f99059fF775485246999027B3197955", + name: "USDT", + symbol: "USDT", + decimals: 6, + indexFromBlock: 41076632, + chainId: 56, // Binance Smart Chain Mainnet + chainType: "evm", + chainName: "Binance Smart Chain", + abi: erc20Abi, + chain: bsc, + }, + { + address: "0x049d68029688eAbF473097a2fC38ef61633A3C7A", + name: "USDT", + symbol: "USDT", + decimals: 6, + indexFromBlock: 87799484, + chainId: 250, // Fantom Mainnet + chainType: "evm", + chainName: "Fantom", + abi: erc20Abi, + chain: fantom, + }, + { + address: "0x3813e82e6f7098b9583FC0F33a962D02018B6803", + name: "USDT", + symbol: "USDT", + decimals: 6, + indexFromBlock: 5000000, + chainId: 137, // Polygon Mainnet + chainType: "evm", + chainName: "Polygon", + abi: erc20Abi, + chain: polygon, + }, + // TODO: block range + // { + // address: "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", + // name: "USDT", + // symbol: "USDT", + // decimals: 6, + // indexFromBlock: 1500000, + // chainId: 10, // Optimism Mainnet + // chainType: "evm", + // chainName: "Optimism", + // abi: erc20Abi, + // chain: optimism, + // }, + // { + // address: "0x224E64ec1BDce3870a6a6c777eDd450454068FEC", + // name: "USDT", + // symbol: "USDT", + // decimals: 6, + // indexFromBlock: 1200000, + // chainId: 1666600000, // Harmony Mainnet + // chainType: "evm", + // chainName: "Harmony", + // abi: erc20Abi, + // chain: harmonyOne, + // }, + // { + // address: "0x8e76f63A2dC3F3bE6f00e3F4a1ddC133D52f4866", + // name: "USDT", + // symbol: "USDT", + // decimals: 6, + // indexFromBlock: 1300000, + // chainId: 1284, // Moonbeam Mainnet + // chainType: "evm", + // chainName: "Moonbeam", + // abi: erc20Abi, + // chain: moonbeam, + // }, + // { + // address: "0x6175F5a135dF205eD2E6FCab46dEc8df3feBf60a", + // name: "USDT", + // symbol: "USDT", + // decimals: 6, + // indexFromBlock: 1200000, + // chainId: 25, // Cronos Mainnet + // chainType: "evm", + // chainName: "Cronos", + // abi: erc20Abi, + // chain: cronos, + // }, + // { + // address: "0x33bD5cD41aE43Fd478C14d0FF16B23E92cb9d015", + // name: "USDT", + // symbol: "USDT", + // decimals: 6, + // indexFromBlock: 1500000, + // chainId: 2222, // Kava Mainnet + // chainType: "evm", + // chainName: "Kava", + // abi: erc20Abi, + // chain: kava, + // }, + // { + // address: "0x29db9dAF5b1D73f5A3265B5Edb2Dd9d2b99D6A3A", + // name: "USDT", + // symbol: "USDT", + // decimals: 6, + // indexFromBlock: 1200000, + // chainId: 1088, // Metis Mainnet + // chainType: "evm", + // chainName: "Metis", + // abi: erc20Abi, + // chain: metis, + // }, + { + address: "0x4ecb6e9aEa4C7D2b16B65F6375A7b88d14524eC9", + name: "USDT", + symbol: "USDT", + decimals: 6, + indexFromBlock: 1500000, + chainId: 100, // Gnosis Mainnet + chainType: "evm", + chainName: "Gnosis", + abi: erc20Abi, + chain: gnosis, + }, + // { + // address: "0x4988a896b1227218e4A686fdE5EabdcAbd91571f", + // name: "USDT", + // symbol: "USDT", + // decimals: 6, + // indexFromBlock: 1200000, + // chainId: 1313161554, // Aurora Mainnet + // chainType: "evm", + // chainName: "Aurora", + // abi: erc20Abi, + // chain: aurora, + // }, + // { + // address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + // name: "USDT", + // symbol: "USDT", + // decimals: 6, + // indexFromBlock: 1000000, + // chainId: 8453, // Base Mainnet + // chainType: "evm", + // chainName: "Base", + // abi: erc20Abi, + // chain: base, + // }, + // { + // address: "0xcebA9300f2b948710d2653dD7B07f33A8B32118C", + // name: "USDT", + // symbol: "USDT", + // decimals: 6, + // indexFromBlock: 1000000, + // chainId: 42220, // Celo Mainnet + // chainType: "evm", + // chainName: "Celo", + // abi: erc20Abi, + // chain: celo, + // }, + // { + // address: "0x493257fD37EDB34451f62EDf8D2a0C418852bA4C", + // name: "USDT", + // symbol: "USDT", + // decimals: 6, + // indexFromBlock: 1000000, + // chainId: 324, // ZKSync Era Mainnet + // chainType: "evm", + // chainName: "ZKSync", + // abi: erc20Abi, + // chain: zkSync, + // }, +] \ No newline at end of file diff --git a/packages/app-contracts/src/prod/usdc.ts b/packages/app-contracts/src/prod/usdc.ts deleted file mode 100644 index 99610ab61..000000000 --- a/packages/app-contracts/src/prod/usdc.ts +++ /dev/null @@ -1,181 +0,0 @@ -import { TokenContractData } from "../types"; -import { erc20Abi } from 'abitype/abis' - -export const usdcContracts: TokenContractData[] = [ - { - address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 42161, // Arbitrum Mainnet - chainType: "evm", - chainName: "Arbitrum", - abi: erc20Abi, - }, - { - address: "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 421611, // Arbitrum Testnet - chainType: "evm", - chainName: "Arbitrum", - abi: erc20Abi, - }, - { - address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 43114, // Avalanche Mainnet - chainType: "evm", - chainName: "Avalanche", - abi: erc20Abi, - }, - { - address: "0x5425890298aed601595a70ab815c96711a31bc65", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 43113, // Avalanche Testnet - chainType: "evm", - chainName: "Avalanche", - abi: erc20Abi, - }, - { - address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 8453, // Base Mainnet - chainType: "evm", - chainName: "Base", - abi: erc20Abi, - }, - { - address: "0x036CbD53842c5426634e7929541eC2318f3dCF7e", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 84531, // Base Testnet - chainType: "evm", - chainName: "Base", - abi: erc20Abi, - }, - { - address: "0xcebA9300f2b948710d2653dD7B07f33A8B32118C", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 42220, // Celo Mainnet - chainType: "evm", - chainName: "Celo", - abi: erc20Abi, - }, - { - address: "0x2F25deB3848C207fc8E0c34035B3Ba7fC157602B", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 44787, // Celo Testnet - chainType: "evm", - chainName: "Celo", - abi: erc20Abi, - }, - { - address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 1, // Ethereum Mainnet - chainType: "evm", - chainName: "Ethereum", - abi: erc20Abi, - }, - { - address: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 11155111, // Ethereum Testnet - chainType: "evm", - chainName: "Ethereum", - abi: erc20Abi, - }, - { - address: "0x0b2c639c533813f4aa9d7837caf62653d097ff85", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 10, // OP Mainnet - chainType: "evm", - chainName: "Optimism", - abi: erc20Abi, - }, - { - address: "0x5fd84259d66Cd46123540766Be93DFE6D43130D7", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 420, // OP Testnet - chainType: "evm", - chainName: "Optimism", - abi: erc20Abi, - }, - { - address: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 137, // Polygon PoS Mainnet - chainType: "evm", - chainName: "Polygon", - abi: erc20Abi, - }, - { - address: "0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 80001, // Polygon PoS Testnet - chainType: "evm", - chainName: "Polygon", - abi: erc20Abi, - }, - { - address: "0x1d17CBcF0D6D143135aE902365D2E5e2A16538D4", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 324, // ZKsync Mainnet - chainType: "evm", - chainName: "ZKsync", - abi: erc20Abi, - }, - { - address: "0xAe045DE5638162fa134807Cb558E15A3F5A7F853", - name: "USDC", - symbol: "USDC", - decimals: 6, - indexFromBlock: 0, - chainId: 280, // ZKsync Testnet - chainType: "evm", - chainName: "ZKsync", - abi: erc20Abi, - }, -] diff --git a/packages/app-contracts/src/prod/usdt.ts b/packages/app-contracts/src/prod/usdt.ts deleted file mode 100644 index 13d7ff6e3..000000000 --- a/packages/app-contracts/src/prod/usdt.ts +++ /dev/null @@ -1,171 +0,0 @@ -import { TokenContractData } from "../types"; -import { erc20Abi } from 'abitype/abis' - - -export const usdtContracts: TokenContractData[] = [ - { - address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 1, // Ethereum Mainnet - chainType: "evm", - chainName: "Ethereum", - abi: erc20Abi, - }, - { - address: "0xFD086BC7CD5C481DCC9C85E0C3AC0A4A5404C120", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 42161, // Arbitrum Mainnet - chainType: "evm", - chainName: "Arbitrum", - abi: erc20Abi, - }, - { - address: "0xc7198437980c041c805A1EDcbA50c1Ce5db95118", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 43114, // Avalanche Mainnet - chainType: "evm", - chainName: "Avalanche", - abi: erc20Abi, - }, - { - address: "0x55d398326f99059fF775485246999027B3197955", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 56, // Binance Smart Chain Mainnet - chainType: "evm", - chainName: "Binance Smart Chain", - abi: erc20Abi, - }, - { - address: "0x049d68029688eAbF473097a2fC38ef61633A3C7A", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 250, // Fantom Mainnet - chainType: "evm", - chainName: "Fantom", - abi: erc20Abi, - }, - { - address: "0x3813e82e6f7098b9583FC0F33a962D02018B6803", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 137, // Polygon Mainnet - chainType: "evm", - chainName: "Polygon", - abi: erc20Abi, - }, - { - address: "TD9iWjeY9yLbzgpqv9E5uFZy9vNExS6EN5", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 1, // Tron Mainnet (TRC-20) - chainType: "evm", - chainName: "Tron", - abi: erc20Abi, - }, - { - address: "0x7F5c764cBc14f9669B88837ca1490cCa17c31607", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 10, // Optimism Mainnet - chainType: "evm", - chainName: "Optimism", - abi: erc20Abi, - }, - { - address: "0x224E64ec1BDce3870a6a6c777eDd450454068FEC", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 1666600000, // Harmony Mainnet - chainType: "evm", - chainName: "Harmony", - abi: erc20Abi, - }, - { - address: "0x8e76f63A2dC3F3bE6f00e3F4a1ddC133D52f4866", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 1284, // Moonbeam Mainnet - chainType: "evm", - chainName: "Moonbeam", - abi: erc20Abi, - }, - { - address: "0x6175F5a135dF205eD2E6FCab46dEc8df3feBf60a", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 25, // Cronos Mainnet - chainType: "evm", - chainName: "Cronos", - abi: erc20Abi, - }, - { - address: "0x33bD5cD41aE43Fd478C14d0FF16B23E92cb9d015", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 2222, // Kava Mainnet - chainType: "evm", - chainName: "Kava", - abi: erc20Abi, - }, - { - address: "0x29db9dAF5b1D73f5A3265B5Edb2Dd9d2b99D6A3A", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 1088, // Metis Mainnet - chainType: "evm", - chainName: "Metis", - abi: erc20Abi, - }, - { - address: "0x4ecb6e9aEa4C7D2b16B65F6375A7b88d14524eC9", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 100, // Gnosis Mainnet - chainType: "evm", - chainName: "Gnosis", - abi: erc20Abi, - }, - { - address: "0x4988a896b1227218e4A686fdE5EabdcAbd91571f", - name: "USDT", - symbol: "USDT", - decimals: 6, - indexFromBlock: 0, - chainId: 1313161554, // Aurora Mainnet - chainType: "evm", - chainName: "Aurora", - abi: erc20Abi, - }, -] \ No newline at end of file diff --git a/packages/app-contracts/src/types.ts b/packages/app-contracts/src/types.ts index ef2296b3b..c5b256689 100644 --- a/packages/app-contracts/src/types.ts +++ b/packages/app-contracts/src/types.ts @@ -1,4 +1,5 @@ import type { Abi, Address } from "abitype"; +import { Chain } from "viem"; export interface ContractData { abi: Abi; address: Address | string; @@ -17,11 +18,13 @@ export interface TokenContractData extends ContractData { export interface EVMContractData extends ContractData { address: Address; chainId: number; + chain: Chain; } export interface EVMTokenContractData extends TokenContractData { address: Address; chainId: number; + chain: Chain; } export interface EOSContractData extends ContractData { diff --git a/packages/app-env/src/chains.ts b/packages/app-env/src/chains.ts index c6357a34b..e92ee55de 100644 --- a/packages/app-env/src/chains.ts +++ b/packages/app-env/src/chains.ts @@ -1,5 +1,5 @@ import { Chain } from "viem"; -import { sepolia } from "viem/chains"; +import {sepolia, arbitrum, avalanche, base, celo, mainnet, optimism, polygon, zkSync, bsc, fantom, moonbeam, cronos, kava, metis, gnosis, aurora, harmonyOne} from 'viem/chains'; export const eosEvmTestnet: Chain = { nativeCurrency: { @@ -22,11 +22,11 @@ export const eosEvmTestnet: Chain = { testnet: true, } as const; -const prodChains: Chain[] = [eosEvmTestnet, sepolia]; -const testChains: Chain[] = []; +const prodChains: Chain[] = [arbitrum, avalanche, base, celo, mainnet, optimism, polygon, zkSync, bsc, fantom, moonbeam, cronos, kava, metis, gnosis, aurora, harmonyOne]; +const testChains: Chain[] = [eosEvmTestnet, sepolia]; // note: use .entries() to get an array -export const smartsaleChains = { +export const appChains = { dev: createMapFromId(prodChains), prod: createMapFromId(testChains), } as const; diff --git a/packages/app-env/src/env.ts b/packages/app-env/src/env.ts index c32c38c5f..794de1dca 100644 --- a/packages/app-env/src/env.ts +++ b/packages/app-env/src/env.ts @@ -1,4 +1,4 @@ -import { smartsaleChains } from "./chains"; +import { appChains } from "./chains"; import { EOSFakeUSDT, EOSUSDT, @@ -16,7 +16,7 @@ const prod: SmartsaleEnvConfig = { url : 'https://byqpuulbryhqwvxpoobc.supabase.co', anonKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJ5cXB1dWxicnlocXd2eHBvb2JjIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTMxMjkxNTMsImV4cCI6MjAyODcwNTE1M30.2kikQFX8PhOIzTnojaE0J06E94j92dtpPBI832EktK8', }, - chains: smartsaleChains.prod, + chains: appChains.prod, esrCallbackUrl: "https://bitlauncher.ai/api/esr", issuer: { eos: "launchpad.bk", @@ -39,7 +39,7 @@ const dev: SmartsaleEnvConfig = { url : 'https://jvpdyxpjpodxsuvhufpw.supabase.co', anonKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imp2cGR5eHBqcG9keHN1dmh1ZnB3Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTMxMzMxMDcsImV4cCI6MjAyODcwOTEwN30.KkwK6Px8MG03QPDScsKjLc48GU-RkTs9beT946vD2vI', }, - chains: smartsaleChains.dev, + chains: appChains.dev, esrCallbackUrl: "https://dev.bitlauncher.ai/api/esr", issuer: { eos: "gaboesquivel",