贡献python科学家脚本--煞笔opbn项目方


规则

煞笔opbn项目方,煞笔规则,一个地址只能打100次。

批量生成钱包地址

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
33
from eth_account import Account, messages
from eth_account.hdaccount import Mnemonic

def generate_opbnb_wallets(num_wallets=10):
wallets = []
for _ in range(num_wallets):
account = Account.create()
address = account.address
private_key = account.privateKey.hex()

# Generate mnemonic
mnemonic = Mnemonic().to_mnemonic(account.key)

wallet_info = {
'address': address,
'private_key': private_key,
'mnemonic': mnemonic
}
wallets.append(wallet_info)

return wallets

if __name__ == "__main__":
num_wallets = 10
opbnb_wallets = generate_opbnb_wallets(num_wallets)
target_addresses = []
for i, wallet in enumerate(opbnb_wallets, start=1):
target_addresses.append(wallet['address'])
print(f"{wallet['address']}")
print(f"{wallet['private_key']}")
print(f"{wallet['mnemonic']}")

print(f"{target_addresses}")

批量转账

下面程序中,sender_address和private_key是你的发送BNB的地址。上一步生成的地址,拷贝,放到target_addresses数组里,每个地址转0.01BNB,可以自行修改,

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
33
34
35
36
37
from web3 import Web3
from web3.middleware import geth_poa_middleware

rpc_url = ""
web3 = Web3(Web3.HTTPProvider(rpc_url))
web3.middleware_onion.inject(geth_poa_middleware, layer=0)

sender_address = ""
private_key = ""

target_addresses = ['']

amount_to_send = Web3.toWei(0.01, 'ether')

def build_transaction(to_address):
transaction = {
'to': web3.toChecksumAddress(to_address),
'value': amount_to_send,
'gas': 21000,
'gasPrice': int(web3.eth.gas_price*1.0),
'nonce': web3.eth.getTransactionCount(sender_address),
'chainId': 204,
}
return transaction

def send_transaction(transaction, private_key):
signed_transaction = web3.eth.account.signTransaction(transaction, private_key)
transaction_hash = web3.eth.sendRawTransaction(signed_transaction.rawTransaction)
return transaction_hash

for target_address in target_addresses:
transaction = build_transaction(target_address)
transaction_hash = send_transaction(transaction, private_key)
receipt = web3.eth.wait_for_transaction_receipt(transaction_hash, timeout=120)
print(f"Transaction sent to {target_address}. Transaction Hash: {web3.toHex(transaction_hash)}")
if receipt.status == 1:
print(f"successfully sent to {target_address}")

打铭文

按照项目方的煞笔规则,每个地址可以打100次铭文,打超的部分作废,你有10个地址的话,就起10个程序跑。

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
33
34
35
36
37
38
39
40
41
42
43
44
from web3 import Web3
from dotenv import load_dotenv
import os,time
load_dotenv()

private_key = '填你wallet的private key'
address = '填你wallet的address'
rpc_url = "https://1rpc.io/opbnb"
web3 = Web3(Web3.HTTPProvider(rpc_url))
address = Web3.toChecksumAddress(address)
print(web3.isConnected())
print(Web3.fromWei(web3.eth.get_balance(address),'ether'))
c=0
while True:
nonce = web3.eth.get_transaction_count(address)
gas_price = int(web3.eth.gas_price*1.5)
tx = {
'nonce': nonce,
'chainId': 204,
'to': Web3.toChecksumAddress("0x83b978cf73ee1d571b1a2550c5570861285af337"),
'from':address,
'data':'0x646174613a6170706c69636174696f6e2f6a736f6e2c7b2270223a226f70627263222c226f70223a226d696e74222c227469636b223a226f70626e227d', #mint 16进制数据
'gasPrice': gas_price,
'value': Web3.toWei(0, 'ether')
}
try:
gas = web3.eth.estimate_gas(tx)
tx['gas'] = gas
print(tx)
signed_tx = web3.eth.account.sign_transaction(tx,private_key)
tx_hash = web3.eth.send_raw_transaction(signed_tx.rawTransaction)
print(web3.toHex(tx_hash))
receipt = web3.eth.wait_for_transaction_receipt(tx_hash, timeout=120)
if receipt.status == 1:
if c > 100:
sys.exit()
c = c+1
time.sleep(20) # 可以自行修改
print("%s Mint Success!" %c)
continue
else:
continue
except Exception as e:
print(e)

私人RPC节点

不用花钱买,免费注册, 有http请求额度,不过够用了。 注册地址:https://nodereal.io,注册后,选opbnb链,会生成您专属的opbnb链RPC链接,替换到上面👆🏻程序中的rpc_url即可

批量归集

等opbn出转账功能了,再补上。


文章作者: black_leaf
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 black_leaf !
  目录