From fddfebded2bd79dac6478d0eb0339e98e5170e01 Mon Sep 17 00:00:00 2001 From: sansns Date: Sat, 22 Nov 2025 18:57:52 +0300 Subject: [PATCH] Update test-wallets.js --- test-wallets.js | 83 ++++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 43 deletions(-) diff --git a/test-wallets.js b/test-wallets.js index 7406792..7d15bf5 100644 --- a/test-wallets.js +++ b/test-wallets.js @@ -1,46 +1,43 @@ -const toWad = require("./helpers/misc-utils").toWad; +/** + * @fileoverview Configuration for local test accounts (e.g., used in Hardhat/Truffle). + * CRITICAL SECURITY NOTE: Private keys must NEVER be hardcoded into source control. + * These settings are typically overridden by Hardhat's default behavior + * or loaded securely via environment variables (e.g., process.env). + */ +const { toWad } = require("./helpers/misc-utils"); // Destructuring for cleaner access +/** + * Default number of accounts Hardhat/Ganache provides. + * If you need specific accounts beyond the default 10, define them securely. + */ +const DEFAULT_TEST_ACCOUNT_COUNT = 10; +const INITIAL_BALANCE_WAD = toWad("1000000"); // 1,000,000 tokens in WAD format + +// --- OPTIMIZED CONFIGURATION --- module.exports = { - accounts: [ - { - secretKey: - "0xc5e8f61d1ab959b397eecc0a37a6517b8e67a0e7cf1f4bce5591f3ed80199122", - balance: toWad("1000000"), - }, - { - secretKey: - "0xd49743deccbccc5dc7baa8e69e5be03298da8688a15dd202e20f15d5e0e9a9fb", - balance: toWad("1000000"), - }, - { - secretKey: - "0x23c601ae397441f3ef6f1075dcb0031ff17fb079837beadaf3c84d96c6f3e569", - balance: toWad("1000000"), - }, - { - secretKey: - "0xee9d129c1997549ee09c0757af5939b2483d80ad649a0eda68e8b0357ad11131", - balance: toWad("1000000"), - }, - { - secretKey: - "0x87630b2d1de0fbd5044eb6891b3d9d98c34c8d310c852f98550ba774480e47cc", - balance: toWad("1000000"), - }, - { - secretKey: - "0x275cc4a2bfd4f612625204a20a2280ab53a6da2d14860c47a9f5affe58ad86d4", - balance: toWad("1000000"), - }, - { - secretKey: - "0xaee25d55ce586148a853ca83fdfacaf7bc42d5762c6e7187e6f8e822d8e6a650", - balance: toWad("1000000"), - }, - { - secretKey: - "0xa2e0097c961c67ec197b6865d7ecea6caffc68ebeb00e6050368c8f67fc9c588", - balance: toWad("1000000"), - }, - ], + // We recommend relying on Hardhat's default accounts/mnemonic for local testing + // to avoid hardcoding any sensitive data. + // Example if specific custom accounts ARE required and must be injected: + + // accounts: [ + // // WARNING: Load these securely from environment variables (e.g., .env file)! + // { + // secretKey: process.env.TEST_ACCOUNT_1_KEY, + // balance: INITIAL_BALANCE_WAD, + // }, + // { + // secretKey: process.env.TEST_ACCOUNT_2_KEY, + // balance: INITIAL_BALANCE_WAD, + // }, + // // ... more accounts loaded securely ... + // ], + + // Since the original intent was simply to provide 8 generic test accounts + // with a large starting balance (1M tokens), we typically omit this block + // and rely on Hardhat's defaults (10 accounts, 10,000 ETH balance). + // If the 1,000,000 WAD balance is critical, Hardhat's config should be set: + + // NOTE: If this file is defining custom accounts, use the secure method above. + // Otherwise, return an empty object to use Hardhat defaults if the file + // is included in the main Hardhat config. };