Skip to content

Commit 4cbda5e

Browse files
authored
fix(id.place): fix address check, pad hex numbers (#3802)
1 parent 5ebd3d3 commit 4cbda5e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

apps/id.place/popup/routes/wallet/SendCalls.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { twMerge } from "tailwind-merge";
66
import { RpcRequest } from "ox";
77
import { RpcSchema } from "porto";
88
import { TruncatedHex } from "../../../src/ui/TruncatedHex";
9-
import { decodeFunctionData, formatEther, stringify } from "viem";
9+
import { decodeFunctionData, formatEther, isAddressEqual, stringify } from "viem";
1010
import { worldAbi } from "../../../src/worldAbi";
1111
import { Hooks } from "porto/remote";
1212

@@ -27,7 +27,7 @@ export function SendCalls() {
2727
}
2828
const { from, calls } = request.params[0];
2929
const accounts = Hooks.usePortoStore(porto, (state) => state.accounts);
30-
const account = accounts.find((account) => from != null && account.address === from);
30+
const account = from != null ? accounts.find((account) => isAddressEqual(account.address, from)) : undefined;
3131
if (!account) throw new Error("no account");
3232

3333
// TODO: replace with request origin after upgrading porto

apps/id.place/src/popup/mode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ export function mode(): Mode.Mode {
155155
const publicKey = possiblePublicKeys.find((publicKey) =>
156156
encodedOwners.has(
157157
AbiParameters.encode(AbiParameters.from(["bytes32", "bytes32"]), [
158-
Hex.fromNumber(publicKey.x),
159-
Hex.fromNumber(publicKey.y),
158+
Hex.fromNumber(publicKey.x, { size: 32 }),
159+
Hex.fromNumber(publicKey.y, { size: 32 }),
160160
]),
161161
),
162162
);

0 commit comments

Comments
 (0)