I'm writing a Defi project. What I want to do is to set an automatic payment. For example, when a lender asks to lend 10 eth, the money would be automaticly sent to him after a month. I have searched a lot but found nothing. Are there any possible remedy? THANKS!
Asked
Active
Viewed 2,398 times
2 Answers
2
You would have to use chainlink keepers for that.
You can put a require statement that will ensure that the eth won't be sent before the 30 days but there is no way to call the function from solidity after 30 days.

Kuly14
- 496
- 3
- 12
2
I'm writing a Defi project. What I want to do is to set an automatic payment. For example, when a lender asks to lend 10 eth, the money would be automaticly sent to him after a month. I have searched a lot but found nothing.
You don't. In Ethereum, transactions are always initiated by the user, or Externally Owned Accounts (EOAs).
You program your smart contract in a way that after certain block.timestamp
has passed the user can call claim()
function that sends him any payment.

Mikko Ohtamaa
- 82,057
- 50
- 264
- 435