starknet-edu / starknet-cairo-101 Goto Github PK
View Code? Open in Web Editor NEWLearn how to read Cairo code
Learn how to read Cairo code
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.
Hey Spanish-speaking Starker! ๐
This issue is for coordinating the translation of the exercises in this automated Workshop.
Please follow these steps:
spanish
branch: git clone --branch spanish https://github.com/starknet-edu/starknet-cairo-101.git
.push
and are creating the PR on GitHub, remember to do it (compare) against the spanish
branch and not against the main
one.Any questions please ask them in this issue.
These are the contracts to be translated:
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**"):
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
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)**.
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
.
On this page, we track the transition to Cairo 1.0. We divided them by section.
felt
to felt256
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
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:
git clone https://github.com/yourusername/starknet-cairo-101.git
).cairo2
branch (git checkout cairo2
).git commit -m 'Converted files to Cairo 2.X'
).git push origin cairo2
).cairo2
branch.starknet-edu/starknet-cairo-101
and the base branch is set to cairo2
.Thank you so much for your contribution! Your time and effort are greatly appreciated.
Happy coding! ๐ป๐
cairo-verify
crate to starknet-cairo-101
so that the Cairo code is formatted and and compilable.cairo-verify
as a github workflow (Cairo Book example here).Shout out to the amazing Cairo Book maintainers (@enitrat @fricoben) and their community for this amazing crate.
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"
The completionist in me is going to go crazy looking at the last unfilled exercise on https://starknet-tutorials.vercel.app/#/account for exercise 14.
The following is not the user, it is the calling caller's.
You can't get the credit to your account for completing the exercise.
I want to translate ex02.cairo.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.