英文:
StarknetErrorCode.UNINITIALIZED_CONTRACT: "Requested contract address is not deployed."
问题
我正在按照 https://book.starknet.io/chapter_1/deploying_contracts.html 上的文档进行操作。
当我运行:
starknet deploy_account --account account1
我得到以下输出:
发送了最大费用为 0.000005 ETH(4755300280563 WEI)的交易。
已发送部署账户合同交易。
合同地址:0x065a8e85b4925865ad129eb51a14d5eee65864fa919d1b1ef4ada89946863309
交易哈希:0x708c23379b6f98f9a77e81bd536b9407c7c022c4c2571b42469817fe9274ebc
当我执行 starknet-compile 和 starknet declare 时,我得到以下错误:
错误:BadRequest:发生了 HTTP 错误。状态:500。文本:{"code": "StarknetErrorCode.UNINITIALIZED_CONTRACT", "message": "Requested contract address 0x65a8e85b4925865ad129eb51a14d5eee65864fa919d1b1ef4ada89946863309 is not deployed."}
我注意到错误中存在逻辑不一致:
我的合同地址是:0x065a8e85b4925865ad129eb51a14d5eee65864fa919d1b1ef4ada89946863309
但它声称请求的合同地址是:
0x65a8e85b4925865ad129eb51a14d5eee65864fa919d1b1ef4ada89946863309
好像它去掉了第一个 0。
我该如何修复这个问题?
英文:
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 ?
答案1
得分: 1
问题是您尝试部署合同的账户合同(0x065a8e85b4925865ad129eb51a14d5eee65864fa919d1b1ef4ada89946863309)尚未初始化。您可以在浏览器上看到交易0x708c23379b6f98f9a77e81bd536b9407c7c022c4c2571b42469817fe9274ebc失败。
请执行以下操作:
- 检查您是否已为账户0x065a8e85b4925865ad129eb51a14d5eee65864fa919d1b1ef4ada89946863309提供资金
- 编辑位于文件夹
~/.starknet_accounts中的相关文件,以使您的账户未标记为已部署$ - 再次发送部署命令
- 验证交易是否成功
- 尝试重新部署您的合同
愉快的编程!
英文:
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_accountsso 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!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论