【问题标题】:How to make ERC20 smart contracts ask for ether as transaction fee using Remix如何使用 Remix 使 ERC20 智能合约要求以太币作为交易费用
【发布时间】:2022-08-19 20:11:59
【问题描述】:

如果持有令牌的钱包没有将以太币转移到我将在我的代码中指定的地址,我一直在尝试使转移不起作用,我将在我的代码中指定。

    标签: transactions blockchain ethereum smartcontracts


    【解决方案1】:
    1. 智能合约不能要求用户获取token或eth,你应该编程你的DApp或前端来收取交易费用。
    2. 你可以设置类似要求(msg.value==transactionFee)其次是应付(AddressToCollectFees).transfer(msg.value)在智能合约的功能中

    【讨论】:

      猜你喜欢
      • 2022-01-01
      • 1970-01-01
      • 2022-07-21
      • 2021-09-17
      • 2019-01-17
      • 1970-01-01
      • 2021-04-26
      • 2018-06-29
      • 2022-08-17
      相关资源
      最近更新 更多