Skip to content

Commit

Permalink
Add saltNonce into local storage
Browse files Browse the repository at this point in the history
  • Loading branch information
wshino committed Sep 17, 2024
1 parent d98e072 commit de9c26a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/burnerWallet/GuardianSetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ const GuardianSetup = () => {
console.log(accountCode, "accountCode");
const localStorageAccountCode = localStorage.getItem("accountCode");

const initialSaltNonce = BigInt(localStorage.getItem("saltNonce") || "0");
const [saltNonce, setSaltNonce] = useState<bigint>(initialSaltNonce);

let interval: NodeJS.Timeout;

const isMobile = window.innerWidth < 768;
Expand Down Expand Up @@ -153,6 +156,7 @@ const GuardianSetup = () => {
signer: walletClientToSmartAccountSigner(client),
safeVersion: "1.4.1",
entryPoint: ENTRYPOINT_ADDRESS_V07,
saltNonce: saltNonce,
safe4337ModuleAddress: "0x3Fdb5BC686e861480ef99A6E3FaAe03c0b9F32e2",
erc7569LaunchpadAddress: "0xEBe001b3D534B9B6E2500FB78E67a1A137f561CE",
validators: [
Expand All @@ -163,6 +167,10 @@ const GuardianSetup = () => {
],
});

const newSaltNonce = saltNonce + 1n;
setSaltNonce(newSaltNonce);
localStorage.setItem("saltNonce", newSaltNonce.toString());

const acctCode = await genAccountCode();

// if (localStorage.getItem("accountCode")) {
Expand Down

0 comments on commit de9c26a

Please sign in to comment.