0

I am integrating with the @safe-global/safe-core-sdk library. I am wondering how to get the raw transaction data of a SafeTransaction - since one of our signers is a MPC, was wondering if it'd be posssible to generate signature externally and feed that back in via addSignature

1 Answer 1

1

It's totally possible to get the raw tx data and feed it back into your Safe. Here's a somewhat detailed breakdown of what you need to do.

  1. Create a Safe tx(transaction) by calling the execTransaction method of the Safe instance and pass in the required params for the tx you want to execute.
  2. Fetch the raw tx data by calling the encodeABI method of the tx object and pass in the required params. You will get the ABI-encoded data of the tx which you can use to generate the signature.
  3. To then generate this signature for the raw tx data you can use an ethereum signing tool such as ethSign or a hardware wallet if you own any. The signature will be generated using the private key of one of the owner address of the Safe.
  4. Lastly, and the most important part - To feed the signature back into the Safe you can now use the addSignature method of your Safe instance to feed the signature back into the contract. As usual once enough signatures have been collected the tx will be executed.
2
  • Thanks for the break down! Feb 10, 2023 at 18:52
  • You're welcome man. Click on the arrow on my answer up to upvote this if it was useful to you. Feb 12, 2023 at 15:48

Your Answer

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

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