气盘和锁定令牌特定时间
我想呼射并预售我的胜利令牌 因此,在下一步中,我想锁定它们,直到我的IDO数据来了 并在这段时间解锁30%的用户钱包余额 下个月50% 最好的方法是什么
I want to airdrop and presale my won token
so in the next step I want to lock them until my IDO data come
and unlock in this time 30% of user wallet balances
and next month 50 %
what is the best way to do this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您希望在没有后端或任何用户或进行交易的情况下自动出现某些日期时将您的令牌发送给用户,则不可能。如果不使用用户或后端脚本调用事务,则不能执行区块链操作。
您可以编写以下空调合同以获得所需的结果:
用户将稳定的硬币发送到您的空投合同。这些用户的地址应存储在某个地方。您可以自动存储代币买家的地址和数量(在区块链上的数组 -
地址[]买家
,uint256 []量
)。如果您希望用户单击网站上的按钮以接收可用数量的令牌,则如果呼叫者以前发送了稳定的硬币,则AirDrop合同应具有将适量的令牌发送给呼叫者的方法。此方法应检查,如果
msg.sender
在购买者
中(检查阵列可能很昂贵,您可以创建买家
仅对此检查)以及是否有空调日期(您可以在某个数组中保存时间戳,并通过与block.timestamp
进行比较来保存任何日期。如果满足了这两个要求,则合同将从您的余额(转移
)或余额(Transfer
)从汇率上发送令牌。如果您想自己发送交易以将所有令牌提供给买家,则可以制作方法,只能由您调用(拥有的将非常有帮助)。在此方法中,合同通过
买家
数组,然后发送金额[publeerIndex]*交换
向每个人交换。此方法不需要用户单击任何按钮,但气体的昂贵,因此对您来说可能非常昂贵。If you want your token to be sent to users when certain date comes automatically without backend or any users or you doing the transactions, it is not possible. Blockchain operations cannot be executed without calling a transaction using scripts by user or backend.
You can write the following airdrop contract to achieve desired result:
Users send stable coins to your airdrop contract. Addresses of these users should be stored in some place. You can store addresses and amounts of token buyers automatically (in arrays on the blockchain -
address[] buyers
,uint256[] amounts
).If you want users to click on button on website to receive available amount of tokens, your airdrop contract should have a method to send right amount of your token to caller if the caller sent stable coins before. This method should check, if
msg.sender
is inbuyers
(check in array can be expensive, you can create abuyers
map only for this check) and if airdrop date has come (you can save timestamps in seconds in some array and check if any date has come via comparison withblock.timestamp
). If both requirements are met, contract sends tokens from your balance (transferFrom
) or from its balance (transfer
) following the exchange rate.If you want send the transaction by yourself to give all tokens to buyers, you can make the method, which can be called only by you (Ownable will be very helpful). Inside this method, contract goes through
buyers
array and sendamount[buyerIndex]*exchangeRate
to each of them. This method doesn't require users to click on any buttons, but can be very expensive in gas and hence for you.