Disperse Payment Signature Structure
To authorize disperse payment operations the user must generate a cryptographic signature compliant with the EIP-191 standard.
The signature is created by signing a precisely formatted string message derived from the payment details. The structure of this message varies slightly depending on whether the recipient is specified by a direct address (to_address
) or an identity string (to_identity
).
Signed Message Format
The message is constructed by concatenating the following components as strings, separated by commas (,
):
string.concat(
"ef83c1d6",
",",
AdvancedStrings.bytes32ToString(hashList),
",",
AdvancedStrings.addressToString(_token),
",",
Strings.toString(_amount),
",",
Strings.toString(_priorityFee),
",",
Strings.toString(_nonce),
",",
_priority_boolean ? "true" : "false",
",",
AdvancedStrings.addressToString(_executor)
)
- Function Selector:
ef83c1d6
(identifies thedispersePay
function) - Hashed
toData
:bytes32ToString(sha256(abi.encode(toData)))
(a hash of the recipient data array) - Token Address:
addressToString(_token)
(lowercase string representation) - Total Amount:
Strings.toString(_amount)
(string representation) - Priority Fee:
Strings.toString(_priorityFee)
(string representation) - Nonce:
Strings.toString(_nonce)
(string representation) - Priority Flag:
"true"
or"false"
(string representation based on_priority
boolean) - Executor Address:
addressToString(_executor)
(lowercase string representation)
(Helper functions like bytes32ToString
, addressToString
, and Strings.toString
are assumed utilities for converting data types to their string representations for signing).
addressToString
converts an address to a lowercase stringStrings.toString
converts a number to a string_priority_boolean
indicates whether the payment will be executed asynchronously (true
) or synchronously (false
)
Hash List Structure
The hashList
component within the signature message is derived by ABI-encoding the entire toData
array and then computing its sha256
hash:
bytes32 hashList = sha256(abi.encode(toData));
This ensures that the signature covers the specific recipient list and amounts.
DispersePayMetadata
Struct
Defines the payment details for a single recipient within the toData
array.
struct DispersePayMetadata {
uint256 amount;
address to_address;
string to_identity;
}