[英]Automatic Transfer of Token in Solidity Contract
I'm brand new to Solidity, and I completed a tutorial to create my own token. 我是Solidity的新手,并且完成了创建自己的令牌的教程。
Is there a way to automatically transfer my tokens to specified addresses at some time interval? 有没有一种方法可以在一定时间间隔内自动将我的令牌转移到指定地址? In other words...
换一种说法...
What code should I add to the contract that will transfer 100 tokens to wallet address 0x... once a day forever into the future? 我应该在合同中添加什么代码,该代码将永远每天一次将100个令牌转移到钱包地址0x ...?
I used the code at the Ethereum Foundation's website: https://www.ethereum.org/greeter 我在以太坊基金会的网站上使用了代码: https ://www.ethereum.org/greeter
Smart contracts need to be called, they can't start a transaction by themselves. 需要调用智能合约,它们不能自己开始交易。
You can add a function that can be called once a day giving 100 tokens to a wallet. 您可以添加一个每天调用一次的功能,向钱包提供100个令牌。 (Use "now" to get the timestamp and verify it hasn't been called today) But you will need to make a transaction calling this function each day.
(使用“现在”获取时间戳并确认今天尚未调用该时间戳),但是您将需要进行每天调用此函数的事务。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.