Ethscriptions commited on
Commit
ea0e23c
·
1 Parent(s): d0f0ba9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -30
app.py CHANGED
@@ -121,36 +121,16 @@ if approved_use:
121
  # 使用字典来跟踪每个地址的nonce
122
  nonces = {}
123
 
124
- # 启用多账户操作
125
- multipl_accounts = st.toggle('启用**多账户**操作')
126
- if multipl_accounts:
127
- # 多账户的文本框
128
- account_list = st.text_area(f'输入多个 **ETH 地址及其对应的私钥**,用英文逗号分隔(,),如下:地址,私钥')
129
- if account_list: # 如果账户列表有内容
130
- for line in account_list.split('\n'): # 根据换行符划分账户
131
- if ',' in line: # 检查是否包含逗号
132
- address, key = line.split(',') # 分开地址和私钥
133
- if is_valid_eth_address(address) and is_valid_eth_private_key(key): # 验证地址和私钥
134
- current_nonce = w3.eth.get_transaction_count(address) # 获取地址的 nonce
135
- nonces[address] = current_nonce # 记录地址的 nonce
136
- accounts.append((address.strip(), key.strip())) # 保存地址和私钥还有 nonce
137
- else:
138
- st.error(f"地址 {address} 或私钥 {key} 无效,请检查!")
139
- st.stop()
140
- else:
141
- st.error(f"输入格式错误,请确保每行包含一个地址和一个私钥,并使用英文逗号分隔(,)。错误行:**{line}**")
142
- st.stop()
143
- else:
144
- account_address = st.text_input('填写你的 **ETH 地址**:')
145
- private_key = st.text_input('填写你的 **ETH 地址对应的私钥**:', type="password")
146
- if account_address and private_key: # 如果地址和私钥有内容
147
- if is_valid_eth_address(account_address) and is_valid_eth_private_key(private_key): # 验证地址和私钥
148
- current_nonce = w3.eth.get_transaction_count(account_address) # 获取地址的 nonce
149
- nonces[account_address] = current_nonce # 记录地址的 nonce
150
- accounts.append((account_address.strip(), private_key.strip())) # 保存地址和私钥还有 nonce
151
- else:
152
- st.error("地址或私钥无效,请检查!")
153
- st.stop()
154
 
155
  # 配置铭文文本
156
  input_data = st.text_input('填写需要题写代币铭文文本', 'data:,{"p":"prc-20","op":"mint","tick":"pols","amt":"100000000"}')
 
121
  # 使用字典来跟踪每个地址的nonce
122
  nonces = {}
123
 
124
+ account_address = st.text_input('填写你的 **ETH 地址**:')
125
+ private_key = st.text_input('填写你的 **ETH 地址对应的私钥**:', type="password")
126
+ if account_address and private_key: # 如果地址和私钥有内容
127
+ if is_valid_eth_address(account_address) and is_valid_eth_private_key(private_key): # 验证地址和私钥
128
+ current_nonce = w3.eth.get_transaction_count(account_address) # 获取地址的 nonce
129
+ nonces[account_address] = current_nonce # 记录地址的 nonce
130
+ accounts.append((account_address.strip(), private_key.strip())) # 保存地址和私钥还有 nonce
131
+ else:
132
+ st.error("地址或私钥无效,请检查!")
133
+ st.stop()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
 
135
  # 配置铭文文本
136
  input_data = st.text_input('填写需要题写代币铭文文本', 'data:,{"p":"prc-20","op":"mint","tick":"pols","amt":"100000000"}')