Automatic Transfer of Token in Solidity Contract

2.6k views Asked by At

I'm brand new to Solidity, and I completed a tutorial to create my own token.

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?

I used the code at the Ethereum Foundation's website: https://www.ethereum.org/greeter

1

There are 1 answers

1
clemage On BEST ANSWER

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. (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.