Skip to content

Write "guide" in docs for ERC20 token interactions. #1170

@pipermerriam

Description

@pipermerriam

What was wrong?

Interactions with ERC20 tokens are a very common use case. Examples in the documentation would likely be a valuable resource.

There is an existing minimalistic guide here: https://github.com/ethereum/web3.py/blob/master/docs/examples.rst that only deals with read-only operations.

How can it be fixed?

Write a "guide" for interacting with an ERC20 token. It should probably include as much of the following as is viable.

  • creation of the contract factory from the ERC20 ABI
  • instantiation of a contract instance pointed at a specific token address
  • querying account balances
  • performing a direct transfer(...) call
  • querying the approved spending balance for external transfers
  • creating an approval for external transfers
  • performing a transferFrom call with an approved transfer.

And some additional things:

  • The guide should probably operate on a local test chain and include basic deployment of an simple ERC20 token contract.
  • Guide should ignore key management, assuming that the node is doing the signing.
  • Guide should be fully doctested using a web3 instance attached to an in-memory testing chain.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions