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

Consider upgrading ethersv5 #555

Open
shanefontaine opened this issue Feb 14, 2024 · 1 comment
Open

Consider upgrading ethersv5 #555

shanefontaine opened this issue Feb 14, 2024 · 1 comment

Comments

@shanefontaine
Copy link
Member

Consider pros and cons between:

  • ethersv5
  • ethersv6
  • viem

If outcome is ethersv6 or viem, upgrade repo to use native BitInt.

Reference Converstaion

Some unorganized notes about an attempted ethersv5 -> ethersv6 migration:

  • When converting BN to BigInt, consider searching for these in the repo:
    • .type (for checking bn)
    • .hex (for checking bn)
    • _isBigNumber oldbn
    • bignum
    • BN
    • Math methods
      • BigInt\((.*?)\)\. for all typecasted bigitnts that are then added
      • .floor
      • .add
        • Watch out for <set>.add()
      • .sub
      • .mul
      • .div
      • .gt(e)
      • .lt(e)
      • .pow
      • .eq
      • etc.
    • SDK methods need to be wrapped…
    • : BigNumber
    • ish ?
    • Can we do everything with bigint? how should we think about it?
      • Would require BigInt(Math.xxx()) and other primitives
      • Maybe that is where ish comes in?
    • Migrate the DB values from bn to bigint
  • Remove
    • All 'ethers/lib/utils' are top level
    • providers.Provider
    • All @ethersproject should be gone
      • Remove these from package.json
  • All utils as ethersUtils should be gone
  • Explicit changes
    • StaticJsonRpcProviderJsonRpcProvider (V6 does this by default: src)
    • extends Signerextends AbstractSigner (Signer is now an interface and AbstractSigner replaced the class)
@shanefontaine shanefontaine converted this from a draft issue Feb 14, 2024
@jxom
Copy link

jxom commented Feb 14, 2024

Happy to assist if the decision is Viem. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants