mirror of
https://github.com/logos-blockchain/logos-blockchain-pocs.git
synced 2026-01-07 15:43:07 +00:00
Load router and token addresses from env vars.
This commit is contained in:
parent
8b8173719b
commit
21ba3c0604
@ -1,4 +1,6 @@
|
||||
export const networks = [1, 3,4,5,42,123, 1337, 65110000, 65010000]
|
||||
import config from './env.js';
|
||||
|
||||
export const networks = [1, 3, 4, 5, 42, 123, 1337, 65110000, 65010000]
|
||||
|
||||
export const ChainId = {
|
||||
MAINNET: 1,
|
||||
@ -21,5 +23,4 @@ routerAddress.set(ChainId.KOVAN, "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D");
|
||||
routerAddress.set(ChainId.DEVNET, "0x04e555283D37aE85F6eB311fe2578F3B3f3dFc52");
|
||||
routerAddress.set(ChainId.AUTONITY, "0x04e555283D37aE85F6eB311fe2578F3B3f3dFc52");
|
||||
routerAddress.set(ChainId.PARASTATE, "0x07a1905D44feeA439ceFAabd11a63bEf684abE11");
|
||||
routerAddress.set(ChainId.GANCHE, "0x0F44AC51198D8F99847db6C431448dBC673428f1");
|
||||
|
||||
routerAddress.set(ChainId.GANCHE, config.routerAddress);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import * as chains from './chains';
|
||||
import config from './env.js';
|
||||
|
||||
// If you add coins for a new network, make sure Weth address (for the router you are using) is the first entry
|
||||
|
||||
@ -74,7 +75,7 @@ const PARASTATECoins = [
|
||||
abbr: "TB",
|
||||
address: "0x4489D87C8440B19f11d63FA2246f943F492F3F5F",
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
name: "Token C",
|
||||
abbr: "TC",
|
||||
@ -94,25 +95,14 @@ const GANACHECoins = [
|
||||
address: "", // Weth address is fetched from the router
|
||||
},
|
||||
{
|
||||
name: "Token A",
|
||||
abbr: "TA",
|
||||
address: "0xE8C4BE1Bd495c984dD83B683966B7B538d3Ea82C",
|
||||
name: "Mehmet",
|
||||
abbr: "MEM",
|
||||
address: config.tokenMemAddress,
|
||||
},
|
||||
{
|
||||
name: "Token B",
|
||||
abbr: "TB",
|
||||
address: "0x30988e63329713c3f3FeA1ca1B94D4Abb02F78C5",
|
||||
},
|
||||
|
||||
{
|
||||
name: "Token C",
|
||||
abbr: "TC",
|
||||
address: "0x23b4ce07ef4e2378319E40CbC0cc95EAbCf8E419",
|
||||
},
|
||||
{
|
||||
name: "Token D",
|
||||
abbr: "TD",
|
||||
address: "0x49Ec3915F4daB907f7C6F74Cf5110366FCCc81A5",
|
||||
name: "New Ether",
|
||||
abbr: "NET",
|
||||
address: config.tokenNetAddress,
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
21
sz-poc-offsite-2025/uniswap/nomiswap/src/constants/env.js
Normal file
21
sz-poc-offsite-2025/uniswap/nomiswap/src/constants/env.js
Normal file
@ -0,0 +1,21 @@
|
||||
import 'dotenv/config.js';
|
||||
|
||||
const REQUIRED_ENV = [
|
||||
"REACT_APP_NOMISWAP_ROUTER_ADDRESS",
|
||||
"REACT_APP_NOMISWAP_TOKEN_MEM",
|
||||
"REACT_APP_NOMISWAP_TOKEN_NET"
|
||||
];
|
||||
|
||||
const missingVars = REQUIRED_ENV.filter(key => !process.env[key]);
|
||||
if (missingVars.length > 0) {
|
||||
console.error(`❌ Missing required environment variables: ${missingVars.join(', ')}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const config = {
|
||||
routerAddress: process.env.REACT_APP_NOMISWAP_ROUTER_ADDRESS,
|
||||
tokenMemAddress: process.env.REACT_APP_NOMISWAP_TOKEN_MEM,
|
||||
tokenNetAddress: process.env.REACT_APP_NOMISWAP_TOKEN_NET
|
||||
};
|
||||
|
||||
export default config;
|
||||
Loading…
x
Reference in New Issue
Block a user