Simple Summary
Change this:
Transfer: event({_from: indexed(address), _to: indexed(address), _value: uint256})
to this:
event Transfer:
_from: indexed(address)
_to: indexed(address)
_value: uint256
Motivation
The current approach to declaring an event reads as though there is a variable being created, with it's type defined from the result of a call to an event function. This is misleading because:
- The created event is not a variable. You cannot assign to it during declaration, or reference it except as a callable member of
log.
event, though appearing to be a function, is not a function. And type annotations are not typically declared as the result of a function call.
- The reliance on the ordering of dictionary keys inside
event is not a standard python behavior until version 3.7. Declaring the fields in this way does not intuitively read as though they are sequenced.
By instead using the struct-style declaration, we make it more clear that this not a simple variable, and that the members inside are sequenced.
Backwards Compatibility
This will be a rather large breaking change, we should definitely discuss it at length. If it is approved, it probably belongs in the 1.0rc release.
Copyright
Copyright and related rights waived via CC0
Simple Summary
Change this:
to this:
Motivation
The current approach to declaring an event reads as though there is a variable being created, with it's type defined from the result of a call to an
eventfunction. This is misleading because:log.event, though appearing to be a function, is not a function. And type annotations are not typically declared as the result of a function call.eventis not a standard python behavior until version 3.7. Declaring the fields in this way does not intuitively read as though they are sequenced.By instead using the struct-style declaration, we make it more clear that this not a simple variable, and that the members inside are sequenced.
Backwards Compatibility
This will be a rather large breaking change, we should definitely discuss it at length. If it is approved, it probably belongs in the
1.0rcrelease.Copyright
Copyright and related rights waived via CC0