-
Notifications
You must be signed in to change notification settings - Fork 94
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
BalancerV2IndexExchangeAdapter #145
base: master
Are you sure you want to change the base?
Conversation
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.
Sorry I'm not familiar enough w/ Solidity to provide a helpful review there
@@ -0,0 +1,92 @@ | |||
import { Signer } from "@ethersproject/abstract-signer"; | |||
import { JsonRpcProvider, Web3Provider } from "@ethersproject/providers"; |
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.
[nit] if we import from the umbrella package ethers
rather than @ethersproject/foo
, we can avoid issues with mismatching dependencies for ethers sub-packages. Additional context in: #144
Concretely, this means replacing this import with
import { JsonRpcProvider, Web3Provider } from "@ethersproject/providers"; | |
import { providers } from "ethers"; |
and below
constructor(provider: providers.Web3Provider | providers.JsonRpcProvider, ownerAddress: Address) {
import { StandardTokenMock, WETH9 } from "../contracts/index"; | ||
import { BVault, WeightedPoolFactory } from "../contracts/balancerV2"; | ||
import { BPoolV2__factory } from "../../typechain/factories/BPoolV2__factory"; | ||
import { BigNumber } from "@ethersproject/bignumber"; |
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.
import { BigNumber } from "@ethersproject/bignumber"; | |
import { BigNumber } from "ethers"; |
import { BVault, WeightedPoolFactory } from "../contracts/balancerV2"; | ||
import { BPoolV2__factory } from "../../typechain/factories/BPoolV2__factory"; | ||
import { BigNumber } from "@ethersproject/bignumber"; | ||
import { defaultAbiCoder } from "@ethersproject/abi"; |
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.
import { defaultAbiCoder } from "@ethersproject/abi"; | |
import { utils } from "@ethersproject/abi"; |
and below:
const initUserData = utils.defaultAbiCoder.encode(["uint256", "uint256[]"], [0, tokenAndAmounts.map(ta => ta.amount)]);
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.
Wouldn't I want to import this from ethers
instead? Importing utils
from the same @ethersproject
library shouldn't have any meaningful effect. Am I missing something?
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.
Sorry that's my bad, you're absolutely right. I meant:
import { defaultAbiCoder } from "@ethersproject/abi"; | |
import { utils } from "ethers"; |
© 2021 GitHub, Inc. | ||
Terms | ||
Privacy | ||
Security | ||
Status | ||
Docs | ||
Contact GitHub | ||
Pricing | ||
API | ||
Training | ||
Blog | ||
About |
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.
I think this is an artifact from copy + paste. Should it be removed?
© 2021 GitHub, Inc. | |
Terms | |
Privacy | |
Security | |
Status | |
Docs | |
Contact GitHub | |
Pricing | |
API | |
Training | |
Blog | |
About |
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.
Good catch
No description provided.