I was looking at the example contract in the solidity docs here: https://solidity.readthedocs.io/en/v0.5.3/contracts.html (the first one with the ‘OwnedToken’ contract in it.)
If you scroll down to the bottom of that example there is this “isTokenTransferOK” function and the the body of that function is:
// Check an arbitrary condition to see if transfer should proceed
return keccak256(abi.encodePacked(currentOwner, newOwner))[0] == 0x7f;
I’m rather confused by this line. I get what the keccak function does and I basically get what abi.encodePacked does, but what is the “[0]” at the end and why would all of that equal the hex code 0x7f?
The notes say this is an arbitrary condition, so not sure if that means this is nonsense anyway or what.
Any help here would be great.