-
-
Notifications
You must be signed in to change notification settings - Fork 810
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
Runtime error when making an external call to the same contract #1696
Comments
We originally wanted to avoid a recursion/stack-exhaustion kind of attack, but I think we relaxed that a bit by just making it unergonomic. If someone wants to write it that way, they can. Just be aware of how the mechanism could be abused. |
I think this should just be a compile-time error. I think our latest consensus was to refactor into a private function for these kinds of self calls (and never use public functions like solidity external functions) |
Meeting Notes: Remove runtime-check as we have compile time check for this already, then document the behaviour. |
cf. #1582 thanks @iamdefinitelyahuman ! |
Meeting Notes: Remove assertion of |
This code makes it an error to make an external call to the same contract:
https://github.com/ethereum/vyper/blob/c296b2d7532d913103aad494b749f8179a3acddc/vyper/parser/external_call.py#L75
This is a surprising limitation. It doesn't seem to have a clear benefit, and it could be problematic. As an example, multisig wallets often use self-calls to perform administrative functions. This way the wallet owners have to agree to make a change like lowering the required threshold of signatures. In Vyper, this would produce a runtime error.
The text was updated successfully, but these errors were encountered: