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

F/OS-1184 generate viem ABIs #574

Closed
wants to merge 6 commits into from

Conversation

josemarinas
Copy link
Contributor

@josemarinas josemarinas commented Apr 17, 2024

Description

This creates a package that generates viem ABIs with wagmi.

This is just a quick POC.

Things that may be missing:

  • automated generation of config files
  • automated generation of index
  • better structure

Task ID: OS-1184

Type of change

See the framework lifecycle in packages/contracts/docs/framework-lifecycle to decide what kind of change this pull request is.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran all tests with success and extended them if necessary.
  • I have updated the CHANGELOG.md file in the root folder.
  • I have updated the DEPLOYMENT_CHECKLIST file in the root folder.
  • I have updated the UPDATE_CHECKLIST file in the root folder.
  • I have updated the Subgraph and added a QA URL to the description of this PR.

// Addresslist
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

export const addresslistAbi = [
Copy link
Contributor

Choose a reason for hiding this comment

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

can we move this to a root/generated/ for example

import {defineConfig} from '@wagmi/cli';
import {hardhat} from '@wagmi/cli/plugins';

export default defineConfig({
Copy link
Contributor

Choose a reason for hiding this comment

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

move this to /configs folder

@@ -0,0 +1,10 @@
#!/bin/bash
## Build the contracts
yarn build:contracts
Copy link
Contributor

Choose a reason for hiding this comment

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

I ran this locally, it reverts in one of the scripts if the ALCHEMY KEY is not set in the .env but then continues anyway. It should probably revert and exit. Same thing for requiring a private key to be set. I think that's because you put build contracts here instead of in the package.json so:

"generate:abi": "yarn build:contracts && ./script"

Would terminate the script if you have reverts in the prior stages. It's also a bit easier to see what's happening.

packages/abi/scripts/publish.sh Show resolved Hide resolved
@@ -0,0 +1,22 @@
#!/bin/bash
yarn generate:abi
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think this should be here, even if it fails it will continue? Same as above basically

packages/abi/package.json Show resolved Hide resolved
@jordaniza
Copy link
Contributor

For the time being, we need some additional thought on bytecode artifacts and packages but the viem stuff is good we should keep the branch

@jordaniza jordaniza closed this May 3, 2024
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.

3 participants