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

Upgrade to ethers 5 and use BigNumber instead of BN #545

Draft
wants to merge 2 commits into
base: master-2
Choose a base branch
from

Conversation

roienatan
Copy link
Contributor

@roienatan roienatan commented Sep 19, 2020

resolves: #529 (ethers BigNumber instead of BN)
resolves: #501

Still many errors.
Migration reference: https://docs.ethers.io/v5/migration/

@roienatan roienatan changed the title Use ethers big number Upgrade to ethers 5 and use BigNumber instead of BN Sep 19, 2020
public approveTokens(tokenAddress: Address, spender: Address, amount: BN) {
const signer = (this.web3 as JsonRpcProvider).getSigner(this.defaultAccount as any)
public approveTokens(tokenAddress: Address, spender: Address, amount: BigNumber) {
const signer = (this.web3 as providers.JsonRpcProvider).getSigner(this.defaultAccount as any)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you have to cast here? IF you have to cast, would it be better that it be to BaseProvider?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Firstly I try to make the obvious changes to make arc.js work and the tests pass.

export type Web3Provider = string | AsyncSendable | Signer
export type Web3Client = JsonRpcProvider | EthersWeb3JsProvider
export type Web3Provider = string | Signer // AsyncSendable
export type Web3Client = providers.JsonRpcProvider | providers.Web3Provider //| EthersWeb3JsProvider
Copy link
Contributor

Choose a reason for hiding this comment

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

would BaseProvider be easier here?

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.

None yet

2 participants