Skip to content

feat(rep): source total supply from the live REP contract #168

Description

@jubalm

Summary

The /rep page added by #167 hardcodes the REP total supply and leaves an inline TODO(publish) to manually re-read totalSupply() before publishing. The current values can become stale as the token supply changes, and the three related fields can drift apart:

  • totalSupply
  • totalSupplyRaw
  • totalSupplyReadOn

Goal

Source the displayed REP total supply from the current Ethereum mainnet contract at build/publish time, or through another agreed data pipeline, so maintaining the page does not depend on remembering a manual TODO.

Acceptance criteria

  • Read totalSupply() from 0xCf6A0A7826fa124B7705d6f3c675eAD76f1e540D on Ethereum mainnet (chain ID 1).
  • Derive the formatted supply and exact raw value from the same on-chain response, respecting the contract's 18 decimals.
  • Derive totalSupplyReadOn from that same read; the three values cannot be updated independently.
  • Document the RPC/provider configuration and define failure behavior so a failed read does not silently publish stale data.
  • Keep the public /rep page static and free of a client-side RPC dependency unless the architecture intentionally changes.
  • Add appropriate validation or test coverage and verify with the normal typecheck, lint, and build commands.

Reference

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions