Skip to content

Commit 60bea75

Browse files
Add EOF check (#85)
* Add EOF check * Update packages/nextjs/components/address-vision/ButtonsCard.tsx Co-authored-by: Copilot <[email protected]> * Add EOF_SIGNATURE cuz copilot is dum dum --------- Co-authored-by: Copilot <[email protected]>
1 parent 31796a8 commit 60bea75

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/nextjs/components/address-vision/ButtonsCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { usePublicClient } from "wagmi";
88
import { useAddressStore } from "~~/services/store/store";
99

1010
const GNOSIS_SAFE_BYTECODE_PATTERN = "0x608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e";
11+
const EOF_SIGNATURE = "0xef01";
1112

1213
const SAFE_ABI = [
1314
{
@@ -49,7 +50,7 @@ export const ButtonsCard = () => {
4950
if (!address || !client) return;
5051
try {
5152
const bytecode = await client.getCode({ address });
52-
const isContract = bytecode && bytecode.length > 2;
53+
const isContract = bytecode && bytecode.length > 2 && !bytecode.startsWith(EOF_SIGNATURE);
5354

5455
setIsContractAddress(isContract || false);
5556

0 commit comments

Comments
 (0)