Automatically calling function and pay gas

Hi community,

currently i deployed a smart-contract for a lottery system of an bsc token. Everything is working perfectly now… also the function for picking a winner… if i do it manually.

What i need now, is a way, how to be able to call that function and pay the gasfee automatically without sitting in front of my pc every 24 hours once the lottery pays out and restarts. … i think i have like to store my privatekey of the admin account anywhere and call that function from this account… but is this possible with moralis?


  1. Use specific wallet (owner wallet of contract)
  2. call the function to pic a winner
  3. pay the gasfees and execute that function

Can anybody help me?


You could run a code that does that from your own computer and run it periodically with task scheduler or cronjob, or you could change the smart contract so that users can call that function after a time has passed and the user that called that function also receives some reward.