Skip to content

Commit

Permalink
Merge pull request #38 from Reactive-Network/update-education
Browse files Browse the repository at this point in the history
Update education
  • Loading branch information
konstantinkoniukov authored Oct 2, 2024
2 parents 498ef44 + f3455d5 commit 9e5f897
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 77 deletions.
14 changes: 13 additions & 1 deletion docs/docs/system-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cast send $CALLBACK_ADDR --rpc-url $DESTINATION_CHAIN_RPC --private-key $DESTINA
cast send --rpc-url $DESTINATION_CHAIN_RPC --private-key $DESTINATION_CHAIN_PRIVATE_KEY $CALLBACK_PROXY_ADDR "depositTo(address)" $CALLBACK_ADDR --value 0.1ether
```

**Checking Reactive Contract Balance**: To check the balance of a reactive contract on the Reactive Network, use the following command:
**Checking Reactive Contract Balance**: To check the balance of a contract on the Reactive Network, use the following command:

```bash
cast balance --rpc-url $REACTIVE_RPC $REACTIVE_CONTRACT_ADDR
Expand All @@ -40,6 +40,18 @@ cast balance --rpc-url $REACTIVE_RPC $REACTIVE_CONTRACT_ADDR
Implement the `pay()` method or inherit from `AbstractCallback` or `AbstractReactive` for on-the-spot payments.
:::

### Covering Debts

You might catch the `Callback target currently in debt` error. To cover a debt, the user has two options:

**Call the coverDebts() Method:** If the contract has the `coverDebts()` method implemented, the user should call this method to initiate the debt closure process.

**Use the Callback Proxy's depositTo() Method:** The user can close the debt manually by using the `depositTo()` method described in [Callback Payments](./system-contract.md#callback-payments).

:::info[]
The funds to cover the debt might be held in the user's contract account instead of the callback proxy's account. When the contract transfers these funds to the proxy, it triggers the `receive()` function, closing the debt.
:::

### Callback Pricing

The current pricing formula, subject to change, is simplified for testing. It is set at 1 wei per gas unit but will later incorporate dynamic block base fees. The callback price $$p_{callback}$$ is calculated as follows:
Expand Down
13 changes: 4 additions & 9 deletions docs/education/introduction/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,18 @@ hide_title: true

## Overview

To harness the power of Reactive Smart Contracts (RSCs), we have developed an educational course featuring detailed lectures, code snippets on GitHub, and video demonstrations. Our goal is to provide both theoretical knowledge and practical challenges, creating a community where developers can fully explore RSCs. This course covers key topics such as:

* Executing Uniswap stop orders with RSCs
* Syncing NFT ownership across multiple blockchain platforms
* Auto-harvesting staking rewards from various pools and chains

To better understand the concept of Reactive Smart Contracts (RSCs), we have developed an educational course featuring detailed lectures, code snippets on [GitHub](https://github.com/Reactive-Network/reactive-smart-contract-demos/tree/main/src/demos), and video workshops on [YouTube](https://www.youtube.com/@0xReactive/streams). Our goal is to provide both theoretical knowledge and practical challenges, creating a community where developers can fully explore RSCs.
## Where to Begin

The Introduction chapter provides an overview of Reactive Smart Contracts, highlighting their ability to autonomously respond to events on EVM-compatible chains. It also outlines the technical and knowledge prerequisites necessary for mastering these concepts.
The Introduction chapter provides an overview of Reactive Smart Contracts, highlighting their ability to autonomously react to events on EVM-compatible chains. It also outlines the technical and knowledge prerequisites necessary for mastering these concepts.

[Introduction to Reactive Smart Contracts →](./reactive-smart-contracts.md)

[Prerequisites →](./prerequisites.md)

## Module One

[Module 1](../module-1/index.md) is dedicated to the basics of Reactive Smart Contracts, events and callbacks, the ReactVM and Reactive Network, along with the function of oracles in integrating off-chain data.
[Module 1](../module-1/index.md) is dedicated to the basics of Reactive Smart Contracts, events and callbacks, the ReactVM and Reactive Network environments, subscriptions, and the function of oracles in integrating off-chain data.

[Reactive Smart Contracts →](../module-1/reactive-smart-contracts.md)

Expand Down Expand Up @@ -58,6 +53,6 @@ The [Use Cases](../use-cases/index.md) section explains scenarios where Reactive

## Glossary

The Glossary provides concise definitions of key terms related to blockchain technology, decentralized finance, and smart contracts, including specific Reactive to prevent potential confusion.
The Glossary provides concise definitions of key terms related to blockchain technology, decentralized finance, and smart contracts, including specific Reactive terms to prevent potential confusion.

[Glossary →](../glossary.md)
50 changes: 15 additions & 35 deletions docs/education/introduction/prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,74 +9,54 @@ slug: prerequisites

## Overview

Before embarking on your journey with Reactive Smart Contracts, it's crucial to have a solid foundation in several key
areas. These prerequisites will ensure you can fully grasp the concepts and practical applications of RSCs.
Before embarking on your journey, it's crucial to have a solid foundation in several key areas. These prerequisites will ensure you can fully grasp the concepts and practical applications of Reactive Smart Contracts (RSCs).

## What You Need to Know for This Course

In this course, we aim to equip you with everything you need to grasp the basic use cases of Reactive Smart Contracts,
including deploying and interacting with them. While we intend to cover all critical information, a foundational
understanding of Ethereum Smart Contracts will greatly enhance your learning experience. Below, we've outlined the
prerequisites along with resources to help you get up to speed.
In this course, we aim to equip you with everything you need to grasp the basic use cases of Reactive Smart Contracts, including deploying and interacting with them. While we intend to cover all critical information, a foundational understanding of Ethereum Smart Contracts will greatly improve your learning experience. Below are the prerequisites along with resources to help you get up to speed.

### Solidity and Smart Contract Development

Understanding the syntax and functionalities of Solidity is fundamental. You should be comfortable writing simple smart
contracts and familiar with concepts like smart contracts and functions.
Understanding the syntax and functionalities of Solidity is fundamental. You should be comfortable writing simple smart contracts and familiar with concepts like smart contracts and functions.

Educational Resource: [Solidity by Example](https://solidity-by-example.org/) is an excellent place to start, offering
hands-on examples to guide you through Solidity's basics to more advanced topics.
Educational Resource: [Solidity by Example](https://solidity-by-example.org/) is an excellent place to start, offering hands-on examples to guide you through Solidity's basics to more advanced topics.

### Ethereum Virtual Machine (EVM)

A basic understanding of the EVM is crucial as it's the runtime environment for smart contracts. Knowledge about how
contracts are executed, how functions operate, and how transactions are signed will be beneficial.
A basic understanding of the EVM is crucial as it's the runtime environment for smart contracts. Knowledge about how contracts are executed, how functions operate, and how transactions are signed will be beneficial.

Educational Resource: The [Ethereum EVM illustrated](https://takenobu-hs.github.io/downloads/ethereum_evm_illustrated.pdf) guide provides a visual and detailed explanation of the EVM's
inner workings.
Educational Resource: The [Ethereum EVM illustrated](https://takenobu-hs.github.io/downloads/ethereum_evm_illustrated.pdf) guide provides a visual and detailed explanation of the EVM's inner workings.

### Git and Command Line Understanding

Understanding basic Git commands and command line usage is crucial for effectively using the code examples that we will
provide. Familiarity with an Integrated Development Environment (IDE) like Visual Studio Code can significantly enhance
your coding experience.
Understanding basic Git commands and command line usage is crucial for effectively using the code examples that we will provide. Familiarity with an Integrated Development Environment (IDE) like Visual Studio Code can significantly enhance your coding experience.

Educational Resource: The [Pro Git](https://git-scm.com/book/en/v2) book offers a concise and practical introduction to Git. For command line basics,
check out the [Codecademy's Command Line](https://www.codecademy.com/learn/learn-the-command-line) course.
Educational Resource: The [Pro Git](https://git-scm.com/book/en/v2) book offers a concise and practical introduction to Git. For command line basics, check out the [Codecademy's Command Line](https://www.codecademy.com/learn/learn-the-command-line) course.

### Ethereum Wallet and Test ETH

To interact with Ethereum networks, including deploying and testing smart contracts, you'll need an Ethereum wallet and
some ETH on the Sepolia testnet. This setup is vital for transaction fees (gas) and interacting with deployed contracts.
To interact with Ethereum networks, including deploying and testing smart contracts, you'll need an Ethereum wallet and some ETH on the Sepolia testnet. This setup is vital for transaction fees (gas) and interacting with deployed contracts.

Getting Sepolia ETH: Visit the [Sepolia Faucet](https://www.alchemy.com/faucets/ethereum-sepolia) to obtain testnet ETH.

## What You Don’t Need to Know Beforehand

We recognize that some topics, while not directly related to Reactive Smart Contracts, are essential for a comprehensive
understanding of the blockchain landscape. To ensure you have a well-rounded knowledge base, we've included lessons on
these broader blockchain concepts and tools. This means you won’t have to look elsewhere to fill in the gaps.
We recognize that some topics, while not directly related to Reactive Smart Contracts, are essential for a comprehensive understanding of the blockchain landscape. To ensure you have a well-rounded knowledge base, we've included lessons on these broader blockchain concepts and tools. This means you won’t have to look elsewhere to fill in the gaps.

### Knowledge of EVM Events

EVM events are a cornerstone for RSCs, serving as triggers for reactive functionalities. An understanding of how events
work, how they're logged, and how to interact with them is crucial.
EVM events are a cornerstone for RSCs, serving as triggers for reactive functionalities. An understanding of how events work, how they're logged, and how to interact with them is crucial.

Educational Resource: Learn about [EVM events](../module-1/how-events-work.md) in detail.

### Decentralized Finance Concepts

Familiarity with DeFi concepts, such as liquidity pools, yield farming, and automated market makers (AMMs), will be
helpful, especially for understanding real-world applications of RSCs.
Familiarity with DeFi concepts, such as liquidity pools, yield farming, and automated market makers (AMMs), will be helpful, especially for understanding real-world applications of RSCs.

Educational Resource: We'll explain some of these concepts in our next articles as we walk you through the corresponding
use cases.
Educational Resource: We'll explain some of these concepts in our next articles as we walk you through the corresponding use cases.

## Conclusion

These prerequisites will set you up for success in mastering Reactive Smart Contracts, and fully leveraging their potential
in your blockchain projects. Stay tuned for our upcoming article on EVM events that will further solidify your
understanding and application of these concepts.
These prerequisites will set you up for success in mastering Reactive Smart Contracts, and fully leveraging their potential in your blockchain projects. Stay tuned for our upcoming article on EVM events that will further solidify your understanding and application of these concepts.

Remember, the blockchain space is ever-evolving, so continuous learning is key. These resources are just the beginning;
dive deep, experiment, and don't hesitate to engage with the community for insights and assistance.
Remember, the blockchain space is ever-evolving, so continuous learning is key. These resources are just the beginning; dive deep, experiment, and don't hesitate to engage with the community for insights and assistance.
6 changes: 3 additions & 3 deletions docs/education/introduction/reactive-smart-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Reactive Smart Contracts (RSCs) represent a paradigm shift in how we interact wi

## Why Reactive Smart Contracts

In the realm of Ethereum, smart contracts have revolutionized how we conceive of executing trustless agreements. Traditionally, these contracts spring into action only upon a user-initiated transaction. This presents inherent limitations. For one, smart contracts can't autonomously initiate actions or respond to blockchain events without an external prompt — be it from a user or an automated script (like a trading bot). This requires the holding of private keys, introducing a centralized point of control.
In the Ethereum world, smart contracts have revolutionized how we conceive of executing trustless agreements. Traditionally, these contracts spring into action only upon a user-initiated transaction. This presents inherent limitations. For one, smart contracts can't autonomously initiate actions or respond to blockchain events without an external prompt — either from a user or an automated script like a trading bot. This requires holding private keys and introducing a centralized point of control.

Reactive Smart Contracts (RSCs) emerge as a solution to this constraint. RSCs are designed to autonomously react to events in the Ethereum Virtual Machine (EVM) and trigger subsequent actions across the blockchain ecosystem. This capability for the implementation of complex logic that can source information from multiple chains and enact changes or transactions across various platforms without a central oversight.

Expand All @@ -33,9 +33,9 @@ Reactive Smart Contracts (RSCs) emerge as a solution to this constraint. RSCs ar

## About This Course

To equip developers with the skills and knowledge to harness the potential of RSCs, we've crafted a comprehensive course that includes detailed documentation and hands-on tutorials. Our objective is not just to impart technical knowledge but to foster a collaborative environment where developers can explore the full spectrum of possibilities that RSCs offer.
To equip developers with the skills to harness RSCs, we've created a comprehensive course with detailed documentation and hands-on tutorials. Our goal is to foster a collaborative space where developers can explore the full potential of RSCs.

The course materials encompass lectures, code examples hosted on GitHub, and video demonstrations, providing a multi-faceted learning experience. Whether you're keen on delving into the theoretical underpinnings of Reactive technology or eager to jump straight into practical [use cases](../use-cases/index.md), this course is designed to cater to your learning preferences.
The course offers lectures, GitHub code examples, and video demonstrations for a multi-faceted learning experience. Whether you're interested in theory or practical [use cases](../use-cases/index.md), this course adapts to your needs.

Throughout the course, we will examine various applications of RSCs, including:

Expand Down
Loading

0 comments on commit 9e5f897

Please sign in to comment.