-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
32 lines (27 loc) · 1011 Bytes
/
hardhat.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import * as dotenv from 'dotenv';
import "@nomicfoundation/hardhat-ethers";
import path from 'path';
import { fileURLToPath } from 'url';
import "@nomiclabs/hardhat-ganache";
// ESモジュール用の__dirname代替
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
dotenv.config({ path: path.join(__dirname, '.env') });
// デバッグ用のログ出力
console.log('RPC_URL:', process.env.RPC_URL);
console.log('ACCOUNT_PRIVATE_KEY:', process.env.ACCOUNT_PRIVATE_KEY);
console.log('ACCOUNT_2_PRIVATE_KEY:', process.env.ACCOUNT_2_PRIVATE_KEY);
const account1 = process.env.ACCOUNT_PRIVATE_KEY as string
const account2 = process.env.ACCOUNT_2_PRIVATE_KEY as string
const config: HardhatUserConfig = {
solidity: "0.8.28",
networks: {
localganache: {
url: process.env.RPC_URL,
accounts: [account1, account2],
},
},
};
export default config;