问题标签 [elrond]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
66 浏览

rust - 如何从 `wasm` 文件夹生成内容?

我正在尝试从头开始构建智能合约。我从cargo new my-contract. 我连接了 Elrond 依赖项,现在 cargo run 没有抱怨。

现在,当我跑步时,erdpy contract build我得到

FileNotFoundError:[Errno 2] 没有这样的文件或目录:'/home/bogdan/workspace/sc-from-scratch/wasm'

当我查看其他模板时,我看到生成了这个 wasm 文件夹的内容。这是我的问题的相关提交:https ://github.com/bogdan-marian/sc-from-scratch/commit/aa6f912e6bca413a91f18c9de52257390645b139

如何从wasm文件夹中生成内容?

0 投票
1 回答
93 浏览

elrond - 如何格式化 EGLD 值发送到 SC/Account?

我正在尝试将 EGLD 值(例如 1.5 EGLD)发送到帐户/智能合约,但在某些情况下,似乎只允许使用 BigUInt 类型。这个值是如何工作的,我应该如何正确格式化它?

0 投票
1 回答
70 浏览

elrond - 如何从查询中解码 base64 和十六进制响应

查询如下

我怎样才能解码那个字符串?我可以看到它首先是可解码的 base64,但之后我得到了一个非常奇怪的字符串。有人可以告诉我接收解码的最终字符串的步骤吗?

0 投票
1 回答
140 浏览

smartcontracts - 如何将 EGLD 值发送到智能合约端点?

我有一个看起来像这样的智能合约方法:

我在交易中使用 5 EGLD 值以及 tx 数据来调用它

myEndpoint@05@aa

但 tx 结果返回我wrong number of arguments

我究竟做错了什么?

0 投票
1 回答
48 浏览

elrond - 构建 Elrond 合约时出现 rust 编译器的错误

我在 Elrond 众筹教程中,完成初始化函数时出现此错误。

我已经做了

有一次合同是空的并且有效。但是当向 init 函数添加主体时,编译器会出现恐慌。

我已经尝试升级并重新安装 rust。
还尝试了 1.6 nightly 版本,但它不起作用。

我在 Ubuntu-Zorin 上。

0 投票
2 回答
66 浏览

elrond - 合同调用:数字参数

我有一个问题,我正在尝试解决一天。

我想用 dapp 更改 nft 价格,但只有当我将其更改为 0.5 EGLD 或 1 EGLD 时它才有效。如果高于它,则返回错误“向非应付合同发送价值”

因此,如果我将价格设置为 2EGLD = 20000000000000000000 并将其转换为十进制十六进制,它将返回 setNewPrice@029a2241af62c0000 当它应该是 setNewPrice@29a2241af62c0000

我知道问题是十六进制的第一个“0”,但是如果它高于 1 EGLD,为什么它不起作用?因为如果我设置为 1EGLD 它返回 setNewPrice@0de0b6b3a7640000 这是正确的。

这就是我将数字转换为十六进制的方式

我正在调用这个 SC 函数

那么什么时候应该在十六进制前面有 0 呢?而“if (hex.length < 2)”我必须将其更改为“if (hex.length < 2000000000000000000)”,因为我必须使用 2/10^18

谢谢!

0 投票
1 回答
34 浏览

elrond - 表示一个向量在 Mandos 输出?

我正在写一个 mandos json 测试。

这是我的方法。

它返回一个带有地址的向量。我很可能知道这种方法有效,我只需要测试它,(我不知道如何编写测试)。

我想编写一个测试,确保它返回一个带有 2 个地址的向量。

这是我的 mandos 测试:

这是我的错误输出:

0 投票
0 回答
38 浏览

javascript - Getting tx info when initiating tx and signing it

I have a bug I can't solve.

Consider the code above, useSignTransactions() is imported in the header.

Then, I call SendTransactions function and expect a session id back, which is fine. But, using the mentioned code I want some more info such as hasTransactions, error and so on.

When logging I only get the sessionId corrent, the others are just objects.

All these are wrapped in _app,js as follows:

I tried several things, in the end I'll monitor the tx separately if the above mentioned hooks don't get me the data I want.

0 投票
0 回答
41 浏览

elrond - 如何请求 MEX 的 APR?

我需要从https://maiar.exchange/farms获得 MEX 的 APR :

墨西哥令牌四月

我将https://graph.maiar.exchange/graphql与以下查询一起使用: query{farms{address,farmedTokenPriceUSD, farmingToken{identifier}, apr}},但不知何故,我从https://maiar.exchange/farms中得到了不同的值:

0 投票
1 回答
42 浏览

reactjs - 如何在 elrond 网络上跟踪交易状态

有人可以帮助跟踪 elrond 网络上价值转移的交易状态吗?

我目前正在使用sendTransactions发送我的交易。