Content
@
0 reply
0 recast
0 reaction
fico
@fico23
why is position represented with keccak256(owner+tickLower+tickUpper) when owner+tickLower+tickUpper fit inside bytes32? seems like this could work without keccak
3 replies
0 recast
6 reactions
Haardik
@haardikkk
only thing I can think of is `abi.encodePacked` doesn't return a `bytes32` - it returns a dynamic `bytes` data type. keccak'ing it just makes sure the key is always a fixed size bytes32
2 replies
0 recast
1 reaction
fico
@fico23
Yeah but bytes can be cast to bytes32 without keccak, so it must be something else
1 reply
0 recast
1 reaction
Haardik
@haardikkk
yeah, i cant seem to find any specific instances where it would make much difference either also casting directly instead of keccak also saves about 40 gas it looks like
0 reply
0 recast
1 reaction