小编Jus*_*Cho的帖子

Python Web3 Ganache - BuildTransaction 上的回溯错误

我正在 YouTube 上学习freeCodeCamp课程,在运行该程序时发现了一个错误。当我试图在 Ganache 中建立一个交易时。我在 Ganache 日志中看到也有活动。第一次发帖,请告诉我还应该提供哪些信息!

\n

课程:Solidity、区块链和智能合约课程 \xe2\x80\x93 初学者到专家 Python 教程

\n
transaction = SimpleStorage.constructor().buildTransaction(\n    {"chainId": chain_id, "from": my_address, "nonce": nonce}\n)\n
Run Code Online (Sandbox Code Playgroud)\n

终端返回的错误:

\n
transaction = SimpleStorage.constructor().buildTransaction(\n    {"chainId": chain_id, "from": my_address, "nonce": nonce}\n)\n
Run Code Online (Sandbox Code Playgroud)\n

我使用的完整代码如下:

\n
from solcx import compile_standard, install_solc\nimport json\nfrom web3 import Web3\n\nwith open("./SimpleStorage.sol", "r") as file:\n    simple_storage_file = file.read()\n\n# Compile Our Solidity\nprint("Installing...")\ninstall_solc("0.6.0")\n\ncompiled_sol = compile_standard(\n    {\n        "language": "Solidity",\n        "sources": {"SimpleStorage.sol": {"content": simple_storage_file}},\n        "settings": {\n            "outputSelection": {\n                "*": {\n                    "*": [\n                        "abi",\n                        "metadata",\n                        "evm.bytecode",\n …
Run Code Online (Sandbox Code Playgroud)

python blockchain solidity ganache web3py

3
推荐指数
1
解决办法
1509
查看次数

标签 统计

blockchain ×1

ganache ×1

python ×1

solidity ×1

web3py ×1