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

BalancerV2IndexExchangeAdapter #145

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

ncitron
Copy link
Contributor

@ncitron ncitron commented Sep 11, 2021

No description provided.

Copy link
Contributor

@rootulp rootulp left a 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";
Copy link
Contributor

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

Suggested change
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";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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)]);

Copy link
Contributor Author

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?

Copy link
Contributor

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:

Suggested change
import { defaultAbiCoder } from "@ethersproject/abi";
import { utils } from "ethers";

Comment on lines +80 to +91
© 2021 GitHub, Inc.
Terms
Privacy
Security
Status
Docs
Contact GitHub
Pricing
API
Training
Blog
About
Copy link
Contributor

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?

Suggested change
© 2021 GitHub, Inc.
Terms
Privacy
Security
Status
Docs
Contact GitHub
Pricing
API
Training
Blog
About

Copy link
Contributor Author

@ncitron ncitron Sep 12, 2021

Choose a reason for hiding this comment

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

Good catch

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.

2 participants