aragon / radspec

🤘 Radspec is a safe interpreter for Ethereum's NatSpec
MIT License
141 stars 36 forks source link

Add msg.sender and msg.value bindings #80

Closed sembrestels closed 5 years ago

sembrestels commented 5 years ago

Right now we can't do something like:

@notice Stake all my `(self.token(): address).balanceOf(msg.sender(): address)` tokens on #`id`

Would that be useful?

sohkai commented 5 years ago

Yes, this would be useful!

Since msg is already a reserved keyword in solidity, users can't use it as a variable name anyway, so it should be safe to reserve as well in radspec.

You'll have to at least make changes to:

fabriziovigevani commented 5 years ago

@sembrestels Were you planning on tackling this? If not, i'd like to take this issue.

I was thinking about the syntax, does it make sense to just use msg.sender and msg.value instead of a function syntax, as it's not really a callExpression but rather a PropertyAccessExpression and also we already know the specific types ?

This would require adding a check in the evaluator for this type of nodes.

sohkai commented 5 years ago

Hmm yes, if we can get away with it, we should use msg.sender and msg.value. No point in having the function call, and self is already interpolated this way as well.