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

Fail to create contract instance from Contract with non-payable and non-constant function in ethers v5.0-beta #762

Closed
ddaws opened this issue Mar 19, 2020 · 3 comments
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@ddaws
Copy link

ddaws commented Mar 19, 2020

I am attempting to create an instance of a UniswapExchange contract though am getting the following error

Error: cannot have constant payable function

thrown here in verifyState.

The UniswapExchange contract has a non-payable, non-constant function called setup called once in the lifetime of the contract. verifyState seems to be asserting that a contract must either be payable, or be constant, but I believe (still learning a lot) it is valid for a contract function to be both non-payable and non-constant.

verifyState sets result.constant to !result.payable here

For reference, here is the deployed Uniswap MKR exchange contract
https://etherscan.io/address/0x2C4Bd064b998838076fa341A83d007FC2FA50957

@ricmoo
Copy link
Member

ricmoo commented Apr 4, 2020

@ddaws Can you include the ABI you are passing into Contract?

@ricmoo ricmoo added bug Verified to be an issue. on-deck This Enhancement or Bug is currently being worked on. labels Apr 4, 2020
@ricmoo ricmoo added fixed/complete This Bug is fixed or Enhancement is complete and published. and removed on-deck This Enhancement or Bug is currently being worked on. labels Apr 4, 2020
@ricmoo
Copy link
Member

ricmoo commented Apr 4, 2020

Thanks for your help in tracking down the problem and links the problematic code.

This has been fixed in 5.0.0-beta.180. Let me know if you still have any problems.

Thanks! :)

@ricmoo ricmoo closed this as completed Apr 4, 2020
@ddaws
Copy link
Author

ddaws commented Apr 4, 2020

Happy to help, and thanks for getting this fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

No branches or pull requests

2 participants