听说Python的广告刷爆了你的朋友圈?
01 导语
02 DynamicAppCall 使用方法
from ontology.interop.System.App import DynamicAppCall
2.1 DynamicAppCall API
def Main(operation, args):
if operation == "DynamicCallContract":
if len(args) != 3:
return False
revesedContractAddress = args[0]
opt = args[1]
params = args[2]
return DynamicCallContract(revesedContractAddress, opt, params) return False def DynamicCallContract(revesedContractAddress, operation, params):
res = DynamicAppCall(revesedContractAddress, operation, [params])
Notify(["the result of the DynamicCall is: ", res])
return res def Main(operation, args):
if operation == 'Hello':
msg = args[0]
return Hello(msg) return False def Hello(msg):
return msg 1. 不用每次调用方法时,传入 B 合约的哈希反序; 2. 对于函数调用者而言,合约 B 的哈希是隐形的,可以预先在合约 A 中方便地进行设置,进而保留了动态调用的灵活性,同时也包含了 RegisterAppCall 接口传参的简洁性。from ontology.interop.System.App import DynamicAppCall
from ontology.interop.System.Runtime import Notify
from ontology.interop.System.Runtime import Notify
03 SmartX 示例
04 总结
免责声明:
1.本文内容综合整理自互联网,观点仅代表作者本人,不代表本站立场。
2.资讯内容不构成投资建议,投资者应独立决策并自行承担风险。
- 贝佐斯最后一封股东信:宇宙希望你成为普通人,千万别让它成为现实2021-04-19 17:02
- Props,让互联网与区块链无缝对接的「中间件」2021-04-19 17:02
- Coinbase高管到底卖了多少股票?2021-04-19 16:03
- 通往未来之路:下一代互联网与Metaverse2021-04-19 16:03
- 央行前行长周小川谈比特币:要提醒,要小心2021-04-19 15:03
- 链上新知 |电子图片卖出7000万美金,让马斯克都来站台的NFT究竟是什么?2021-04-19 15:02
- Crypto VC,LP怎么投?2021-04-19 13:03
- 周末比特币融资利率跌至-0.03%低点,为7个月以来最低水平2021-04-19 11:02