Docs/Getting Started

Getting Started

Set up your first AutoLoop contract in under 5 minutes.


Prerequisites

Installation

AutoLoop is published to the Lucky Machines registry.

npm install @luckymachines/autoloop

For Foundry projects, add a remapping to remappings.txt:

@luckymachines/autoloop/=node_modules/@luckymachines/autoloop/

One-Command Local Setup

./quickstart.sh

This starts a complete local environment:

  • Anvil local chain (2s blocks)
  • Deploys all contracts + a sample NumberGoUp contract
  • Registers, funds, and starts automation
  • Runs a worker monitoring the chain
  • Launches the dashboard at http://localhost:3000

Connect MetaMask to http://127.0.0.1:8545 (chain ID 31337) and import the test private key:

0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

Choose Your Contract Type

AutoLoop offers three base contracts depending on your needs:

Base ContractUse CaseGas per Tick
AutoLoopCompatiblePure automation — no randomness~90,000
AutoLoopHybridVRFCompatibleSelective VRF — randomness when you need it~90k / ~240k
AutoLoopVRFCompatibleFull VRF — randomness on every tick~240,000

Most game developers should start with Hybrid VRF — it gives you cheap standard ticks with on-demand randomness for loot drops, crits, spawns, and special events.

How It Works

  1. Inherit from one of the three base contracts
  2. Implement shouldProgressLoop() and progressLoop() (or _onTick() / _onVRFTick() for hybrid)
  3. Register your contract on-chain via the dashboard or directly
  4. Fund with ETH to cover gas + fees
  5. Workers auto-detect your contract type via ERC-165 and execute accordingly

Deployed Contracts

Mainnet

ContractAddress
AutoLoop0x6748415BcE63c0FBf1E50ceB2128BfeAC977224F
Registry0xC1b9241DE87108EffF5caAf0340CcEbD05A5425f
Registrar0x202d73Ac243907A6e81B5FF55E4c316567e4fF80

Sepolia

ContractAddress
AutoLoop0x311eB21A1f7C0f12Ea7995cd6c02855b1bDa2132
Registry0xAC905aF2e40404D06317911beb03317Bd1bc5858
Registrar0xDA2867844F77768451c2b5f208b4f78571fd82C1

Next Steps