Search code examples
starknet

StarknetErrorCode.UNINITIALIZED_CONTRACT: "Requested contract address is not deployed."


I am following the documentation on https://book.starknet.io/chapter_1/deploying_contracts.html.

When I run:

starknet deploy_account --account account1

I get the following output:

Sending the transaction with max_fee: 0.000005 ETH (4755300280563 WEI).
Sent deploy account contract transaction.

Contract address: 0x065a8e85b4925865ad129eb51a14d5eee65864fa919d1b1ef4ada89946863309
Transaction hash: 0x708c23379b6f98f9a77e81bd536b9407c7c022c4c2571b42469817fe9274ebc

When I perform starknet-compile and starknet declare, I get the following error:

Error: BadRequest: HTTP error ocurred. Status: 500. Text: {"code": "StarknetErrorCode.UNINITIALIZED_CONTRACT", "message": "Requested contract address 0x65a8e85b4925865ad129eb51a14d5eee65864fa919d1b1ef4ada89946863309 is not deployed."}

I noticed a logical inconsistency in the error: My contract address is: 0x065a8e85b4925865ad129eb51a14d5eee65864fa919d1b1ef4ada89946863309 Yet it claims the requested contract address is: 0x65a8e85b4925865ad129eb51a14d5eee65864fa919d1b1ef4ada89946863309

It's like it removed the first 0.

How do I fix this ?


Solution

  • The issue is that the account contract (0x065a8e85b4925865ad129eb51a14d5eee65864fa919d1b1ef4ada89946863309 ) from which you are trying to deploy your contract is not initialized. You can see on an explorer that transaction 0x708c23379b6f98f9a77e81bd536b9407c7c022c4c2571b42469817fe9274ebc failed. Please do the following:

    • Check that you funded account 0x065a8e85b4925865ad129eb51a14d5eee65864fa919d1b1ef4ada89946863309
    • Edit the relevant file in folder ~/.starknet_accounts so that your account is not marked as deployed$
    • Send the deploy command again
    • Verify the transaction got through
    • Try to deploy your contract again

    Happy hacking!