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

Widen the pragma #71

Merged
merged 3 commits into from
Apr 17, 2020
Merged

Widen the pragma #71

merged 3 commits into from
Apr 17, 2020

Conversation

moodysalem
Copy link
Contributor

No description provided.

@moodysalem moodysalem marked this pull request as ready for review April 16, 2020 20:44
Copy link
Contributor

@NoahZinsmeister NoahZinsmeister left a comment

Choose a reason for hiding this comment

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

3 comments:

  1. is there a reason to prefer >=0.5.0 over >=0.5?
  2. imo interfaces that aren't reasonably public can/should have fixed pragmas. in this case i'm thinking of IERC20.sol, which is used for internal reasons, and should be readily accessible to others via their own dev environment. i also think we should consider removing all functions from this interface that we don't actually rely on in the code, for the sake of simplicity.
  3. after playing around with solc@0.6.6 in periphery, there's some gotchas around duplicating/extending interfaces. i'm increasingly feeling that we should remove IUniswapV2ERC20.sol in favor of IUniswapV2Pair.sol (which already includes all IUniswapV2ERC20.sol declarations).

@moodysalem
Copy link
Contributor Author

  • is there a reason to prefer >=0.5.0 over >=0.5?

I think this is just stylistic, I prefer the former just because it's more what I'm used to from package.json

imo interfaces that aren't reasonably public can/should have fixed pragmas. in this case i'm thinking of IERC20.sol, which is used for internal reasons, and should be readily accessible to others via their own dev environment. i also think we should consider removing all functions from this interface that we don't actually rely on in the code, for the sake of simplicity.

In that case I think we should just use the openzepplin-solidity version and remove the IERC20.sol from this repo

after playing around with solc@0.6.6 in periphery, there's some gotchas around duplicating/extending interfaces. i'm increasingly feeling that we should remove IUniswapV2ERC20.sol in favor of IUniswapV2Pair.sol (which already includes all IUniswapV2ERC20.sol declarations).

What are the gotchas? On the surface it seems like it would make sense to make IUniswapV2ERC20 inherit from IERC20 and remove those duplicate declarations

@NoahZinsmeister
Copy link
Contributor

I think this is just stylistic, I prefer the former just because it's more what I'm used to from package.json

fair enough, i'm fine with it

In that case I think we should just use the openzepplin-solidity version and remove the IERC20.sol from this repo

as tempting as this is, for such a trivial import i'm not in favor of introducing the open-zeppelin dependency, if for no other reason than it doesn't fit with the DIY approach we've taken in the rest of the codebase

What are the gotchas? On the surface it seems like it would make sense to make IUniswapV2ERC20 inherit from IERC20 and remove those duplicate declarations

specifically, the way UniswapV2Pair.sol is defined would not be kosher in 0.6.6, because it's inheriting the ERC20 methods from both IUniswapV2Pair.sol and IUniswapV2ERC20.sol via UniswapV2ERC20.sol. the specific compiler error is:

"Derived contract must override function "{foo}". Two or more base classes define function with same name and parameter types."

in 0.5.16 interfaces can't inherit from each other so IUniswapV2ERC20.sol can't inherit from IERC20.sol. at the moment my preference is probably a minimal IERC20.sol with an =0.5.16 pragma, and perhaps no interface at all for UniswapV2ERC20.sol

@NoahZinsmeister
Copy link
Contributor

the changes i suggested would be consistent with Uniswap/v2-periphery#10

@moodysalem moodysalem merged commit 272713c into master Apr 17, 2020
@moodysalem moodysalem deleted the widen-pragma branch April 17, 2020 20:05
hoytech added a commit to hoytech/uniswap-v2-periphery that referenced this pull request Sep 10, 2020
- With "=0.6.6" you need to be using this exact solidity compiler version to use UniswapV2Library.sol

- See discussion in the following PRs:
  Uniswap/v2-core#71
  Uniswap#10
0xBeaver pushed a commit to 0xBeaver/uniswap-v2-core that referenced this pull request Jun 25, 2021
* Widen the pragma

This reverts commit 528056e
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