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: allow revert_on_failure for regular extcalls #4424

Open
charles-cooper opened this issue Dec 26, 2024 · 1 comment
Open

VIP: allow revert_on_failure for regular extcalls #4424

charles-cooper opened this issue Dec 26, 2024 · 1 comment
Labels
VIP: Discussion Used to denote VIPs and more complex issues that are waiting discussion in a meeting

Comments

@charles-cooper
Copy link
Member

charles-cooper commented Dec 26, 2024

Simple Summary

per title

Motivation

so that users do not need to drop down into raw_call() to use revert_on_failure=False

Specification

allow revert_on_failure in extcall (and also staticcall) position. e.g.,

interface Foo:
    def foo() -> uint256: nonpayable

def call_foo(f: Foo):
    success: bool = empty(bool)
    s: uint256 = empty(uint256)
    success, s  = extcall f.foo(revert_on_failure = False)

Backwards Compatibility

new feature, no breaking changes

Dependencies

References

Copyright

Copyright and related rights waived via CC0

@charles-cooper charles-cooper added the VIP: Discussion Used to denote VIPs and more complex issues that are waiting discussion in a meeting label Dec 26, 2024
@charles-cooper charles-cooper changed the title VIP: allow revert_on_failure for regular extcalls VIP: allow revert_on_failure for regular extcalls Dec 26, 2024
@cyberthirst
Copy link
Collaborator

i'm in favor of this approach.

listing some other ideas for future discussion..

  1. make the call machinery more general then the current evm-dependent semantics (i think i discussed smth similar w Charles like a year ago):
q: Query = query target.foo()
if res.sucess():
  return abi_decode(q.return_payload)
return 0
  1. or maybe context managers
with target.foo() as call:
   if call.success:
       return abi_decode(call.return_payload)
   return 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VIP: Discussion Used to denote VIPs and more complex issues that are waiting discussion in a meeting
Projects
None yet
Development

No branches or pull requests

2 participants