Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix & complete contract ABIs, export Typechain contract types and factories #82

Merged
merged 10 commits into from
Nov 17, 2022

Conversation

jfschwarz
Copy link
Collaborator

@jfschwarz jfschwarz commented Nov 15, 2022

This PR adds the correct ABIs for all zodiac module contracts. It also sets up Typechain so the @gnosis.pm/zodiac will now export interfaces and factories for all our contracts. This should make this package more useful when building apps on top of our contracts.

While doing this wholesale review I couldn't resist clearing out some inconsistencies in the names of some of the existing exports:

  • removed the interface formerly exported as ContractAddresses (which is not used anywhere afaict)
  • renamed export: SUPPORTED_NETWORKS -> SupportedNetworks
  • renamed export: CONTRACT_ADDRESSES -> ContractAddresses
  • renamed export: CONTRACT_ABIS -> ContractAbis

All of these are BREAKING CHANGES meaning we must publish this as v2.0.0.

@auryn-macmillan
Copy link
Member

We could even setup typechain to export fully typed ethers contract factories for our contracts.

Yeah, I really like this idea.

@asgeir-s
Copy link
Contributor

asgeir-s commented Nov 16, 2022

Sounds great. I also noticed this problem when adding new known contracts. I ended up adding the "raw" ABI here: https://github.com/gnosis/zodiac/tree/master/src/abi and importing them https://github.com/gnosis/zodiac/blob/10b6ca9c450143736395b1ff2e0b769a9e669f8e/src/factory/constants.ts#L274-L276.
It probably makes more sense to add the full .json ABI file (like you propose) instead of the way I did it to make it easier for Typechain.

BREAKING CHANGES: renaming public exports
- `SUPPORTED_NETWORKS` -> `SupportedNetworks`
- `CONTRACT_ADDRESSES` -> `ContractAddresses`
- `CONTRACT_ABIS` -> `ContractAbis`
- remove interface formerly exported as `ContractAddresses`
@jfschwarz jfschwarz changed the title Fix contract ABIs Fix & complete contract ABIs, export Typechain contract types and factories Nov 16, 2022
Copy link
Contributor

@asgeir-s asgeir-s left a comment

Choose a reason for hiding this comment

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

Nice work.

There is only one thing; the old factory file (src/factory/factory.ts) is added back in. The functionality that was previously in that file is now improved/updated and is in the moduleDeployer file (src/factory/moduleDeployer.ts). Perhaps we can just remove the factory file (src/factory/factory.ts) again?

@jfschwarz
Copy link
Collaborator Author

There is only one thing; the old factory file (src/factory/factory.ts) is added back in. The functionality that was previously in that file is now improved/updated and is in the moduleDeployer file (src/factory/moduleDeployer.ts). Perhaps we can just remove the factory file (src/factory/factory.ts) again?

Ah, great catch! I've fixed it now.

@asgeir-s asgeir-s self-requested a review November 17, 2022 11:54
Copy link
Contributor

@asgeir-s asgeir-s left a comment

Choose a reason for hiding this comment

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

LGTM

@jfschwarz jfschwarz merged commit 3134f45 into master Nov 17, 2022
@jfschwarz jfschwarz deleted the fix-wrong-abi branch November 17, 2022 11:57
@github-actions github-actions bot locked and limited conversation to collaborators Nov 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants