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

Payable internal functions #13

Open
HardlyDifficult opened this issue Sep 3, 2022 · 2 comments · Fixed by #14
Open

Payable internal functions #13

HardlyDifficult opened this issue Sep 3, 2022 · 2 comments · Fixed by #14

Comments

@HardlyDifficult
Copy link

Could we make the exposed library functions payable?

I have an internal library function that considers msg.value, the library function itself cannot by payable (and it wouldn't be require). But to test this library call, I need to be able to pass value. It seems like it would be okay to make all exposed library calls payable so that tests have the option of specifying a value.

e.g. current output:

function $transferFunds(address paymentToken,address from,address to,uint256 amount) external { ... }

Desired:

function $transferFunds(address paymentToken,address from,address to,uint256 amount) external payable { ... }

Just started toying around with this plugin, seems super useful - thanks!

@frangio
Copy link
Owner

frangio commented Sep 3, 2022

I think this makes a lot of sense because all library functions can use msg.value.

@HardlyDifficult
Copy link
Author

Thanks for the fast turn around - that change worked great.

I realize now though that this applies to internal functions as well. Same problem where they cannot be payable in code, but can work with msg.value.

@frangio frangio reopened this Sep 13, 2022
@frangio frangio changed the title Payable library functions Payable internal functions Sep 13, 2022
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 a pull request may close this issue.

2 participants