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

Temporary default stateMutability to payable in ABI #705

Merged

Conversation

cburgdorf
Copy link
Collaborator

What was wrong?

The ABI metadata that we generate does currently not include the stateMutability field. This piece of information is important for tooling such as hardhat because it determines whether a function needs to be called with or without sending a transaction.

As soon as we have support for mut self and mut ctx we will be able to derive that information from the function signature. In the meantime we should default to payable.

How was it fixed?

Add stateMutability field and default it to payable.

@cburgdorf cburgdorf force-pushed the christoph/feat/default_statemutability branch from cab69e8 to 1ad7e31 Compare May 9, 2022 08:41
@Jzow
Copy link

Jzow commented May 11, 2022

Do you mean to add a parameter to the &mut variability of rust to control the variability of the function?

@cburgdorf
Copy link
Collaborator Author

@Jzow Take a look at the "abi conformity" section of #558
In the future we will have support for the mut keyword enabling us to take self or mut self and ctx or mut ctx. We can then derive the stateMutability section of the ABI based on that. For now, we can not which gives tooling such as hardhat a hard time because it can not infer whether a function needs to be called with a transaction or if a readonly call would do it.

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 this pull request may close these issues.

3 participants