Make Offer Signature Structure
To authorize the makeOffer
operation within the MNS service, the user (the offeror) must generate a cryptographic signature compliant with the EIP-191 standard.
This signature proves the offeror's intent and authorization to place a specific offer on a target username under the specified terms (amount, expiration).
Signed Message Format
The message is constructed by concatenating the following components as strings, separated by commas (,
):
string.concat(
"52649c2e",
",",
_username,
",",
Strings.toString(_dateExpire),
",",
Strings.toString(_amount),
",",
Strings.to(_mateNameServiceNonce)
)
1. MNS Make Offer Identifier (Hex String):
- Value:
52649c2e
- Purpose: A specific identifier used to distinguish MNS
makeOffer
messages from other types of signed messages.
2. Target Username (String):
- Value: The
_username
string itself. - Purpose: Specifies the username on which the offer is being placed.
3. Offer Expiration Date (String):
- Value: The result of
Strings.toString(_dateExpire)
. - Purpose: The string representation of the timestamp using Unix epoch seconds indicating when this offer expires.
4. Offer Amount (String):
- Value: The result of
Strings.toString(_amount)
. - Purpose: The string representation of the quantity of MATE tokens (in total) being offered in exchange for the username.
5. MNS Nonce (String):
- Value: The result of
Strings.toString(_nonce)
. - Purpose: The string representation of the user's (offeror's) nonce specific to the MNS contract for this
makeOffer
action. This prevents replay attacks.
tip
addressToString
converts an address to a lowercase stringStrings.toString
converts a number to a stringAdvancedStrings.bytes32ToString(bytes32 _input)
converts abytes32
value into its lowercase hexadecimal string representation