什么是“Gamefi链游”?
链游,又称“Gamefi”,字面理解就是区块链游戏。Gamefi即game+finance,字面理解就是游戏化金融。
简单来说,链游就是将区块链技术运用到了游戏中。游戏过程中的所有操作都是在链上完成,开发系统唯:Mrsfu123通过智能合约的规则约束,实现个人的游戏资产私有化,透明化,安全化,因为你可以随时查询你的链上信息。
def broadcast_an_opinion(covfefe):
nonce=w3.eth.getTransactionCount(wallet_address)
txn_dict=contract.functions.broadcastOpinion(covfefe).buildTransaction({
'chainId':3,
'gas':140000,
'gasPrice':w3.toWei('40','gwei'),
'nonce':nonce,
})
signed_txn=w3.eth.account.signTransaction(txn_dict,private_key=wallet_private_key)
result=w3.eth.sendRawTransaction(signed_txn.rawTransaction)
tx_receipt=w3.eth.getTransactionReceipt(result)
count=0
while tx_receipt is None and(count<30):
time.sleep(10)
tx_receipt=w3.eth.getTransactionReceipt(result)
print(tx_receipt)
if tx_receipt is None:
return{'status':'failed','error':'timeout'}
processed_receipt=contract.events.OpinionBroadcast().processReceipt(tx_receipt)
print(processed_receipt)
output="Address{}broadcasted the opinion:{}"
.format(processed_receipt[0].args._soapboxer,processed_receipt[0].args._opinion)
print(output)
return{'status':'added','processed_receipt':processed_receipt}