You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Created a standalone issue for typed bytesX function arguments
previously part of #178 (previously titled 'Consider changes to bytes types)
Mathieu and I were talking about this and we think it could make sense to disallow bytesX as function parameters, since these types are not runtime enforced. We could alternatively also add an option to enforce these types by injecting require(x.length === y) statements. This is something we should consider in more detail later.
For bytesX types in function parameters:
We disallow bytesX as function argument.
If a user adds e.g. a require(x.length == 20) check, then the compiler will infer that x's type is bytes20 for the rest of the contract.
(Optionally) apply the same for if statements.
If people want to forgo these checks, they can always manually cast to bytesX(x). We should add a warning to the docs about the security implications of doing that.
this issue also came up when thinking about how to integrate structs (#27)
The text was updated successfully, but these errors were encountered:
a good argument for doing hidden checks on the unlocking arguments is that this works well with more complex types in the future like fixed size arrays. Solidity also does hidden checks that the provided types for unlocking arguments are correct.
Created a standalone issue for typed
bytesX
function argumentspreviously part of #178 (previously titled 'Consider changes to
bytes
types)this issue also came up when thinking about how to integrate structs (#27)
The text was updated successfully, but these errors were encountered: