Simple Summary
Vyper should not allow value as a function input variable name.
Motivation
Imagine the following contract Foo:
@public
@payable
def foo(bar: uint256 = 7, value: uint256 = 42):
pass
and another contract interacting with the previous one:
import first_contract as Foo
@public
def call_to_foo(a: address):
Foo(a).foo(value=31337)
The use of value as a kwarg typically indicates an amount of ether to send, but because of the input argument the intention becomes ambiguous. Is call_to_foo transferring 31337 wei, or sending an integer of 31337?
Specification
Use of value as a variable name in a function input should raise. We can suggest that users change it to _value.
Backwards Compatibility
It's a breaking change for some contracts, but with a well explained error message it's easily dealt with.
Copyright
Copyright and related rights waived via CC0
Simple Summary
Vyper should not allow
valueas a function input variable name.Motivation
Imagine the following contract
Foo:and another contract interacting with the previous one:
The use of
valueas a kwarg typically indicates an amount of ether to send, but because of the input argument the intention becomes ambiguous. Iscall_to_footransferring 31337 wei, or sending an integer of 31337?Specification
Use of
valueas a variable name in a function input should raise. We can suggest that users change it to_value.Backwards Compatibility
It's a breaking change for some contracts, but with a well explained error message it's easily dealt with.
Copyright
Copyright and related rights waived via CC0