Skip to content

Commit fc864f0

Browse files
refactor(web3js-transaction): 重构代码结构并添加错误处理模块
将代码拆分为多个模块以提高可维护性,包括合约部署、合约交互、事件监听和错误处理模块。添加了更细致的错误处理逻辑,便于调试和问题追踪。
1 parent f454000 commit fc864f0

File tree

2 files changed

+284
-189
lines changed

2 files changed

+284
-189
lines changed

basic/02-web3js-transaction/config.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
networks: {
3+
sepolia: {
4+
http: `https://sepolia.infura.io/v3/${process.env.INFURA_ID}`,
5+
ws: `wss://sepolia.infura.io/ws/v3/${process.env.INFURA_ID}`,
6+
},
7+
// 可添加其他网络配置
8+
},
9+
gas: {
10+
limit: 8000000,
11+
// 可添加 gasPrice 策略
12+
},
13+
contracts: {
14+
incrementer: {
15+
initialValue: 5,
16+
},
17+
},
18+
};

0 commit comments

Comments
 (0)