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

Add support for non-payable ink! constructors #6645

Closed
HCastano opened this issue Dec 7, 2021 · 5 comments
Closed

Add support for non-payable ink! constructors #6645

HCastano opened this issue Dec 7, 2021 · 5 comments

Comments

@HCastano
Copy link

HCastano commented Dec 7, 2021

Right now the UI assumes that all ink! constructors need a value (renamed from endowment in paritytech/substrate#10082). However, with use-ink/ink#1065 this is no longer the case.

The UI should only display the value field in case the constructor is marked as payable. This behaviour is already implemented by the UI for ink! messages.

Reference of the screen where a value/endowment is asked for (Developer > Contracts > Upload and Deploy Code):

Screen Shot 2021-12-07 at 11 21 10 AM

@jacogr
Copy link
Member

jacogr commented Dec 28, 2021

Needs an ABI update (V3) where the flags are passed through on the constructors. Currently V2 of the ABI defines -

ContractConstructorSpecV2: {
    label: 'Text',
    selector: 'ContractSelector',
    args: 'Vec<ContractMessageParamSpecV2>',
    docs: 'Vec<Text>'
  },

(messages are slightly extended form the above with payable, mutating and identifier fields).

Marked as <substrate> since it needs a versioned update to the ABI formats. (Which si to be supported in the API)

@HCastano
Copy link
Author

The metadata will be bumped with use-ink/ink#1100

@jacogr
Copy link
Member

jacogr commented Jan 10, 2022

@HCastano Brilliant, thank you! Will make an issue linking though to that PR to get in support on the API layer.

@jacogr
Copy link
Member

jacogr commented Mar 15, 2023

The value seems only passed-through when the constructor is payable, aka

value: contractAbi?.constructors[constructorIndex].isPayable ? value : undefined

@jacogr jacogr closed this as completed Mar 15, 2023
@polkadot-js-bot
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Apr 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants