如何在eztz呼叫中指定智能合约入口点?
1 个回答
- 投票数
Michelson目前不支持多个入口点.流动性使用联合(或类型变量)来弥补这一点.联合具有左侧和右侧,但也可以嵌套.
让我们分析所提供脚本的参数:
parameter
(or :_entries
(int %_Liq_entry_create) <-- Left Side
(int %_Liq_entry_main)) <-- Right Side
;
因此,要调用第一个入口点,请在eztz中使用以下内容:
eztz.contract.send(contract,from, keys, amoun, "(Left 1)", gasLimit,storageLimit)
要访问第二个入口点,您将使用:
eztz.contract.send(contract,from, keys, amoun, "(Right 1)", gasLimit,storageLimit)
这不是eztz特有的,但适用于从所有钱包甚至tezos-client调用智能合约.
Michelson doesn't support multiple entry points right now. Liquidity uses unions (or type variables) to make up for this. A union has a Left and Right side, but can also be nested.
Let's analyse the parameter of the script provided:
parameter
(or :_entries
(int %_Liq_entry_create) <-- Left Side
(int %_Liq_entry_main)) <-- Right Side
;
So, to call the first entry point, you would use the following in eztz:
eztz.contract.send(contract,from, keys, amoun, "(Left 1)", gasLimit,storageLimit)
To access the second entry point, you would use:
eztz.contract.send(contract,from, keys, amoun, "(Right 1)", gasLimit,storageLimit)
This is not specific to eztz, but applies to calling smart contracts from all wallets and even the tezos-client.
我想与eztz签订智能合约:
如何指定切入点,我的智能合约有多个切入点: