# Check if address has a deployed contract

**URL:** <https://community.starknet.io/t/check-if-address-has-a-deployed-contract/344>\
**Category:** Support\
**Created:** [January 14, 2022, 3:58pm UTC](https://community.starknet.io/t/check-if-address-has-a-deployed-contract/344 "2022-01-14T15:58:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![martriay](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/martriay/32/25_2.png) [@martriay](https://community.starknet.io/u/martriay)\
**Post date:** [January 14, 2022, 3:58pm UTC](https://community.starknet.io/t/check-if-address-has-a-deployed-contract/344/1 "2022-01-14T15:58:33Z")

</div>

Unlike the EVM in StarknetOS all addresses correspond to contracts (not accounts), but I’m not sure what’s the preferred way to check whether a given address corresponds to a _deployed_ smart contract or not?

---

<div class="post-metadata">

**Author:** ![henrli](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/henrli/32/6_2.png) [@henrli](https://community.starknet.io/u/henrli)\
**Post date:** [January 14, 2022, 4:41pm UTC](https://community.starknet.io/t/check-if-address-has-a-deployed-contract/344/2 "2022-01-14T16:41:26Z")

</div>

Hello!  
At some point there were discussions abut having something similar to extcodehash on Ethereum. That would fit the bill, right?  
I’ll ask around next week if we moved along with that

---

<div class="post-metadata">

**Author:** ![martriay](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/martriay/32/25_2.png) [@martriay](https://community.starknet.io/u/martriay)\
**Post date:** [January 17, 2022, 3:46pm UTC](https://community.starknet.io/t/check-if-address-has-a-deployed-contract/344/3 "2022-01-17T15:46:52Z")

</div>

So I guess there’s no way to do it yet.

> [@henrli](#):
>
> That would fit the bill, right?

I think so, yes.

---

<div class="post-metadata">

**Author:** ![FeedTheFed](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/feedthefed/32/72981_2.png) [@FeedTheFed](https://community.starknet.io/u/FeedTheFed)\
**Post date:** [January 18, 2022, 8:07am UTC](https://community.starknet.io/t/check-if-address-has-a-deployed-contract/344/4 "2022-01-18T08:07:10Z")

</div>

Full nodes will be able to provide this information, basically the question reduces to the following:

Is the leaf corresponding to a given address in the Merkle-Patricia tree whose root is R (available on L1) nonzero?

This information can be relayed trustlessly if you provide the path proving the leaf’s value.

---

<div class="post-metadata">

**Author:** ![henrli](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/henrli/32/6_2.png) [@henrli](https://community.starknet.io/u/henrli)\
**Post date:** [January 18, 2022, 3:11pm UTC](https://community.starknet.io/t/check-if-address-has-a-deployed-contract/344/5 "2022-01-18T15:11:58Z")

</div>

Will you be able to read this information from inside a smart contract?

---

<div class="post-metadata">

**Author:** ![hacxx](https://avatars.discourse-cdn.com/v4/letter/h/a88e4f/32.png) [@hacxx](https://community.starknet.io/u/hacxx)\
**Post date:** [May 23, 2025, 7:18pm UTC](https://community.starknet.io/t/check-if-address-has-a-deployed-contract/344/6 "2025-05-23T19:18:15Z")

</div>

In Starknet, you can use the `getClassHashAt` RPC method or `starknet_getClassHashAt` via a provider. If the address has a deployed contract, it will return the class hash; if not, it typically returns `0x0` or throws an error. This is the standard way to check for deployed contracts.

---

<div class="post-metadata">

**Author:** ![martriay](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/martriay/32/25_2.png) [@martriay](https://community.starknet.io/u/martriay)\
**Post date:** [May 23, 2025, 7:38pm UTC](https://community.starknet.io/t/check-if-address-has-a-deployed-contract/344/7 "2025-05-23T19:38:26Z")

</div>

The question was whether smart contracts can check that.

---

<div class="post-metadata">

**Author:** ![Android](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@Android](https://community.starknet.io/u/Android)\
**Post date:** [July 13, 2025, 4:21am UTC](https://community.starknet.io/t/check-if-address-has-a-deployed-contract/344/8 "2025-07-13T04:21:38Z")

</div>

-Hello! Have you ever encountered a situation like this? I transferred Starknet coins from an exchange to a wallet. There were no transactions for a year. After the last transfers, all the coins were transferred to a smart contract. I don’t understand where it came from or what to do with it. The support team responded that the system can deploy a smart contract on its own during interactions (in short). According to Starknet, an account is a smart contract. What kind of interaction is this? And how did it happen? There were no transactions with other dApps.

---

<div class="post-metadata">

**Author:** ![Immanuelolivia1](https://dub1.discourse-cdn.com/flex005/user_avatar/community.starknet.io/immanuelolivia1/32/85409_2.png) [@Immanuelolivia1](https://community.starknet.io/u/Immanuelolivia1)\
**Post date:** [July 17, 2025, 12:57am UTC](https://community.starknet.io/t/check-if-address-has-a-deployed-contract/344/9 "2025-07-17T00:57:32Z")

</div>

Hi @Android  
This is a great question — and yes, it can definitely be confusing if you’re newer to Starknet.

Let me try to break it down:

**On Starknet, accounts _are_ smart contracts.**  
This means that when you create a wallet, what you’re actually doing is _deploying an account contract_ on-chain. It’s very different from EVM chains like Ethereum, where wallets are just keypairs.

**So what likely happened:**  
When you first funded the address from an exchange, the account contract hadn’t yet been deployed (especially if you were using an “account abstraction” wallet like Argent X or Braavos). Later on, once you interacted with your wallet or approved a transaction, the _wallet client auto-deployed_ the smart contract account using those initial funds (Starknet ETH) to cover gas.

**Even if there were no dApp interactions** , this account deployment is considered a transaction. You can check this on Starkscan or Voyager by looking at the first transaction from your wallet — it will probably say something like “Deploy Account”.

just incase you’re not sure where your funds went, I’d recommend checking:

- [starkscan.co](https://starkscan.co) (search your address)
- Look for a `DEPLOY_ACCOUNT` transaction
- The account it was deployed to should match your wallet address

Let me know if you need help interpreting what you see — happy to help!
