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 require(bool,bytes) global function #9454

Closed
junderw opened this issue Jul 21, 2020 · 5 comments
Closed

Add require(bool,bytes) global function #9454

junderw opened this issue Jul 21, 2020 · 5 comments
Labels
language design :rage4: Any changes to the language, e.g. new features stale The issue/PR was marked as stale because it has been open for too long.

Comments

@junderw
Copy link

junderw commented Jul 21, 2020

It seems like most people throw away returndata when performing calls. ie.

(bool result, ) = someAddress.call{ value: msg.value }('');
require(result, 'some message');

It would be nice to be able to do something like.

(bool result, bytes memory returndata) = someAddress.call{ value: msg.value }('');
require(result, returndata);

That way if the contract we're calling has a descriptive error we can just forward that.

@chriseth
Copy link
Contributor

This is a good point and we might add it with enabling user-defined error types.

@junderw
Copy link
Author

junderw commented Jul 21, 2020

Something like this seems easy to understand, as long as the parameters of require line up with the return parameter types and order.

require(someAddress.call{ value: msg.value }(''));

@axic axic added the language design :rage4: Any changes to the language, e.g. new features label Jul 21, 2020
@cameel cameel added the feature label Sep 26, 2020
@cameel cameel mentioned this issue Feb 19, 2021
3 tasks
@github-actions
Copy link

github-actions bot commented Mar 6, 2023

This issue has been marked as stale due to inactivity for the last 90 days.
It will be automatically closed in 7 days.

@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Mar 6, 2023
@junderw
Copy link
Author

junderw commented Mar 6, 2023

I still think this would be a good idea. If no one has anymore thoughts on the idea, I'll just close this.

@github-actions github-actions bot removed the stale The issue/PR was marked as stale because it has been open for too long. label Mar 7, 2023
@github-actions
Copy link

github-actions bot commented Jun 6, 2023

This issue has been marked as stale due to inactivity for the last 90 days.
It will be automatically closed in 7 days.

@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Jun 6, 2023
@junderw junderw closed this as completed Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language design :rage4: Any changes to the language, e.g. new features stale The issue/PR was marked as stale because it has been open for too long.
Projects
None yet
Development

No branches or pull requests

5 participants