Closed sembrestels closed 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:
evaluator/index.js
: in the identifier
section, add a check for msg
, and consume the next PropertyAccessExpression
to make sure it's sender
or value
and return the appropriate value based on the given transaction@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.
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.
Right now we can't do something like:
Would that be useful?