Move.

帖子

分享您的知识。

yhant3.
Jan 04, 2025
专家问答

How to get the amount of SUI coins using Move language?

I'm working with the Move language and I want to create a function that retrieves the amount of SUI coins held by a specific address. Is there an existing module or function in Move that can help me achieve this?

  • Move CLI
0
1
分享
评论
.

答案

1
elfDani.
Jan 4 2025, 19:27

你不能直接通过 Move 执行此操作,因为 Sui 上的智能合约无法访问全局存储,这与 Solidity/EVM 不同. 要找出地址的硬币余额,你需要通过RPC/GraphQL或使用SDK客户端对整个节点进行外部查询.

1
最佳答案
评论
.

你知道答案吗?

请登录并分享。

Move is an executable bytecode language used to implement custom transactions and smart contracts.

148帖子231答案
Sui.X.Peera.

赚取你的 1000 Sui 份额

获取声誉积分,并因帮助 Sui 社区成长而获得奖励。

奖励活动七月