Closed filmakarov closed 1 month ago
possibly can go with third option, it also seems least amount of code change. I am in favour, Given today itself we open PR and show SLOC changes and get a yes from auditors (I see you pasted issue on discord already) btw cmichel is not part of this audit now.
Feature or Improvement Description
Improves backwards compatibility
Benefits & Outcomes
I realised that some protocols may already have their eip-712 data structs secure, in a way they already include all the sensitive data (smart account address etc) in the data struct that is hashed. Thus such protocols do not need to use erc-7739. So we should allow those protocols to access the vanilla erc-1271 flow.
Potential options are:
Nexus.isValidSIgnatureLegacy()
interfaceNexus.isValidSignature
method try calling bothIValidator.isValidSignatureWithSender
andIERC1271Legacy.isValidSignatureWithSenderLegacy
methodsIMO, between those two, the second option is preferable as it is backwards compatible even for protocols that are not aware of ERC7739. So in any case,
Nexus.IsValidSignature
is called. Then:IValidator
supports it, it will successfully check the signatureIValidator
doesn't support 7739 , it will successfully check the signatureIValidator
expects 7739 via isValidSignatureWithSender, it will return 0xffffffff and proceed to try isValidSignatureWithSenderLegacy, which will successfully check that signatureIValidator
doesn't support it,IValidator
won't be able to process the hash and check the signature, but that's unlikely as most default validators on the market will likely support 7739.There's also third option.
IValidator.isValidSignatureWithSender()
as per ERC-7579.Then, for K1Validator it will mean
isValidSignatureWithSender
becomes:I think, the third one is the most consistent one, as it doesn't put any additional expectations on an
IValidator
module, but havingisValidSignatureWithSender
required by ERC-7579 itself. Then it's up to a module to support (like K1 Validator) or not support (like Smart Sessions) the vanilla erc-1271.Code of Conduct