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

does not handle initialize function overloading #146

Closed
thegostep opened this issue Aug 29, 2020 · 5 comments · Fixed by #149
Closed

does not handle initialize function overloading #146

thegostep opened this issue Aug 29, 2020 · 5 comments · Fixed by #149

Comments

@thegostep
Copy link
Contributor

image

image

@thegostep
Copy link
Contributor Author

Interface.getFunction() needs to use the full initialize function signature to pull the correct abi https://docs.ethers.io/v5/api/utils/abi/interface/#Interface--specifying-fragments

@thegostep
Copy link
Contributor Author

need to modify this line to use signature or sighash

https://github.com/OpenZeppelin/openzeppelin-upgrades/blob/master/packages/plugin-buidler/src/deploy-proxy.ts#L59

@abcoathup
Copy link
Contributor

Hi @thegostep! I’m sorry that you had this issue.

We have been able to reproduce this issue by following these steps:

  1. Create a simple contract with two functions with the same name but different number of parameters
  2. In a Buidler test, attempt to call deployProxy specifying the function as the initializer and provide the appropriate parameters.
  3. The test errors with Error: multiple matching functions (argument="name", value="store", code=INVALID_ARGUMENT, version=abi/5.0.2)

This appears to be only with the Buidler plugin and I couldn't reproduce with the Truffle plugin.

Thanks so much for reporting it! The project owner will review and triage this issue as soon as they can.

@frangio
Copy link
Contributor

frangio commented Aug 31, 2020

Thanks a lot for reporting this @thegostep!

I opened #149 to fix it by using Interface.getFunction from Ethers. Once we release the fix it should be possible to use all of function name, signature, or selector to specify the chosen initializer.

For example: upgrades.deployProxy(..., { initializer: 'initialize(uint256)' }).

@frangio
Copy link
Contributor

frangio commented Sep 1, 2020

The fix has been released in @openzeppelin/buidler-upgrades@1.0.2.

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 a pull request may close this issue.

3 participants