0

I'm using a Safe multisig contract, and I would like to have a public mapping on that contract which keeps track of all the tx that a signer has approved. The contract has an approvedHashes mapping of address to tx_hash to bool but that mapping does not get updated by safe.

Is there an augmented safe contract or some sort of add-on that accomplishes this?

Thank you

2 Answers 2

0

Safe supports multiple signature types, and most of the interfaces use the off-chain ECDSA signatures, which are not tracked anywhere in the contract except events emitted in the L2 version of the Safe singleton.

There are "on-chain" signatures, and the approvedHashes mapping is used in the pre-validated signature type. Most apps do not use this signature type for UX reasons. You can build an app that would exclusively use this type of signatures. From Safe docs:

Pre-Validated Signatures
signature type == 1
Constant Part:
{32-bytes hash validator}{32-bytes ignored}{1-byte signature type}.
Hash validator - Padded address of the account that pre-validated the hash that should be validated. The Safe keeps track of all hashes that have been pre validated. This is done with a mapping address to mapping of bytes32 to boolean where it is possible to set a hash as validated by a certain address (hash validator). To add an entry to this mapping use approveHash. Also if the validator is the sender of transaction that executed the Safe transaction it is not required to use approveHash to add an entry to the mapping.

Learn more about the signatures here: https://docs.safe.global/learn/safe-core/safe-core-protocol/signatures

You can also check out the legacy Gnosis Multisig that exclusively uses on-chain transaction approvals.

8
  • Hey mike, thanks for responding, but my question is simpler. I want to keep track of how many transactions a validator (safe signer) has signed, the signatures bytes themselves are not important to me, I need to track which validators (safe signers) are active or not by tracking how many transactions they've approved or not. Is there a way to do that within the Safe framework? May 30 at 11:09
  • On-chain there's no easy way to do it. You can do it using the Safe Transaction Service API
    – mikheevm
    May 30 at 11:52
  • What is the non-easy way to do it? Jun 4 at 8:33
  • there's a better way, you can add a guard to the contract which will keep track of that information in the guard contract. @mikheevm Jun 27 at 11:55
  • 1
    I see what you mean, to clarify, I am only interested in the executed signatures, so this works for me. Jul 4 at 8:51
0

The answer to this is add the signers of the previous transaction as part of the datapayload of the next transaction, other than that there's no way except implementing your own multisig

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.