cairo-lang icon indicating copy to clipboard operation
cairo-lang copied to clipboard

Account generated not the same as contract delaration

Open amlord opened this issue 2 years ago • 0 comments

I'm just running through the getting started tutorials, and have run into an issue where an account is created with a leading 0x0 value, however, in the contract declaration I get a UNINITIALIZED_CONTRACT error due to the account address only having 0x (i.e. 0x013ea65804780264d2b4cbfe4a1f23baaa542dda5155f7d698766aca3e0976d9 vs. 0x13ea65804780264d2b4cbfe4a1f23baaa542dda5155f7d698766aca3e0976d9).

Steps to reproduce...

Create new account:

➜ starknet new_account --account Wallet
Account address: 0x013ea65804780264d2b4cbfe4a1f23baaa542dda5155f7d698766aca3e0976d9
Public key: 0x076792ef238c6c5ee888eee6fd051295681d83c449cbf8d8e0c4e47ebb303a96
Move the appropriate amount of funds to the account, and then deploy the account
by invoking the 'starknet deploy_account' command.

NOTE: This is a modified version of the OpenZeppelin account contract. The signature is computed
differently.

Deploy account:

➜ starknet deploy_account --account Wallet
Sending the transaction with max_fee: 0.000000 ETH (199867151029 WEI).
Sent deploy account contract transaction.

Contract address: 0x013ea65804780264d2b4cbfe4a1f23baaa542dda5155f7d698766aca3e0976d9
Transaction hash: 0x3e3ac9450607a80ceea281af0bcde869ced779edf204a09f8d1904077314603

Declare contract:

➜ starknet declare --contract contract_compiled.json --account Wallet
Got BadRequest while trying to access https://alpha4.starknet.io/feeder_gateway/simulate_transaction?blockNumber=pending. Status code: 500; text: {"code": "StarknetErrorCode.UNINITIALIZED_CONTRACT", "message": "Requested contract address 0x13ea65804780264d2b4cbfe4a1f23baaa542dda5155f7d698766aca3e0976d9 is not deployed."}.
Traceback (most recent call last):
  File "/Users/aml/cairo_venv/lib/python3.9/site-packages/services/external_api/client.py", line 117, in _send_request
    raise BadRequest(status_code=response.status, text=text)
services.external_api.client.BadRequest: HTTP error ocurred. Status: 500. Text: {"code": "StarknetErrorCode.UNINITIALIZED_CONTRACT", "message": "Requested contract address 0x13ea65804780264d2b4cbfe4a1f23baaa542dda5155f7d698766aca3e0976d9 is not deployed."}
Error: BadRequest: HTTP error ocurred. Status: 500. Text: {"code": "StarknetErrorCode.UNINITIALIZED_CONTRACT", "message": "Requested contract address 0x13ea65804780264d2b4cbfe4a1f23baaa542dda5155f7d698766aca3e0976d9 is not deployed."}

amlord avatar Dec 16 '22 16:12 amlord