Skip to content

feat(APP-610): Implement ERC20 token voting membership use case#4

Draft
asciiman wants to merge 31 commits into
mainfrom
app-610-geterc20membership-end-to-end
Draft

feat(APP-610): Implement ERC20 token voting membership use case#4
asciiman wants to merge 31 commits into
mainfrom
app-610-geterc20membership-end-to-end

Conversation

@asciiman

@asciiman asciiman commented May 21, 2026

Copy link
Copy Markdown
Contributor

Adds the first full Token Voting membership query to aragon-domain. Callers can now ask for a DAO's token-voting members, scoped to a TokenVoting plugin and its ERC20Votes token, ordered by voting power, and get back a paginated, API-ready list with each member's primary ENS name resolved.

What's in this PR

  • Token Voting membership query: callers fetch a paginated, voting-power-ordered list of a TokenVoting plugin's ERC20Votes members, each with their primary ENS name.
  • Membership modeled as a domain aggregate: a member is now a single value object combining on-chain record, optional metrics, and ENS name, with voting power as its own wei-backed value type.
  • ENS primary names resolved through viem: member names resolve directly on mainnet, with SEAL-framework safeguards, instead of riding on indexed records.
  • Covered end-to-end: integration tests exercise the full membership and member-profile paths, backed by unit tests on the new domain objects and stores; the runner moves to vitest.

Where to look

Start with AragonController.ts — the thin wiring point that shows the whole flow and the new load(envioClient, rpcUrls) signature. From there, GetTokenVotingMembershipUseCase.ts composes member data with ENS resolution, EnvioMemberStore.ts fetches and maps the Envio data, and ViemENSStore.ts is worth a careful read for the reverse-resolution safety logic.

Notes

  • Caller-facing change: AragonDomain.load now requires an RpcUrls map (mainnet RPC URL keyed by chain id) alongside the EnvioClient. Runtime exports are otherwise unchanged (AragonDomain + EnvioClient); the new membership types are type-only.
  • ENS is enrichment, not core membership data — a failed lookup degrades to a null name rather than erroring.

asciiman added 2 commits May 21, 2026 20:44
Adds the GetMemberProfileTextRecordsUseCase along with the supporting
infrastructure: MemberProfile domain objects (subdomain + text record
value objects), an EnvioMemberProfileStore that resolves the live
text records from the indexer, and the AragonController endpoint that
fronts the use case.
Adds the GetERC20MembershipUseCase along with its supporting
infrastructure: Member, TokenVotingMember and VotingPower domain
objects, the EnvioTokenVotingMemberStore that pages delegates by
voting power (with the ReverseName ENS join for display), and the
AragonController endpoint that fronts the use case.
@asciiman asciiman changed the title Implement GetERC20MembershipUseCase feat(APP-610): Implement ERC20 token voting membership use case May 21, 2026
Base automatically changed from app-719-aragon-subdomain-look-up-member-profile-ens-records to main June 4, 2026 07:18
# Conflicts:
#	.github/workflows/library-snapshot.yml
#	package.json
#	pnpm-lock.yaml
#	src/domain/primitives/blockchain/Address.test.ts
#	src/domain/primitives/blockchain/Address.ts
#	src/domain/primitives/math/HexNumber.test.ts
#	src/domain/primitives/math/HexNumber.ts
#	src/domain/primitives/pagination/Page.ts
#	src/domain/primitives/uuid/UUID.test.ts
#	src/domain/primitives/uuid/UUID.ts
#	src/infrastructure/controllers/AragonController/AragonController.ts
#	test/AragonSubdomain.test.ts
#	vitest.config.ts
@asciiman asciiman marked this pull request as draft June 16, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant