我正在学习python的新区块链编程
而且我已经开始从事一个模块化项目,在该项目中,不同的零件是通过将不同的智能合约链接回的不同智能合约执行的。
我想拥有一个功能,例如:
发送1个NEO合同A - >合同A薄荷糖1 XXX令牌,并将其发送到Cotnract B - ≫
合同B进行了一些操作或锁定资金,然后允许用户回收它,
它纯粹是理论简化的示例来说明我的问题。
在这种情况下,如何支付交易费?如果我想签订合同签订另一个合同,合同是否必须为此交易支付费用?
I'm learning NEO blockchain programming with Python
and I've started working on a modular project where different parts are executed by different smart contracts hard-linked back together.
I want to have a functionality such as:
send 1 NEO to contract A -> contract A mints 1 XXX Token and sends it to cotnract B ->
contract B does some operations or locks the funds for a bit then allows the user to reclaim it
It's purely theoretical simplified example to illustrate my question.
How in such case transaction fees would be paid? If I want a contract to call to another contract, will the contract have to pay the fees for this transaction?
发布评论
评论(1)
N3费用由事务发送者(签名者#0)支付,特别是网络(验证/大小)和系统(执行)费用。无论执行多少代码以及合同调用的深度,所有代码都平等计数,并以单个系统费用付款。通常,您会通过 InvokeFunction 或 RPC API(返回数据中的
GasCunsumed
)。如果是交易发送者,合同可以支付系统费用(在这种情况下,必须具有适当的
verififififififififififififififififififififify
方法),但这是同一模型---一个发件人帐户为整个执行付费。N3 fees are paid by the transaction sender (signer #0), specifically network (verification/size) and system (execution) fees. No matter what amount of code is executed and how deep it goes with contract calls it's all counted equally and paid for with a single system fee. Usually you estimate it with a test invocation via invokefunction or invokescript RPC APIs (
gasconsumed
in returned data).Contract can pay the system fee if it's a transaction sender (in which case it must have an appropriate
verify
method), but that'd be the same model --- one sender account paying for the whole execution.