波卡一起学

substrate-feeless-token-factory

2019-10-10  本文已影响0人  空乱木

Github地址:
https://github.com/shawntabrizi/substrate-feeless-token-factory

介绍网站地址:
https://www.shawntabrizi.com/substrate/substrate-feeless-token-factory/

What is it?

In simple terms, this project provides a runtime module which provides the following features:

Ideas for alternative payment methods for transfers:

User Story

For example, the "Better Energy Foundation" issue a new token to be used as electricity credits.

When they do this, they fund the token with an initial fund of the underlying blockchain currency: 10,000 units. They specify that the users of their token have 10 free transactions every 1,000 blocks.

They can sell their tokens and transfer them to the buyers just like a normal ICO.

These buyers can then call the try_free_transfer function when trying to trade the token among their peers, and the fees are paid for using the fund.

Anyone in the community can continue to add more funds, and allow the free transfers to continue.

If a user does not have any more "free" transactions left for the current period, they can always make a transaction using the normal transfer function which will charge them a normal fee.

简单总结:
0-目前类似以太坊花费ETH的转账不是很友好,尤其是对于需要转出ERC20的新用户;
1- 转账分为免费和付费两种;
2-初始化 默认给用户10次免费转账的机会;
3-10次免费的转账结束后,按照付费的模式来收取用户的转账费用;

A:交易费用是为了抵抗拒绝服务攻击

如何实现:

B:构建一个交易费用的资金池 - 资金池主要由Token的创建者来维护。(任何人都可以做同样的操作)

代码中测试的部分还没有尝试,找个时间测试一下;

上一篇下一篇

猜你喜欢

热点阅读