Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: optimize redundant checks and simplify code #242

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/agw-client/src/getAgwTypedSignature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,15 @@ export async function getAgwTypedSignature(

// if the account is already deployed, we can use signature directly
// otherwise, we provide an ERC-6492 compatible signature
if (code !== undefined) {
if (code !== '0x') {
return signature;
}

// Generate the ERC-6492 compatible signature
// https://eips.ethereum.org/EIPS/eip-6492

// 1. Generate the salt for account deployment
const addressBytes = toBytes(signer.account.address);
const salt = keccak256(addressBytes);
const salt = keccak256(signer.account.address);

// 2. Generate the ERC-6492 compatible signature with deploy parameters
return serializeErc6492Signature({
Expand Down
Loading