Skip to content

Refine and optimize Erc20, Erc721, Erc1155 #937

Description

@oleksandrchainsafe

Summary
Refine and optimize Erc20, Erc721, Erc1155 static utility classes.

Suggested features or ways to address the summary
There are two options:

  • Turn static ErcXX utility classes into services accessible through the Web3 client. This way SDK users will see intellisense suggestions when working with the web3 object, which suits well with project's ideology.
  • Extract IContract interface. Create proxies for each ErcXX type which will wrap the original Contract object and add additional methods that reside currently in static ErcXX classes. Add factory extension methods for ContractBuilder for each ErcXX type which will create corresponding proxy objects with additional methods for the specified contract address.

Motivation
Both methods improve UX for the new users, as it enables an intellisense-driven learning path, and optimize the code, because that way we do not create a new Contract instance for each smart-contract interaction, but only do it once for each contract.

Acceptance Criteria

  • Erc20, Erc721, Erc1155 static utility classes removed
  • New approach introduced
  • All existing functionality is available in the new version
  • Contract instance is not getting created for each smart-contract call

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type: EnhancementAdded to issues and PRs when a change includes improvements or optimizations.

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions