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/autoloopFor Foundry projects, add a remapping to remappings.txt:
@luckymachines/autoloop/=node_modules/@luckymachines/autoloop/One-Command Local Setup
./quickstart.shThis 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:
0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80Choose Your Contract Type
AutoLoop offers three base contracts depending on your needs:
| Base Contract | Use Case | Gas per Tick |
|---|---|---|
AutoLoopCompatible | Pure automation — no randomness | ~90,000 |
AutoLoopHybridVRFCompatible | Selective VRF — randomness when you need it | ~90k / ~240k |
AutoLoopVRFCompatible | Full 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
- Inherit from one of the three base contracts
- Implement
shouldProgressLoop()andprogressLoop()(or_onTick()/_onVRFTick()for hybrid) - Register your contract on-chain via the dashboard or directly
- Fund with ETH to cover gas + fees
- Workers auto-detect your contract type via ERC-165 and execute accordingly
Deployed Contracts
Mainnet
| Contract | Address |
|---|---|
| AutoLoop | 0x6748415BcE63c0FBf1E50ceB2128BfeAC977224F |
| Registry | 0xC1b9241DE87108EffF5caAf0340CcEbD05A5425f |
| Registrar | 0x202d73Ac243907A6e81B5FF55E4c316567e4fF80 |
Sepolia
| Contract | Address |
|---|---|
| AutoLoop | 0x311eB21A1f7C0f12Ea7995cd6c02855b1bDa2132 |
| Registry | 0xAC905aF2e40404D06317911beb03317Bd1bc5858 |
| Registrar | 0xDA2867844F77768451c2b5f208b4f78571fd82C1 |
Next Steps
- Standard Contract — pure automation, no randomness
- Hybrid VRF Contract — selective randomness
- Full VRF Contract — randomness on every tick
- Examples — complete, deployable example contracts