Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Disallow using the
This is kind of a follow-up to the discussion in #901. The currently implemented behavior is to disallow
@public def call1() -> address: return msg.sender @private def call2(addr: address) -> address: return addr # Can't access `msg.sender` here, must pass as arg @public def call3() -> address: return call1() @public def call4() -> address: return call2(msg.sender)
In this example,
Additionally, the current behavior is an extra point of confusion for users coming from Solidity because Vyper's
In addition to disallowing
Copyright and related rights waived via CC0
What about the following pattern for public => public calls in the same contract?
contract FooBar: def foo() -> uint256: constant @public def foo() -> uint256: return 42 @public def bar() -> uint256: return FooBar(self).foo()
Currently this code compiles, but calls to
To me it feels much more explicit than simply using
# Line 8 [if, [eq, [mload, 0], '4273672062' <bar()>], [seq, [assert, [iszero, callvalue]], # Line 10 [mstore, 0, [mload, [seq, [assert, [extcodesize, address]], # probably this test: [assert, [xor, address, address]], [assert, [staticcall, gas, address, [seq, [mstore, 320, 3264763256], 348], 4, 416, 32]], 0, 416]]], [seq_unchecked, pass, [return, 0, 32]], # Line 8 stop]],
There may be a good reason to prevent that, but I can't think of one off the top of my head. Anyone have any ideas? It's also not clear from the commit history why that LLL is part of the output.