如何处理区块链智能合约拍卖中的交易费用

发布于 2025-01-19 10:50:17 字数 419 浏览 3 评论 0原文

我正在写一份智能合约,以列出NFT进行拍卖,而我遵循的流程是automichub,该涉及蜡链上的NFT。他们正在做的是每次出价者的出价时,该金额是从钱包的余额中扣除的,在竞标周期结束时,如果这是获胜的出价,则将NFT授予竞标者,如果退还给钱包, 。

在这个流程中,我假设他们必须将合同的余额转移,然后将金额退还给每个输掉的竞标者。现在解决我的问题,我将通过以太坊网络部署此合同,而汽油费将对我来说是一个巨大的问题。

如果我在一个NFT上获得100个投标,并且在这100个竞标中总共获得1 以太坊,现在合同必须将硬币退还给其余99个用户,则汽油费将是一个主要关心。

因此,我想知道我是否正确解决了这个问题,还是有更好的方法来处理此问题?

任何帮助 /评论将不胜感激。

谢谢。

I am writing a smart contract to list NFT's for auction and the flow I am following is of automichub which deals with NFT's on Wax chain. What they are doing is everytime a bidder place's a bid, that amount is deducted from the wallet's balance and in the end of the bidding cycle if that was the winning bid the NFT is awarded to the bidder else the amount if refunded back to the wallet.

In this flow I am assuming that they must be transferring the balance on their contract and later refunding back the amount to every bidder who lost. Now coming to my problem, I am going to deploy this contract on Ethereum network and the gas fee's is going to be a huge concern for me.

If I get 100 bids on one nft and I get a total of 1 Ethereum in those 100 bids and now when the contract has to return the coins back to the remaining 99 users the gas fees is going to be a major concern.

So I'd like to know am I approaching this problem correctly or is there a better way to handle this?

Any help / comment is appreciated.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

完美的未来在梦里 2025-01-26 10:50:17

你的合同是为人们提供服务。即使它不是商业服务并且您不收取任何佣金,也可以要求维护费。当然,除非你是无偿的。

一些选项:

  • 计算流程的平均 Gas 使用量,任何时候(或第一次)有人出价,要价 + 费用
  • 从卖方付款中扣除。拍卖完成后,您将向卖家发送最高出价。从该付款中扣除总费用

Your contract is providing a service for people. Even if it is not a commercial service and you are not taking any commision, it is OK to ask for a maintenance fee. Unless of course you are going all pro-bono.

Some options:

  • Compute average gas usage of your process, anytime (or the first time) someone bids, ask bid + fee
  • Deduct from seller's payment. Once the auction is complete, you are going to send the highest bid to the seller. Deduct the total fee from that payment
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文