(Not sure this belongs here, feel free to propose a better category)
ABSTRACT
Currently the execTransaction
function only ends up verifying threshold
signatures even if more are provided.
I can’t see any reason why a user would provide additionnal signatures on top of the defined Safe’s threshold
if he does not want them also verified.
My proposal is to always verify all provided signatures.
This would allow for instance the implementation of Guards enforcing to easily require additionnal signatures for specific transactions.
DETAILS
My reference here is commit c4feb7d on GitHub - safe-global/safe-smart-account: Safe allows secure management of blockchain assets.
This could for instance be done by modifying the checkSignatures function at line 276, instead of
// Load threshold to avoid multiple storage loads
uint256 _threshold = threshold;
// Check that a threshold is set
if (_threshold == 0) revertWithError("GS001");
checkNSignatures(executor, dataHash, signatures, _threshold);
Use this
uint256 nbSignatures = signatures / 65;
// Check that a threshold is set
if (threshold== 0) revertWithError("GS001");
// Check that the provided signature data is not too short
if (nbSignatures<threshold) revertWithError("GS020");
checkNSignatures(executor, dataHash, signatures, nbSignatures);