你能告诉我如何使用 InvokeScriptTransaction
Can you tell me how to use InvokeScriptTransaction
这是 WAVES IDE 的一个例子。
请告诉我如何使用 InvokeScriptTransaction 来执行'func divideAmount ()'。
# waves IDE example
let Alice = Address(base58'3NBVqYXrapgJP9atQccdBPAgJPwHDKkh6A8')
let Bob = Address(base58'3N78bNBYhT6pt6nugc6ay1uW1nLEfnRWkJd')
@Callable(i)
func divideAmount() = {
let transferAmount = wavesBalance(this) / 2
TransferSet([
ScriptTransfer(Alice, transferAmount, unit),
ScriptTransfer(Bob, transferAmount, unit)
])
}
我在测试网上为我的账户设置了一个脚本。
但是,我不明白它调用了 InvokeScriptTransaction。
如果你使用 IDE you can run in the console. It is also available in the JS library (waves-transactions).
broadcast(invokeScript({contractAddress: {CONTRACT_ADDRESS_HERE}), call:{function:"divideAmount",args:[]}, payment: []}))
这是 WAVES IDE 的一个例子。 请告诉我如何使用 InvokeScriptTransaction 来执行'func divideAmount ()'。
# waves IDE example
let Alice = Address(base58'3NBVqYXrapgJP9atQccdBPAgJPwHDKkh6A8')
let Bob = Address(base58'3N78bNBYhT6pt6nugc6ay1uW1nLEfnRWkJd')
@Callable(i)
func divideAmount() = {
let transferAmount = wavesBalance(this) / 2
TransferSet([
ScriptTransfer(Alice, transferAmount, unit),
ScriptTransfer(Bob, transferAmount, unit)
])
}
我在测试网上为我的账户设置了一个脚本。 但是,我不明白它调用了 InvokeScriptTransaction。
如果你使用 IDE you can run in the console. It is also available in the JS library (waves-transactions).
broadcast(invokeScript({contractAddress: {CONTRACT_ADDRESS_HERE}), call:{function:"divideAmount",args:[]}, payment: []}))