ubiquity / faucet

Faucet cloudflare worker for prefunding bounty hunters' addresses

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

faucet

Faucet cloudflare worker for prefunding bounty hunters' addresses

How it works

  1. Some 3rd party service (for example ubiquity bot) sends a POST request with the address query param, for example: https://ubq-faucet.workers.dev/?address=0x01
  2. Openzeppelin Defender Relay service prefunds the 0x01 address with some gas payment tokens (XDAI, ETH, etc...) if the following conditions are met:
    • wallet address exists in the ubiquity bot's DB (i.e. the wallet is registered by some bounty hunter)
    • this is the 1st issue solved by a bounty hunter (i.e. the registered wallet address hasn't got any permits)
    • wallet address has 0 gas tokens amount

How to run locally

  1. Setup env variables in the .dev.vars file:
# Environment variables used for development build on `yarn start`

# openzeppelin defender relay API key
RELAY_KEY=
# openzeppeling defender relay secret
RELAY_SECRET=

# supabase DB URL
SUPABASE_URL=
# supabase DB secret key
SUPABASE_ANON_KEY=

# fund amount in wei
CLAIM_FEE=
  1. Run yarn start to start a local cloudflare worker instance

About

Faucet cloudflare worker for prefunding bounty hunters' addresses

License:MIT License


Languages

Language:TypeScript 100.0%