Skip to content

Commit b9406ef

Browse files
committed
Use an EmailRecoveryCommandHandler for the safe 1.4 flow
1 parent 70ee1e8 commit b9406ef

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

contracts.base-sepolia.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"safeEmailRecoveryModule": "0xf2Fcd6b51F1a58E76667DBAF06B5E655166fb738",
3-
"universalEmailRecoveryModule": "0x29a26b4f4fDA819415Ef2d93255998E8FF864066",
4-
"validatorsAddress": "0xd9Ef4a48E4C067d640a9f784dC302E97B21Fd691",
3+
"universalEmailRecoveryModule": "0x79E6B8e37cbD8Db5235086eda870393860246587",
54
"safe4337ModuleAddress": "0x31724D48Ba93c3c31617d3346cB7Ec79705013e3",
65
"erc7569LaunchpadAddress": "0xEBe001b3D534B9B6E2500FB78E67a1A137f561CE"
7-
}
6+
}

src/components/burnerWallet/GuardianSetup.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626
erc7569LaunchpadAddress,
2727
safe4337ModuleAddress,
2828
universalEmailRecoveryModule,
29-
validatorsAddress,
3029
} from "../../../contracts.base-sepolia.json";
3130
import { abi as universalEmailRecoveryModuleAbi } from "../../abi/UniversalEmailRecoveryModule.json";
3231
import { StepsContext } from "../../App";
@@ -140,10 +139,10 @@ const GuardianSetup = () => {
140139
safe4337ModuleAddress: safe4337ModuleAddress as `0x${string}`,
141140
erc7569LaunchpadAddress: erc7569LaunchpadAddress as `0x${string}`,
142141
validators: [
143-
{
144-
address: validatorsAddress as `0x${string}`,
145-
context: "0x",
146-
},
142+
// {
143+
// address: validatorsAddress as `0x${string}`,
144+
// context: "0x",
145+
// },
147146
],
148147
});
149148

@@ -423,7 +422,7 @@ const GuardianSetup = () => {
423422
)
424423
}
425424
title="Recovery Delay"
426-
// helperText="This is the delay you the actual wallet owner has to cancel recovery after recovery has been initiated, helpful for preventing malicious behavior from guardians."
425+
// helperText="This is the delay you the actual wallet owner has to cancel recovery after recovery has been initiated, helpful for preventing malicious behavior from guardians."
427426
/>
428427

429428
<Select

src/components/burnerWallet/RequestedRecoveries.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import completeRecoveryIcon from "../../assets/completeRecoveryIcon.svg";
1212
import infoIcon from "../../assets/infoIcon.svg";
1313
import { STEPS } from "../../constants";
1414
import { useAppContext } from "../../context/AppContextHook";
15-
15+
import { encodeAbiParameters, encodeFunctionData, keccak256 } from "viem"
1616
import { useBurnerAccount } from "../../context/BurnerAccountContext";
1717
import { config } from "../../providers/config";
1818
import { relayer } from "../../services/relayer";
@@ -134,6 +134,22 @@ const RequestedRecoveries = () => {
134134
})) as [][];
135135

136136
try {
137+
const prevOwner = getPreviousOwnerInLinkedList(
138+
safeOwnersData[0],
139+
safeOwnersData
140+
);
141+
142+
const recoveryCallData = getRecoveryCallData(
143+
prevOwner,
144+
safeOwnersData[0],
145+
newOwner!
146+
);
147+
const recoveryData = getRecoveryData(safeWalletAddress, recoveryCallData) as `0x${string}`;
148+
const recoveryDataHash = keccak256(recoveryData);
149+
// keccak256(
150+
// new TextEncoder().encode("swapOwner(address,address,address)")
151+
// ).slice(0, 10);
152+
// const recoveryData =
137153
// requestId
138154
await relayer.recoveryRequest(
139155
universalEmailRecoveryModule as string,
@@ -143,8 +159,7 @@ const RequestedRecoveries = () => {
143159
.join()
144160
?.replaceAll(",", " ")
145161
.replace("{ethAddr}", safeWalletAddress)
146-
.replace("{ethAddr}", safeOwnersData[0])
147-
.replace("{ethAddr}", newOwner)
162+
.replace("{string}", recoveryDataHash)
148163
);
149164

150165
intervalRef.current = setInterval(() => {

0 commit comments

Comments
 (0)