获得智能合约,web3 python
如何仅使用合约地址来访问智能合约调用?正确地,我理解地址就足够了,因为在它的帮助下我可以参考合同日期字段,并通过解码 abi?
还不清楚为什么在 web3 中,当引用合约时,必须同时使用地址和 abi?
token_contract = w3.eth.contract(address=address, abi=abi)
为什么不:
token_contract = w3.eth.contract(address=address)
How can I access smart contract calls with only the address of the contract? Correctly, I understand that the address will be enough, because with the help of it I can refer to the contract date field, and by decoding the abi?
It is also not clear why in web3, when referring to a contract, it is obligatory to use both the address and abi?
token_contract = w3.eth.contract(address=address, abi=abi)
why not:
token_contract = w3.eth.contract(address=address)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Abi 讲述如何与您的合约交互/使用您的合约。仅地址是不够的,它只是指向以二进制形式(操作码)存储的区块链上的合约。 Abi就像智能合约的用户手册。
Abi tells how to interact with/use your contract. Address alone is not enough, it just points to contract on blockchain which is stored in binary form(opcodes). Abi is like an user manual of smart contract.