Import a Safe wallet
You can use an external Safe wallet with Cometh Connect
You can import an external Safe wallet and use all the feature that Cometh Connect provides (biometric signer, gasless transactions, multiple devices...)
At the moment, Cometh Connect only supports the import of safe wallet version 1.3.0
The social recovery feature will only be available if the recovery module is added to the existing Safe
We'll use a basic scenario to showcase the different steps:
1. Sign a message using your safe owner
The first step will be to sign a message with one of the owner of your Safe wallet. The signature generated will validate the ownership of the safe and help us validate the request.
We'll assume that our Metamask wallet is owner of the safe we want to import into Connect. First thing first we'll have to sign a message that validates the demand using EIP712 signature format as follows:
The message to be signed should be retrieved from the getImportSafeMessage() function of the adaptor. Any other message will be rejected.
2. Import Safe on the Connect adaptor
Now use the connect adaptor and call the "importSafe" method with the external wallet address, the message signed and signature (executed in the previous step).
This will trigger the creation of your connect biometric signer. You will get in response the address of your signer.
3. Add biometric signer as owner of your Safe
The only thing left to do is to add that signer address as new owner of your Safe. To do this, create a ComethWallet
instance with the required parameters, then generate the transaction to add the biometric signer as an owner of your Safe using getAddOwnerTransaction
.
Next, sign it with _signTypedData
, and relay it with relayTransaction
. Finally, wait for confirmation with waitRelayedTransaction
, which will return the transaction hash after confirmation.
4. Connect to Cometh wallet
Now that your biometric signer address is owner of your Safe, you can instantiate Cometh Wallet with it and start using it.
Last updated