GithubHelp home page GithubHelp logo

deploy-cairo1-demo's People

Contributors

l-henri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

deploy-cairo1-demo's Issues

Error when Declare

Sending the transaction with max_fee: 0.000030 ETH (29795131768187 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 "/root/.pyenv/versions/python3.9/lib/python3.9/site-packages/services/external_api/client.py", line 187, in _send_request
return await self._parse_response(
File "/root/.pyenv/versions/python3.9/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"}.
Solution :
To resolve this, You should try to modify the transaction command by adding the flag --allowed-libfuncs-list-name experimental_v0.1.0 to permit all libfuncs during compilation. This adjustment should address the compilation failure issue, allowing you to proceed with sending the transaction on the Starknet network.
Hope i was helpful ;)

Copy paste of the contract will not work

Hello,

It could be a valuable info for the reader to remind that the class hash is computed from several inputs described in the documentation.

As a consequence, if the contract's code from this sample is copied and pasted, the Starknet gateway will return a 400 bad request specifying that the class hash already exists (CLASS_ALREADY_DECLARED).

failed to declare contract which is compiled by "Scarb"

I build a contract which is compiled by Scarb. And I get a file named "hello_HelloStarknet.sierra.json" with command scarb --release build for example.
When I use command starknet declare --contract target/release/hello_HelloStarknet.sierra.json, I get this error:

scarb version:

scarb 0.2.0-alpha.2 (f9c07ce68 2023-05-05)
cairo: 1.0.0-rc0 (https://crates.io/crates/cairo-lang-compiler/1.0.0-rc0)

starknet version:

starknet 0.11.0.2
Sending the transaction with max_fee: 0.000001 ETH (1378300000000 WEI).
Got BadRequest while trying to access https://alpha4.starknet.io/gateway/add_transaction. Status code: 500; text: {"code": "StarknetErrorCode.COMPILATION_FAILED", "message": "Compilation failed. Error: Invalid Sierra program.\n"}.
Traceback (most recent call last):
  File "/home/ljc/cairo_venv_v11/lib/python3.9/site-packages/services/external_api/client.py", line 187, in _send_request
    return await self._parse_response(
  File "/home/ljc/cairo_venv_v11/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: Invalid Sierra program.\n"}
Error: BadRequest: HTTP error ocurred. Status: 500. Text: {"code": "StarknetErrorCode.COMPILATION_FAILED", "message": "Compilation failed. Error: Invalid Sierra program.\n"}

Error: OSError: [Errno 8] Exec format error: '[...]/bin/starknet-sierra-compile'

Hello, thank you for your tutorial, I'm currently following it.


I'm trying to declare my contract: starknet declare --contract hello_starknet.json --account version_11 --wallet version_11.
But I'm facing this error: Error: OSError: [Errno 8] Exec format error: '/Users/blabla/cairo_venv_v11/lib/python3.9/site-packages/starkware/starknet/compiler/v1/bin/starknet-sierra-compile'.


Somebody faced the same error as me here so I understood that the starknet-sierra-compile is not compatible with my hardware architecture (Apple M1 Pro, 14 inches 2021, Ventura 13.0.1 (22A400)).


Where could I found the repo in order to re-compile this binary ?

Compile your contract to Sierra instead of JSON ?

Hey,
I was following this tutorial along this video: https://www.youtube.com/watch?v=JB53QUFJGvA&t=755s
and noticed that there might be a typo in this repo's README:

Screenshot from 2023-03-28 21-50-42

As we want to compile with Sierra, I would assume that the correct command is: cargo run --bin starknet-compile -- ../hello_starknet.cairo ../hello_starknet**.sierra** --replace-ids

Could you let me know if there is something I got wrong here, please? (because for me this was the only solution that worked to deploy my first contract)

Anyways, thanks for the tutorial it's now time for me to go bragging on Twitter about my first deployed Cairo 1 contract ! ;)

error when declare

Sending the transaction with max_fee: 0.000030 ETH (29795131768187 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 "/root/.pyenv/versions/python3.9/lib/python3.9/site-packages/services/external_api/client.py", line 187, in _send_request
    return await self._parse_response(
  File "/root/.pyenv/versions/python3.9/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"}

Seems some steps missed

Great cairo1 guide!
But seems some steps missed in readme so it didn't work as I followed.
The contract is supposed to be compiled into Sierra and then CASM.
The only one compilng step in readme is cargo run --bin starknet-compile -- ../hello_starknet.cairo ../hello_starknet.json --replace-ids
suppose we should have cargo run --bin starknet-compile -- ../hello_starknet.cairo ../hello_starknet.sierra --replace-ids
and cargo run --bin starknet-sierra-compile -- ../hello_starknet.sierra ../hello_starknet.casm before declare the contract.
Correct me if I'm wrong :)
Really love your work end enjoy learning cario1 ! Thanks for your hardwork! Truly respect!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.