I have a function which accepts one
function start( bytes16 reference )
I have some events which I use to track behaviour, using
reference as the index. Everything works well enough except when a user submits a reference with 17-32 chars. Between web3 and the SC,
reference is being truncated, keeping only the 16 bytes to the left and the rest as zero.
I added validations for this on the client-side but I still wanted to setup the SC to handle this more gracefully. I was expecting it to revert transaction with a type error but that only happens if the argument has over 32 bytes.
I would imagine I should be adding a modifier to require the right length but I'm having a hard time finding similar cases to understand how it should be done. What's the best practice in a situation like this?