Skip to main content

MessageHashing

_hashMessage

function _hashMessage(address _from, address _to, uint256 _fee, uint256 _valueSent, uint256 _messageNumber, bytes _calldata) internal pure returns (bytes32 messageHash)

Hashes messages using assembly for efficiency.

Adding 0xc0 is to indicate the calldata offset relative to the memory being added to. If the calldata is not modulus 32, the extra bit needs to be added on at the end else the hash is wrong.

Parameters

NameTypeDescription
_fromaddressThe from address.
_toaddressThe to address.
_feeuint256The fee paid for delivery.
_valueSentuint256The value to be sent when delivering.
_messageNumberuint256The unique message number.
_calldatabytesThe calldata to be passed to the destination address.