How can I create a single function which on its own, will reward an address with minted tokens if a certain time condition is met? Every time I try, I can only get it to work if I create two functions and use pull pattern; to pull out the minted tokens to the subject address of my choice.
Asked
Active
Viewed 73 times
0
-
3Share your code here. – Elisha Drion Apr 29 '18 at 15:05
-
Always favour pull over push mechanism – Prashant Prabhakar Singh Apr 29 '18 at 15:53
-
Does this post help? – sfmiller940 Apr 29 '18 at 17:13
-
do you want the function to reward the minted tokens when the time condition is met (possible only with pull), or reward it if the time condition is satisfied at the time of sending? (you don't need a pull in this case). – shaish Apr 29 '18 at 20:24
-
@shaish, Imagine a time-based lending contract where users are able to lend tokens to the contract and get back the same initial lended amount + an interest rate after x days. I want this payback action to be pushed back to the user without requiring the user to pull it by calling additional functionality.. – NowsyMe Apr 30 '18 at 08:44