Skip to content

About

cloudflare worker to update airdrop score for G$ users

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

How points for airdrop are calculated

Wallet points are sum of:

  • number of daily UBI claims on Celo since BLOCK_START
  • sqrt of G$s streamed so far to GoodCollective pools.
  • valid FLOW council votes from ballots subgraph, capped to 2 counted votes per rolling 2-week window.

Notice: Max stream rate for score is 73,000 G$ per day

Notice: Wallet address must be a verified unique human being ie that passed face verification. (You can get verified on: https://gooddapp.org)

Voting points

  • Votes are loaded from FLOW council subgraph ballots by voter id format: ROUND_COUNCIL-address.
  • Each counted vote adds VOTE_POINTS.
  • At most 2 votes are counted in any rolling 2-week span.

Campaign IDs

  • STACK_POINT_SYSTEM_ID is the default campaign for claim/invite/vote events.
  • STACK_G_DONATION_POINT_SYSTEM_ID is optional and, when set, is used only for G$ donation/streaming events: streamed, roundStreamed, opensourceStreamed, opensourceSent.

Campaign API keys

  • STACK_KEY is the default API key used for claim/invite/vote points API calls.
  • STACK_G_DONATION_KEY is optional and, when set, is used for G$ donation/streaming points API calls.
  • If STACK_G_DONATION_KEY is not set, donation/streaming calls fall back to STACK_KEY.

Pausing point allocation

PAUSED_ACTIONS is the single source of truth for freezing point allocation. Any listed action returns its existing CMS balance, skips activity-event fetching, and does not receive new points. It is a comma-separated list of event names. An empty or unset value leaves all actions enabled.

For example, to pause claims and votes while continuing invites and streaming:

PAUSED_ACTIONS = 'claimed,roundVotes'

Whitespace around commas is ignored. Use PAUSED_ACTIONS = '*' to pause all actions. Do not set an action's point rate to 0 as a pause mechanism; the reconciliation logic would interpret that as a negative adjustment and remove previously awarded points.

Historical event data source

  • Stream-period and FLOW council vote calculations remain subgraph-based because they did not have an equivalent legacy Blockscout implementation.
  • BLOCKSCOUT_API_KEY is required for the default path and should be stored as a Worker secret (wrangler secret put BLOCKSCOUT_API_KEY). The worker uses Blockscout’s Celo PRO endpoint: https://api.blockscout.com/api?chain_id=42220.
  • Blockscout getLogs is capped at 1,000 logs per request; a full result set is recovered by recursively splitting saturated block ranges rather than trusting page numbers.

Rate limit

  • The worker enforces 1 request per address per hour.
  • Window is configurable via ADDRESS_RATE_LIMIT_SECONDS (default 3600).

Max score

If you claim every day for two years the max points you can get are 730. If you stream every day 73K G$ for two years the max points you can get are 7300.

Gas fees

We will subsidize gas fees on base so users can update their points at least once a month.

About

cloudflare worker to update airdrop score for G$ users

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages