1

I am new to Cairo and StarkNet. I am running a simple contract given in the following link of Cairo docs. I am following all the steps. After compilation when I am trying to declare the contract it is giving the following error.

Error Got BadRequest while trying to access https://alpha4.starknet.io/feeder_gateway/simulate_transaction?blockNumber=pending. Status code: 500; text: {"code": "StarknetErrorCode.ENTRY_POINT_NOT_FOUND_IN_CONTRACT", "message": "Entry point 0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3 not found in contract with class hash 0x6a2c4510a0eb1bbcb75b66b23b9f3897c43644b1c86c2547cbe708f97c8f18b."}. Traceback (most recent call last): File "/home/chainz/.local/lib/python3.10/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.ENTRY_POINT_NOT_FOUND_IN_CONTRACT", "message": "Entry point 0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3 not found in contract with class hash 0x6a2c4510a0eb1bbcb75b66b23b9f3897c43644b1c86c2547cbe708f97c8f18b."} Error: BadRequest: HTTP error ocurred. Status: 500. Text: {"code": "StarknetErrorCode.ENTRY_POINT_NOT_FOUND_IN_CONTRACT", "message": "Entry point 0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3 not found in contract with class hash 0x6a2c4510a0eb1bbcb75b66b23b9f3897c43644b1c86c2547cbe708f97c8f18b."}

The link of cairo docs https://www.cairo-lang.org/docs/hello_starknet/intro.html#your-first-contract

Your help is appreciated. Thanks.

Uli Schlachter
  • 9,337
  • 1
  • 23
  • 39

3 Answers3

1
  1. create a named account starknet deploy_account --account=blabla
  2. and use this named account starknet declare --account blabla --contract contract_compiled.json

Hope this helps

Oleg
  • 11
  • 1
0

You will need to specify the account using --account=YOUR_DEPLOYED_ACCOUNT with the transaction.

0

Entrypoint not found means it couldn't find the specified function selector. You probably tried to call the wrong contract. You can compute fonction selector using starknet.py from starkware.starknet.compiler.compile import get_selector_from_name

Th0rgal
  • 703
  • 8
  • 27