Luckblocks
  • 🎲LuckBlocks - Decentralized Raffles
  • Lotteries
    • BTC Lottery
    • ETH Lottery
    • POL Lottery
    • CRANNI Lottery
    • Verify
  • Auto Spin Draw
    • How queue works
    • How to configure automation
    • Automate Lotteries Bets
  • Cranni Societas - NFTnodes
  • CRANNI Token
    • Synthetic Tokens Overview
    • Additional Features: Overcollateralization and Integration with Luckblocks Lottery
  • Staking
  • Contracts
  • DAPP
  • DAPP(IPFS)
Powered by GitBook
On this page
  • Automatic Execution with Gelato Network
  • Automatic Execution Functionality via Ethers.js / Web3.js
  1. Auto Spin Draw

How to configure automation

PreviousHow queue worksNextAutomate Lotteries Bets

Last updated 4 months ago

Automatic Execution with Gelato Network

Enter choose polygon network and make sure you have a NFT from Cranni Societas Collection staked on Luckblocks.

1.Click on funds on top left and refill your gelato account with POL to pay gas fees.

2.Once refilled click the blue button "Create Task" on right in main page

3.Put the desired lottery contract address on field, for example > (BTC Lottery Contract)

4. Once loaded choose autoSpin(address: _caller, uint256[]: _nodes) function on dropdown list

5. On address _caller field put your wallet address , the same wallet which you have staked the NFTs and refilled gelato balance, this will also be where you will receive the rewards.

6.On uint256[] _nodes field you need to put the ids of your staked NFTs in that format: [23,48] >> Example showing a case where i had NFTs with ID 23 and 48. Remember NFTNode Common can only run the daily draw and not the weekly draw, as the NFTNode Golden can only run the weekly draw and not the daily draw.

7. on WHEN part choose "Whenever Possible" and on Pay with part choose "Gelato Balance".

8. Choose wherever name of task you prefer and press Create Task.

Done! now you will run the autoSpin function whenever possible automatically and help the auto draws on Luckblocks while earning passive income in USDT. Don't forget to replenish some POL on Gelato Balance from time to time to pay for the gas fees.

Automatic Execution Functionality via Ethers.js / Web3.js

In Web3.js, Ethers.js, or any other server-side language, interacting with a smart contract to run functions like autoSpin(*yourWallet*, *yourNodesArray*) is a common approach.

Automating Lottery Spins

We’ve simplified this process by providing a pre-built script that automates the entire process of scheduling lottery spins based on your specified lottery type (either Daily or Weekly). The script works by detecting the nodes associated with the wallet configured as the executor in the contract. Once it identifies the nodes, it triggers the necessary actions to execute the spin at the right intervals.

How It Works

  • Daily/Weekly Scheduling: The script runs the lottery spins based on the contract’s predefined schedule and your configured enviroment variable. (either daily or weekly).

  • Node Detection: It automatically detects the nodes associated with the wallet that is set as the executor of the lotteries on your enviroment.

  • Automatic Execution: Once set up, the script runs in the background, ensuring that lotteries are executed as per schedule without manual intervention.

Setup

You can find the full script and all necessary instructions on how to implement and run the lottery manager on our .

GitHub Repository
https://app.gelato.network/