【问题标题】:How do we pass the integer as an application argument? (Algorand, JS SDK)我们如何将整数作为应用程序参数传递? (Algorand, JS SDK)
【发布时间】:2022-08-11 22:35:16
【问题描述】:

我正在使用 Algorand JS SDK。

在这里,10 对应于我需要提取的金额,并且在合同中我将其读取为 Btoi(Txn.application_args[1])

但我收到错误transaction XBDYB2GZCDKTDWHR2UU4BEPHACSTNBW5DDAROBL3RW3QY6PTWMHA: logic eval error: underflow on subtracting 12592 from sender amount 5000. Details: pc=119, opcodes=txna Assets 0 itxn_field XferAsset itxn_submit

我怎样才能传递一个int?

    标签: javascript algorand


    【解决方案1】:

    您需要编码为 uint 64。

    试试这个:appArgs.push(algosdk.encodeUint64(10))

    【讨论】:

      猜你喜欢
      • 2022-10-19
      • 2020-01-19
      • 1970-01-01
      • 2020-08-22
      • 2016-01-09
      • 2018-01-08
      • 1970-01-01
      • 1970-01-01
      • 2014-07-10
      相关资源
      最近更新 更多