5

假如web3.py的合约没有开源,如何根据from_data发起交易?

 2 years ago
source link: https://learnblockchain.cn/question/2556
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
假如web3.py的合约没有开源,如何根据from_data发起交易? | 登链社区 | 技术问答

假如web3.py的合约没有开源,如何根据from_data发起交易?

web3.eth.account.sign_transaction(dict, private_key)

1828644d8d91d4239b3ee2e32aab026.png

这个方法第一个参数是字典,如何将以上的metamask里面的十六进制的机器码转化成字典呢?

Tiny熊 - 布道者 2小时前

  擅长:智能合约,以太坊

我基本都是使用js 与合约交互,但是这个字典对应的交易信息应该是这样:

transaction = {
...     'to': '...',
...     'value': 1000000000,
...     'gas': 2000000,
...     'gasPrice': 234567897654321,
...     'nonce': 0,
...     'chainId': 1,
...     'data': '..........'
... }

只有 data 字段的内容对应找区块链浏览器里的数据,因此你直接把内容复制过来就可以。

您需要登录后才可以回答问题,登录 或者 注册

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK