Move.

帖子

分享您的知识。

CarlkawIy.
Jan 15, 2025
专家问答

How can I minimize transaction fees for user votes in my app?

I'm developing an app where users make posts and others pay with custom coins to vote on these posts. Currently, each vote counts as a separate transaction, leading to potentially 12,000 transactions a month. Paying for each transaction gas fee is unfeasible for my project. I'm considering sponsored transactions or PTBs but am unsure how to reduce these fees effectively. Can I batch transactions, or is there another solution that I can implement?

  • Move CLI
  • Move
1
3
分享
评论
.

答案

3
Raju.
Raju158
Jan 15 2025, 13:59

让用户预先签署交易以供日后提交通常是不可行的. 相反,可以考虑让他们签署个人信息作为投票证明. 这些消息可以存储并在以后提交. 虽然你无法直接将投票批量存入 PTB,但管理合约功能可能允许在后端采用有效的选票记录方法,从而有可能减少必要的链上交易数量.

1
最佳答案
评论
.
Tawhid.
Jan 16 2025, 02:49

PTB 可能无济于事,因为您无法在 PTB 中合并来自多个用户的交易. 但是,如果你的智能合约允许,你可以创建一笔交易,通过管理员上限记录许多用户的投票,然后通过cron作业提交. 与单独处理每张投票相比,这可能会压缩和减少交易.

2
评论
.
tomek.
Jan 16 2025, 00:45

赞助交易可能适合您的情况,但您需要一个后端来处理交易. 如果你选择赞助路线,Enoki可能是一个很好的起点. 但是,可以考虑使用提交交易的后端,用户可以在该后端签署个人消息以进行地址验证. 您仍然需要后端进行交易,但它可能比个人处理的费用更低.

0
评论
.

你知道答案吗?

请登录并分享。

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

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

赚取你的 1000 Sui 份额

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

奖励活动七月