I would like to create listings on marketplaces like LooksRare, where they use off-chain (signature based) maker orders, but I am not sure how to do this with a Safe.
I understand the role of the CompatibilityFallbackHandler
, and the SignMessageLib
contracts, and I have been able to add signed messages to my safe... what I do not get, is how the CompatibilityFallbackHandler
will ever return MAGIC_VALUE for a 1271 signature.
// Marketplaces call IERC1271 like this
IERC1271(signer).isValidSignature(digest, abi.encodePacked(r, s, v))
// Compatibility fallback is implemented
isValidSignature(bytes memory _data, bytes memory _signature) {
...
// How can I ensure _signature.length is 0 here?
if (_signature.length == 0) {
require(safe.signedMessages(messageHash) != 0, "Hash not approved");
}
...
}
UPDATE: For marketplaces who call isValidSignature
like above the alternate method with args (bytes32, bytes) overloads the other function so that is fine. Still wondering how I should setup the ISignatureValidator with a custom isValidSignature
. I will just create a similar FallbackHandler contract for now.