Code Monkey home page Code Monkey logo

starknet-cairo-101's People

Contributors

a186r avatar barretodavid avatar cryptoleek-eth avatar davidmitesh avatar dhruvkelawala avatar gaetbout avatar giwook-han avatar gyan0890 avatar jejomstark avatar l-henri avatar liudi4046 avatar lth-elm avatar lucaslvy avatar magicking avatar mcarlomagno avatar nadai2010 avatar nekocl avatar nomisto avatar omahs avatar omarespejel avatar othmansefraoui avatar phklive avatar qbzzt avatar qd-qd avatar rbkhmrcr avatar remedcu avatar rootulp avatar trevis-dev avatar vinseabook avatar waheya 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  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  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

starknet-cairo-101's Issues

Ex 8: set_user_values fn in "Administration section"

In Exercise 8 the set_user_values() fn is in the "Administration" section where it is said that "only admin can call these" and that "You shouldn't have to understand them".

This seems like an error to me, set_user_values() fn should be moved up considering that it's an external fn that you need to call to be able to finish the exercise.

SCR-20230426-mfhd

Spanish translation of exercises

Hey Spanish-speaking Starker! ๐Ÿ‘‹

This issue is for coordinating the translation of the exercises in this automated Workshop.

Please follow these steps:

  • Comment in this issue what contract you want to translate so @omarespejel can save your place. You can translate more than one!
  • Clone the spanish branch: git clone --branch spanish https://github.com/starknet-edu/starknet-cairo-101.git.
  • Translate the instructions and comments in the contracts directory of the main branch.
  • As an example, check this first translation.
  • Once you've push and are creating the PR on GitHub, remember to do it (compare) against the spanish branch and not against the main one.
  • On your PR please tag this issue #28 (with a # and 18) so we can keep track of the translations.
  • If required, follow this tutorial on how to make Pull Requests.

Any questions please ask them in this issue.

These are the contracts to be translated:

Ex09 lines 88-90 clarification

If I understand the recursions correctly, I think comment lines 88-89 should instead say something like this:

# This part of the function is first reached when **length=1 (after return from length=0)**.
# Checking that the **current** value in the array ([array]) is not 0

and line 90 error message should instead be something like

with_attr error_message("**No value of the array should be 0**"):

How to connect the block explorer to my account smart contract?

Sorry for my dumb question. I'm just getting started and I don't know how to connect the block explorer to my account smart contract.

Connect the block explorer (Starkscan or Voyager) to your account smart contract. These are block explorers for StarkNet (the equivalent of Etherscan for Ethereum) and allow you to browse the state of the blockchain, view all transactions and their status. By connecting a block explorer to your wallet, you will be able to broadcast your transactions through your wallet.

When I try to locate my account on Starkscan, it displays Error: Contract does not exist. My account is on Testnet (https://alpha4.starknet.io) and it already have some funds from Starkware's faucet.

My starknet public key is 0x01b9759dFdc5107D0B2e2030e0f49D4eAC165327C473Aa3CB569a8185Feb3453

Ex 08 comment line 108 clarification

If I understand the recursion correctly, I think comment line 108 should instead say something like this:

# This part of the function is first reached when **length=1 (after return from length=0)**.

ex04

It doesn't work for me here, I tried many things.
Someone see what m I doing wrong please?
Screenshot 2023-02-02 at 13 23 35

Screenshot 2023-02-02 at 13 23 48

Screenshot 2023-02-02 at 13 23 12

Can't create a translation for readme file

Hi! today I've been working on the spanish translation for the README file. But seems that there is not a very clear workflow about how to contribute in this case.

By the documentation:

### Contributing
This project can be made better and will evolve as StarkNet matures. Your contributions are welcome! Here are things that you can do to help:

- Create a branch with a translation to your language
- Correct bugs if you find some
- Add an explanation in the comments of the exercise if you feel it needs more explanation
- Add exercises showcasing your favorite Cairo feature

I forked the project, then created a spanish local branch, then translated the README file and now I don't know how can I do the PR to a new branch called spanish.

Migration to Cairo 1.0

Migration from Cairo 0.X to Cairo 1.0

On this page, we track the transition to Cairo 1.0. We divided them by section.

Additions (not originally in starknet-cairo-101, but relevant for Cairo 1)

  • Structs @gyan0890
  • Traits
  • New types: u32, ContractAddress, etc
  • Enums
  • Loops
  • Use implicit arguments
  • What else?

Omissions (originally in starknet-cairo-101 but that are no longer useful)

  • Recursion
  • Implicit arguments the old way

Contracts

token

utils

Others

  • Convert felt to felt256

Set up

[Ex14] unable to get point and validate_exercise for my argent wallet

Hi,

I deployed a contract that should solve the exo14, my contract got the 28 points and all exercices achievement status. But I would like to get these on my wallet. I looked at the https://github.com/starknet-edu/points-migrator repo but private key and password are required from the original wallet (which a contract doesn't have in my mind).

How can I transfer the ex14's points and achievement status to my wallet then?

Thanks for the help

Conversion from Cairo 1.X to Cairo 2.X for Starknet-Cairo-101 Exercises and Utilities

Hey hey, starknet community! ๐Ÿ‘‰๐Ÿ‘ˆ

The starknet-cairo-101 repository, a valuable resource for Starknet developers, needs to be updated to reflect the new syntax introduced with the Cairo 2.X compiler.

A great resource to get you up to speed with the new Cairo syntax in a Starknet context is Chapter 2 of the Starknet Book.

This task involves converting a series of exercises (from 1 to 14) and a handful of utilities, all currently written in Cairo 1.X.

Below youโ€™ll find a list of the exercises and the utilities that need to be converted:

Exercises:

Utilities from the "token" directory:

Utilities from the "utils" directory:

To avoid overlap in efforts, please comment on this issue indicating which file(s) you'd like to convert. This will allow @omarespejel to assign and tag you accordingly.

Once your work is complete, we kindly ask you to submit your contributions as a pull request to this repository's existing cairo2 branch. If you're not familiar with the process of creating a pull request, please follow these steps:

  1. Fork this repository (top right button on this page).
  2. Clone your forked repository to your local machine (git clone https://github.com/yourusername/starknet-cairo-101.git).
  3. Check out your local repositoryโ€™s existing cairo2 branch (git checkout cairo2).
  4. Make your changes in this branch.
  5. Commit your changes (git commit -m 'Converted files to Cairo 2.X').
  6. Push your changes to your forked repository (git push origin cairo2).
  7. Return to your fork on GitHub, and click the 'Compare & pull request' button next to your cairo2 branch.
  8. Ensure the base fork is set to starknet-edu/starknet-cairo-101 and the base branch is set to cairo2.
  9. Submit your pull request!

Thank you so much for your contribution! Your time and effort are greatly appreciated.

Happy coding! ๐Ÿ’ป๐ŸŽ‰

Ex09 line 96 clarification

Line 96 error message says "value at index i should be at least twice the value at index i + 1". As verified on Voyager it is possible to get a sum for inputs "700, 400, 300" where 400 is not at least twice 300.

2 * current_sum <= [array] + current_sum is equivalent to current_sum <= [array]

So I think the correct error message should be "value at index i should be at least the sum of values of index strictly higher than i"

Ex 7: claim_points fn in "Administration section"

In Exercise 7 the claim_points() fn is in the "Administration" section where it is said that "only admin can call these" and that "You shouldn't have to understand them".

This seems like an error to me, claim_points() fn should be moved up as in the other exercises.

SCR-20230426-lvvc

Imports and Nits

Moving PR comments to this issue.

Suggest CamelCase interface names as follows cairo-lang.org and OZ naming conventions.

Remove unused imports.
And import OZ utils from openzeppelin.token.erc20.library import ERC20

Can remove internal tempvar binding with return in the if block.

Nit: suggest removing _storage from variables annotated @storage_variable

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.