Skip to content

Create MVP Pypechain lib#840

Merged
sentilesdal merged 6 commits intomainfrom
matt-pypechain
Aug 18, 2023
Merged

Create MVP Pypechain lib#840
sentilesdal merged 6 commits intomainfrom
matt-pypechain

Conversation

@sentilesdal
Copy link
Copy Markdown
Contributor

Creates a simple Pypechain library that generates custom web3.py Contract classes for a given abi. For example, ERC20.json will create an ERC20Contract.py file that contains a custom ERC20Contract class along with classes for every public function the contract has. Each function has the signature typed which will allow tools like VSCode to enable features like autocomplete when using the functions. Next steps:

Testing

  • add unit tests for utilites
  • add basic test for template outputs from run_pypechain.py

Add Events

  • add ContractEvent classes for all events in an ABI.

Add Structs

  • add NamedTuple types for all internalTypes that can be found in an ABI. This will allow us to have types for things like PoolConfig and PoolInfo based off the actual source of the struct.

Nice to haves

  • Add file splitting for template output, group functions, events, structs into their own files.
  • Add bash script or some installable package so that pypechain can be run from the console for any package.

@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
elf-simulations ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 18, 2023 11:33pm

Comment thread lib/pypechain/pypechain/sample/sample.py Outdated
Comment thread lib/pypechain/pypechain/run_pypechain.py Outdated
Comment thread lib/pypechain/pypechain/run_pypechain.py
Comment thread lib/pypechain/pypechain/utilities/abi.py Outdated
Comment thread lib/pypechain/pypechain/utilities/abi.py Outdated
Comment thread lib/pypechain/pypechain/utilities/abi.py
Copy link
Copy Markdown
Contributor

@dpaiton dpaiton left a comment

Choose a reason for hiding this comment

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

left some minor comments but overall this is awesome! Can't wait to start using it :)

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.

2 participants