Does Cairo ring a bell?

Make sure you REGISTER this info in your MEMORY ✨

Nostra Devs 06 - Memory & Registers in #Cairo

💻🧵
In today’s thread, we’ll see:

✨ What’s Cairo Read-only Memory?

✨ Memory Properties in Cairo

✨ Memory Practical Example

✨ What are Cairo Registers?

✨ 3 Designated Cairo Registers

Let’s roll! Image
✨ What’s Cairo Read-only Memory?

In summary, memory in Cairo is Read-only and Nondeterministic.

If we set a value in a memory cell, it can’t change during the program execution.
For example: Setting `[x] = 10`

This means that the cell with address `x` in memory will hold the value `10` throughout the entire program execution ✅
✨ Memory Properties in Cairo

1️⃣ Read-only
Once you write a value in a cell, it can’t be changed

2️⃣ Non-deterministic
The Prover choses the value for each memory cell

3️⃣ Continuous address access
If you access address 40 & 42, then 41 must also be accessed before program ends
✨ Memory Practical Example

Learn how to use memory properly with this example: Image
PRO TIP 🖥

Learn more about memory in Cairo in the official documentation:

cairo-by-example.org/cairo/memory
✨ What are Cairo Registers?

Are there any values that can change during runtime?

Yes, registers ®️

Registers in #Cairo can change during runtime.

They are pointers that keep track of some runtime data.
✨ 3 Designated Cairo Registers

1️⃣ ap (allocation pointer)
Points to the next unused memory cell

2️⃣fp (frame pointer)
Points to the frame of the current function

3️⃣pc (program counter)
Points to the current instruction
Cairo and many other tools/libraries are under significant development.

Iterations are fast, and code changes quickly.

DYOR and use it at your own risk.

You can read the first Nostra Devs thread here:

Our Nostra Famiglia Fund is live!

We’re allocating 5 MILLION $DAI to build on top of #Nostra and #StarkNet

Read more here:

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Nostra (🌹,🤌)

Nostra (🌹,🤌) Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @nostrafinance

Sep 28
WE’RE HIRING 🤝

Check out our SEVEN open positions and join the team that’s shaping the future of #DeFi on #StarkNet

🧵💼
Smart Contract Engineer 💻

angel.co/company/tempus…
Events & Public Relations Executive 💬

angel.co/company/tempus…
Read 11 tweets
Sep 27
Introducing Nostra Swap 🫰

The most efficient decentralized exchange to swap your stablecoins on #StarkNetImage
Nostra Swap supports $UNO, the first StarkNet-native stablecoin

You’ll be able to swap between all major stablecoins like $UNO, $USDC and $DAI with low fees and low slippage

Let's dive in 👇
How does it work?

SWAP ↔️

With Nostra Swap, you'll be able to efficiently swap stablecoins for UNO or between any other stablecoins on StarkNet

EARN 💰

Nostra Swap is permissionless, allowing anybody to earn yield by providing liquidity for any supported #stablecoin
Read 12 tweets
Aug 15
GM Famiglia 🌹

Welcome to the launch of Nostra, the most versatile liquidity protocol for lending and borrowing.

nostra.finance

Nostra is built on #StarkNet, a Layer 2 Validity-Rollup that enables any dApp to achieve unlimited scale ✨
The Tempus Labs team is behind Nostra, and is backed by leading investors such as @jumpcapital, @tomahawk_vc, @lemniscap, @GSR_io and @wintermute_t.

We are happy to be part of the #StarkNet community 🤝

Let’s find out what makes Nostra special!

But first, why StarkNet?
#StarkNet’s fast finality times and low gas fees offer Nostra the ideal conditions to make lending and borrowing more user-friendly and financially accessible than ever before ✅

We plan to keep growing Nostra’s features hand-in-hand with the growth of #StarkNet.
Read 10 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(