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

VIP: add revert_on_failure= kwarg to all external calls #2910

Open
charles-cooper opened this issue Jun 15, 2022 · 1 comment
Open

VIP: add revert_on_failure= kwarg to all external calls #2910

charles-cooper opened this issue Jun 15, 2022 · 1 comment
Labels
VIP: Approved VIP Approved

Comments

@charles-cooper
Copy link
Member

Simple Summary

as title

Motivation

catching external call reversion currently requires using raw_call(), but it would be nice not to have to drop down to that.

Specification

add revert_on_failure to all external calls. if it is set to False, the external call returns a tuple of (success, return_value). for instance:

interface Bar:
    def return_something() -> address: nonpayable

def foo(bar: Bar) -> address:
    success: bool = False
    ret: address = empty(address)
    success, ret = bar.return_something(revert_on_failure=False)
    if success:
        return ret
    return empty(address)

Backwards Compatibility

no backwards compatibility issues

Copyright

Copyright and related rights waived via CC0

@charles-cooper charles-cooper added the VIP: Approved VIP Approved label Jun 20, 2022
@charles-cooper
Copy link
Member Author

meeting notes: approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VIP: Approved VIP Approved
Projects
None yet
Development

No branches or pull requests

1 participant