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

ContractFactory.interface.deployFunction: _DeployDescription defaults to payable: true #684

Closed
gitpusha opened this issue Dec 11, 2019 · 3 comments
Labels
discussion Questions, feedback and general information.

Comments

@gitpusha
Copy link

gitpusha commented Dec 11, 2019

Hi. This is a very minor seemingly non-critical thing I observed:

For solidity contracts that do not have any constructors the ContractFactory object returned by new ethers.ContractFactory() seems to have payable: true set by default in its ContractFactory.interface.deployFunction property.

This seems odd. Should it not be a payable: false default if NO constructor is present in the solidity source?

Not critical because contract deploys anyway, even though it does not have a payable constructor, nor is value required to be sent with the deployment tx.

@ricmoo
Copy link
Member

ricmoo commented Dec 14, 2019

This, unfortunately, is the case because early Solidity did not have the payable keyword; by default all functions and constructors were payable.

But it is a good point, I should update v5 to default to assume modern Solidity semantics and force anyone updating to v5 from v4 to update their ABI to include payable if they are importing a very old ABI.

@ricmoo ricmoo added discussion Questions, feedback and general information. next version labels Dec 14, 2019
@gitpusha
Copy link
Author

thanks for all the great work! I love ethers.js and I am currently using it with buidler.

@ricmoo
Copy link
Member

ricmoo commented Jun 4, 2020

This was added a while ago, I just forgot to update the ticket. If you are still having issues, please feel free to re-open.

Thanks! :)

@ricmoo ricmoo closed this as completed Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Questions, feedback and general information.
Projects
None yet
Development

No branches or pull requests

2 participants