-
Notifications
You must be signed in to change notification settings - Fork 17
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
base: master-2
Are you sure you want to change the base?
Conversation
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) |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
resolves: #529 (ethers BigNumber instead of BN)
resolves: #501
Still many errors.
Migration reference: https://docs.ethers.io/v5/migration/