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
VIP: Allow environment variables and constants as "default value" in public functions #1525
There are a number of Uniswap functions that have a recipient field. It would be great to default this field to msg.sender like so:
@public @payable def ethToTokenSwap(minTokens: uint256, recipient: address = msg.sender):
Currently I have to do something along these lines:
@public @payable def ethToTokenSwap(minTokens: uint256, recipient: address = 0x000...000): if(recipient == ZERO_ADDRESS): recipient = msg.sender
which isn't the worst but it would be great to have msg.sender, msg.value, and constants available here.