Skip to content

@audius/eth refactor#13800

Open
rickyrombo wants to merge 9 commits intomainfrom
mjp-eth
Open

@audius/eth refactor#13800
rickyrombo wants to merge 9 commits intomainfrom
mjp-eth

Conversation

@rickyrombo
Copy link
Contributor

@rickyrombo rickyrombo commented Mar 3, 2026

Normalizes the pattern used for Audius Ethereum contracts clients.

  • Moves away from viem dep being baked in, and towards a no-deps types package for the ABIs
  • Makes the package tree-shakeable by removing barrel files and using "sideEffects": false
  • Adds documentation and examples

@changeset-bot
Copy link

changeset-bot bot commented Mar 3, 2026

🦋 Changeset detected

Latest commit: 6f10f49

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@audius/eth Major
@audius/sdk Patch
@pedalboard/staking Patch
@audius/sdk-legacy Patch
@audius/sp-actions Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors @audius/eth to expose Audius Ethereum contracts as tree-shakable, plain data exports (ABI + production address), removing the previous viem-client wrapper class pattern and expanding documentation to match the new usage.

Changes:

  • Replace contract wrapper classes/constants with { abi, address } (and EIP-712 domain/types where applicable) exports.
  • Remove per-folder barrel exports (index.ts) and constants.ts address exports; centralize exports in packages/eth/src/index.ts.
  • Mark the package as side-effect-free and significantly expand README usage examples.

Reviewed changes

Copilot reviewed 33 out of 34 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/eth/src/trusted-notifier-manager/trustedNotifierManager.ts Replace class wrapper with { abi, address } export.
packages/eth/src/trusted-notifier-manager/index.ts Remove barrel exports.
packages/eth/src/trusted-notifier-manager/constants.ts Remove standalone address constant.
packages/eth/src/staking/staking.ts Replace class wrapper with { abi, address } export + doc comment.
packages/eth/src/staking/index.ts Remove barrel export.
packages/eth/src/service-type-manager/serviceTypeManager.ts Replace class wrapper with { abi, address } export; add VALIDATOR_SERVICE_TYPE.
packages/eth/src/service-type-manager/index.ts Remove barrel exports.
packages/eth/src/service-type-manager/constants.ts Remove standalone address constant.
packages/eth/src/service-provider-factory/serviceProviderFactory.ts Replace class wrapper with { abi, address } export + doc comment.
packages/eth/src/service-provider-factory/index.ts Remove barrel exports.
packages/eth/src/service-provider-factory/constants.ts Remove standalone address constant.
packages/eth/src/registry/registry.ts Replace class wrapper with { abi, address } export + doc comment.
packages/eth/src/registry/index.ts Remove barrel exports.
packages/eth/src/registry/constants.ts Remove standalone address constant.
packages/eth/src/index.ts Switch to explicit named exports from concrete module paths.
packages/eth/src/governance/index.ts Remove barrel exports.
packages/eth/src/governance/governance.ts Replace class wrapper with { abi, address } export + doc comment.
packages/eth/src/governance/constants.ts Remove standalone address constant.
packages/eth/src/eth-rewards-manager/index.ts Remove barrel exports.
packages/eth/src/eth-rewards-manager/ethRewardsManager.ts Replace class wrapper with { abi, address } export + doc comment.
packages/eth/src/eth-rewards-manager/constants.ts Remove standalone address constant.
packages/eth/src/delegate-manager/index.ts Remove barrel export.
packages/eth/src/delegate-manager/delegateManager.ts Replace class wrapper with { abi, address } export + doc comment.
packages/eth/src/claims-manager/index.ts Remove barrel exports.
packages/eth/src/claims-manager/constants.ts Remove standalone address constant.
packages/eth/src/claims-manager/claimsManager.ts Replace class wrapper with { abi, address } export + doc comment.
packages/eth/src/audius-wormhole/index.ts Remove barrel export.
packages/eth/src/audius-wormhole/audiusWormhole.ts Convert to { abi, address, domain, types } object export; export AudiusWormholeTypes.
packages/eth/src/audius-token/index.ts Remove barrel export.
packages/eth/src/audius-token/audiusToken.ts Convert to { abi, address, domain, types } object export; export AudiusTokenTypes.
packages/eth/package.json Mark sideEffects: false; move viem to devDependencies.
packages/eth/README.md Rewrite/expand documentation and examples for the new consumption pattern.
package-lock.json Lockfile updates (dependency metadata/version adjustments).
.changeset/itchy-pants-unite.md Add major changeset describing the refactor/release intent.
Comments suppressed due to low confidence (1)

.changeset/itchy-pants-unite.md:9

  • Typo in release notes: "Treeshakable" -> "Tree-shakable".
- Treeshakable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gitguardian
Copy link

gitguardian bot commented Mar 3, 2026

⚠️ GitGuardian has uncovered 3 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
10622416 Triggered Generic High Entropy Secret 8911849 packages/sdk/src/sdk/config/production.ts View secret
2460750 Triggered Generic High Entropy Secret 8911849 packages/sdk/src/sdk/config/production.ts View secret
1606950 Triggered Generic High Entropy Secret 8911849 packages/sdk/src/sdk/config/production.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 64 out of 65 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI commented Mar 3, 2026

@rickyrombo I've opened a new pull request, #13801, to work on those changes. Once the pull request is ready, I'll request review from you.

… clean up types (#13801)

`EthereumContractConfigInternal`, the `EthereumContract` base class, and
`getDefaultEthereumClientConfig` were left unreferenced after the
refactor to pass `ethPublicClient` directly into each contract client's
config. Also fixes `PublicClient` being imported as a value instead of a
type in `types.ts`.

## Changes

- **Deleted `EthereumContract.ts`** — abstract base class with no
subclasses; superseded by the per-contract `ethPublicClient` config
pattern
- **Deleted `getDefaultConfig.ts`** — `getDefaultEthereumClientConfig`
was never called anywhere after the refactor
- **`types.ts`** — removed `EthereumContractConfigInternal` (only
referenced by the now-deleted files) and its unused `viem` import

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for
you](https://github.com/AudiusProject/apps/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rickyrombo <3690498+rickyrombo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants