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

Make constructors (non)payable #1027

Closed
athei opened this issue Nov 21, 2021 · 5 comments · Fixed by #1065
Closed

Make constructors (non)payable #1027

athei opened this issue Nov 21, 2021 · 5 comments · Fixed by #1065
Assignees
Labels
B-enhancement New feature or request

Comments

@athei
Copy link
Contributor

athei commented Nov 21, 2021

When paritytech/substrate#10082 is merged there is no longer a need to pass an endowment larger than 0 except when the contract logic itself requires it. This makes endowment no different from value in a call extrinsic.

Therefore I think we should extend the payable logic to constructors. The UI can then remove the endowment field for non payable constructors.

@athei athei added the B-enhancement New feature or request label Nov 21, 2021
@Robbepop
Copy link
Collaborator

Can you elaborate on this a bit?
So will it be possible to have value and endownment fields upon contract instantiation?
Currently in ink! all constructors are implicitly payable since unpayable constructors make no sense since the contract would be evicted immediately after.

@athei
Copy link
Contributor Author

athei commented Nov 21, 2021

So will it be possible to have value and endownment fields upon contract instantiation?

No, there is still only endowment.

Currently in ink! all constructors are implicitly payable since unpayable constructors make no sense since the contract would be evicted immediately after.

And this is exactly the part that is about to change soon. Unpayable constructors make sense then.

@Robbepop
Copy link
Collaborator

Robbepop commented Nov 23, 2021

So should we non-confusingly rename this issue to "Allow ink! constructors to be non-payable" ?

@athei
Copy link
Contributor Author

athei commented Nov 23, 2021

Sure, if that makes more sense to you. The issue is about allowing this payable attribute there which is now set by default.

@athei
Copy link
Contributor Author

athei commented Nov 30, 2021

Needs to be done before the stable release because it is a breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants