Skip to content

@safe:messageHash

Return the SafeMessage hash of an off-chain message (plain string or typed-data JSON), as signed by Safe owners or SignMessageLib.

Returns: bytes32

@safe:messageHash(message safe?)
NameTypeDescription
messagestringRaw message string, or an EIP-712 typed-data JSON document
[safe]addressSafe address (defaults to the context Safe or connected account)

Mark a message as signed on-chain through SignMessageLib (the hash the library stores is the SafeMessage hash this helper returns):

load safe
set $mySafe 0x5afe3855358e112b5647b952709e6165e1c1eeee
set $hash @safe:messageHash("I agree to the terms" $mySafe)