Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to declare cairo1.0 contract on mainnet #162

Open
icodezjb opened this issue May 18, 2023 · 1 comment
Open

Failed to declare cairo1.0 contract on mainnet #162

icodezjb opened this issue May 18, 2023 · 1 comment

Comments

@icodezjb
Copy link

When I declare cairo 1.0 contract on starknet mainnet, meet this error:

Sending the transaction with max_fee: 0.000063 ETH (63158123495606 WEI).
Got BadRequest while trying to access https://alpha-mainnet.starknet.io/gateway/add_transaction. Status code: 500; text: {"code": "StarknetErrorCode.COMPILATION_FAILED", "message": "Compilation failed. Error: Libfunc alloc_local is not allowed in the libfuncs list '/app/src/starkware/starknet/services/gateway/starknet_gateway_venv-site/starkware/starknet/compiler/v1/mainnet_libfuncs.json'.\n Run with '--allowed-libfuncs-list-name experimental_v0.1.0' to allow all libfuncs.\n"}.
Traceback (most recent call last):
  File "/home/chain/workrust/starknet-contract/venv/lib/python3.9/site-packages/services/external_api/client.py", line 187, in _send_request
    return await self._parse_response(
  File "/home/chain/workrust/starknet-contract/venv/lib/python3.9/site-packages/services/external_api/client.py", line 231, in _parse_response
    raise BadRequest(status_code=response.status, text=text)
services.external_api.client.BadRequest: HTTP error ocurred. Status: 500. Text: {"code": "StarknetErrorCode.COMPILATION_FAILED", "message": "Compilation failed. Error: Libfunc alloc_local is not allowed in the libfuncs list '/app/src/starkware/starknet/services/gateway/starknet_gateway_venv-site/starkware/starknet/compiler/v1/mainnet_libfuncs.json'.\n Run with '--allowed-libfuncs-list-name experimental_v0.1.0' to allow all libfuncs.\n"}
Error: BadRequest: HTTP error ocurred. Status: 500. Text: {"code": "StarknetErrorCode.COMPILATION_FAILED", "message": "Compilation failed. Error: Libfunc alloc_local is not allowed in the libfuncs list '/app/src/starkware/starknet/services/gateway/starknet_gateway_venv-site/starkware/starknet/compiler/v1/mainnet_libfuncs.json'.\n Run with '--allowed-libfuncs-list-name experimental_v0.1.0' to allow all libfuncs.\n"}
[13:42]
$ starknet-compile --version
cairo-lang-starknet 1.0.0-alpha.6
$ starknet --version
starknet 0.11.0.2
@cymqqqq
Copy link

cymqqqq commented Jul 31, 2023

Hi @icodezjb , did you use "scarb build" command to generate your sirrea middle file first? If so, you can then use "starkli declare" command to declare your the sirrea middle file to generate the class hash, and finally, you can use "starkli deploy" to deploy your contract on the mainnet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants