Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
[Stellar Merge] Redirects and migration for what will become the "Lea…
Browse files Browse the repository at this point in the history
…rn" section of dev docs (#769)

* first redirects for what will become the "Learn" section of dev docs

* add external links to sidebar props where necessary

* first redirects for what will become the "Learn" section of dev docs

* add external links to sidebar props where necessary

* fix category metadata syntax

* add migration URLs to EVM Migration pages

* add nginx redirect for EVM Migration pages

* add an admonition to the top of each migrated page

(just in case someone stumbles onto the page somehow)

* add a few missing migration admonitions

* fix some nginx redirects
  • Loading branch information
ElliotFriend authored Mar 13, 2024
1 parent bdbf1b3 commit c7d1584
Show file tree
Hide file tree
Showing 30 changed files with 280 additions and 12 deletions.
6 changes: 6 additions & 0 deletions docs/developer-tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ sidebar_custom_props:
label: Developer Tools
---

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/tools/developer-tools) for the most up-to-date information

:::

:::info

All tools currently listed are built and maintained by dedicated community members.
Expand Down
10 changes: 10 additions & 0 deletions docs/migrate/evm/introduction-to-solidity-and-rust.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
sidebar_position: 0
title: Introduction to Solidity, Rust, and Soroban
description: Explore the fundamentals of Solidity, Rust, and Soroban.
sidebar_custom_props:
migration:
href: https://developers.stellar.org/docs/learn/migrate/introduction-to-solidity-and-rust
label: Introduction to Solidity, Rust, and Soroban
---

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/learn/migrate/introduction-to-solidity-and-rust) for the most up-to-date information

:::

# Introduction

We are excited to introduce you to [Soroban](../../), a powerful smart contracts platform designed to be sensible, built-to-scale, and developer-friendly, with a focus on Rust's performance and safety benefits. With its user-friendly interface and powerful features, Soroban offers an ideal platform for developers who are seeking a more efficient and effective way to build decentralized applications and transition from Solidity to Rust. In this article, we will explore the fundamentals of Solidity, Rust, and Soroban, and guide you through setting up the development environment to start your journey with Soroban's Rust smart contract compatibility.
Expand Down
10 changes: 10 additions & 0 deletions docs/migrate/evm/smart-contract-deployment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
sidebar_position: 3
title: Smart Contract Development with Soroban and Hardhat
description: Explore advanced Solidity and Soroban concepts, craft secure and efficient Soroban smart contracts and deploy and test your contracts in a testnet environment.
sidebar_custom_props:
migration:
href: https://developers.stellar.org/docs/learn/migrate/smart-contract-deployment
label: Smart Contract Development with Soroban and Hardhat
---

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/learn/migrate/smart-contract-deployment) for the most up-to-date information

:::

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

Expand Down
10 changes: 10 additions & 0 deletions docs/migrate/evm/solidity-and-rust-advanced-concepts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
sidebar_position: 2
title: Advanced Smart Contract Concepts with Solidity and Rust
description: Learn advanced Solidity and Rust concepts and write safe and efficient smart contracts.
sidebar_custom_props:
migration:
href: https://developers.stellar.org/docs/learn/migrate/solidity-and-rust-advanced-concepts
label: Advanced Smart Contract Concepts with Solidity and Rust
---

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/learn/migrate/solidity-and-rust-advanced-concepts) for the most up-to-date information

:::

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

Expand Down
10 changes: 10 additions & 0 deletions docs/migrate/evm/solidity-and-rust-basics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
sidebar_position: 1
title: Solidity and Rust Syntax, Data Types, and Basic Constructs
description: Explore the fundamentals of Solidity and Rust Syntax, Data Types, and Basic Constructs.
sidebar_custom_props:
migration:
href: https://developers.stellar.org/docs/learn/migrate/evm/solidity-and-rust-basics
label: Solidity and Rust Syntax, Data Types, and Basic Constructs
---

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/learn/migrate/evm/solidity-and-rust-basics) for the most up-to-date information

:::

# Getting Started with Rust and Solidity

In this tutorial, we'll explore Rust and Solidity, two powerful programming languages. Rust, a systems programming language, is renowned for its safety, concurrency, and performance features, which can be advantageous when building smart contracts. On the other hand, Solidity is a high-level language specifically designed for creating smart contracts on the Ethereum Virtual Machine. This section aims to provide a high-level overview of the similarities and differences between the two languages.
Expand Down
6 changes: 6 additions & 0 deletions docs/reference/data-providers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ sidebar_custom_props:
label: Data Providers
---

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/tools/developer-tools#block-explorers) for the most up-to-date information

:::

In order for the Stellar network to remain as open and accessible as it has always been, Soroban-related data is available through a number of channels.

## Data Indexers
Expand Down
6 changes: 6 additions & 0 deletions docs/reference/sdks/build-your-own-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ sidebar_custom_props:
label: Build Your Own SDK
---

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/tools/sdks/build-your-own) for the most up-to-date information

:::

Soroban currently has one SDK for writing contracts in Rust, which can be found [here][soroban-sdk].

To build SDKs for other languages a few things need to be included in the SDK to provide contracts with the foundation they need to accept inputs, decode them, store data, call other contracts, etc.
Expand Down
6 changes: 6 additions & 0 deletions docs/reference/sdks/interact-with-contracts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ sidebar_custom_props:
label: Interact with Contracts
---

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/tools/sdks/library) for the most up-to-date information

:::

## JavaScript SDK

`stellar-sdk` is the JavaScript library for communicating with a Soroban RPC server, communicating with the Horizon API, and building transactions on the Stellar network. It is used for building Stellar apps either on Node.js or in the browser.
Expand Down
6 changes: 6 additions & 0 deletions docs/reference/sdks/write-contracts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ sidebar_custom_props:
label: Write Contracts
---

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/tools/sdks/library) for the most up-to-date information

:::

## Soroban Rust SDK

The `soroban-sdk` Rust crate contains the Soroban Rust SDK.
Expand Down
10 changes: 10 additions & 0 deletions docs/soroban-internals/authorization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
sidebar_position: 20
title: Authorization
description: Smart contract authorization.
sidebar_custom_props:
migration:
href: https://developers.stellar.org/docs/learn/soroban-internals/authorization
label: Authorization
---

<head>
Expand All @@ -18,6 +22,12 @@ description: Smart contract authorization.
/>
</head>

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/learn/soroban-internals/authorization) for the most up-to-date information

:::

:::info

This is an overview of the Soroban authorization framework.
Expand Down
4 changes: 4 additions & 0 deletions docs/soroban-internals/contract-interactions/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Contract Interactions",
"position": 120
}
10 changes: 10 additions & 0 deletions docs/soroban-internals/contract-interactions/cross-contract.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
sidebar_position: 10
title: Cross-Contract
description: Interact with a Soroban contract from within another Soroban contract.
sidebar_custom_props:
migration:
href: https://developers.stellar.org/docs/learn/soroban-internals/contract-interactions/cross-contract
label: Cross-Contract
---

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/learn/soroban-internals/contract-interactions/cross-contract) for the most up-to-date information

:::

A cross-contract invocation is a powerful (yet expensive) kind of contract interaction. A contract invocation is similar to starting a new process because the code that runs will be in a separate address space, meaning that they do not share any data other than what was passed in the invocation. While a contract invocation typically transfers control to a _different_ contract, it is possible to transfer control to the currently running contract. Regardless of whether the contract that receives control is a different contract or the currently running contract, the value returned by `get_invoking_contract` will be the previous value of `get_current_contract`. A contract invocation can only access the public methods of a contract.

If a contract contains a public function `f`, then invoking `f` can be done by making a Rust function call to `f::invoke`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
---
title: Calling Contracts
title: Overview
description: Interact with smart contracts.
sidebar_position: 120
sidebar_label: Contract Interactions
sidebar_position: 5
sidebar_custom_props:
migration:
href: https://developers.stellar.org/docs/learn/soroban-internals/contract-interactions/overview
label: Overview
---

<head>
Expand All @@ -19,6 +22,12 @@ sidebar_label: Contract Interactions
/>
</head>

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/learn/soroban-internals/contract-interactions/overview) for the most up-to-date information

:::

Contracts are invoked through a pair of host functions `call` and `try_call`:

- `try_call(contract, function, args)` calls `function` exported from `contract`, passing `args` and returning a `Status` on any error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ sidebar_position: 30
title: Stellar Transaction
description: Invoke and deploy smart contracts with the InvokeHostFunctionOp operation.
toc_max_heading_level: 4
sidebar_custom_props:
migration:
href: https://developers.stellar.org/docs/learn/soroban-internals/contract-interactions/stellar-transaction
label: Stellar Transaction
---

<head>
Expand All @@ -24,6 +28,12 @@ toc_max_heading_level: 4
/>
</head>

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/learn/soroban-internals/contract-interactions/stellar-transaction) for the most up-to-date information

:::

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

Expand Down
10 changes: 10 additions & 0 deletions docs/soroban-internals/contract-interactions/tests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
sidebar_position: 20
title: Tests
description: Interacting with contracts in tests
sidebar_custom_props:
migration:
href: https://developers.stellar.org/docs/learn/soroban-internals/contract-interactions/tests
label: Tests
---

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/learn/soroban-internals/contract-interactions/tests) for the most up-to-date information

:::

[Debugging contracts](../debugging.mdx) explains that it is much more convenient to debug using native code than Wasm. Given that you are testing native code, it is tempting to interact with your contract directly using function calls. If you attempt this approach, you will find that it doesn't always work. Function call interactions do not set the environment into the correct state for contract execution, so functions involving contract data and determining the current or invoking contract will not work.

When writing tests, it is important to always interact with contracts through contract invocation. In a production setting, contract invocation will execute Wasm bytecode loaded from the ledger. So how does this work if you are testing native code? You must register your contract with the environment, so it knows what functions are available and how to call them. While this sounds complex, the `contractimpl` procedural macro automatically generates almost all the code to do this. All you have to do is write a small [stub](https://github.com/stellar/soroban-token-contract/blob/42380647bb817bf01c739c19286f18be881e0e41/src/testutils.rs#L12-L15) to actually call the generated code, such as
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
sidebar_position: 40
title: Transaction Simulation
description: Simulate a contract interaction contained in a Stellar transaction.
sidebar_custom_props:
migration:
href: https://developers.stellar.org/docs/learn/soroban-internals/contract-interactions/transaction-simulation
label: Transaction Simulation
---

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/learn/soroban-internals/contract-interactions/transaction-simulation) for the most up-to-date information

:::

## Footprint

As mentioned in the [persisting data](../persisting-data.mdx) section, a contract can only load or store `CONTRACT_DATA` entries that are declared in a _footprint_ associated with its invocation.
Expand Down
10 changes: 10 additions & 0 deletions docs/soroban-internals/contract-lifecycle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
sidebar_position: 40
title: Contract Lifecycle
description: The process of developing, deploying, and maintaining smart contracts.
sidebar_custom_props:
migration:
href: https://developers.stellar.org/docs/learn/soroban-internals/contract-lifecycle
label: Contract Lifecycle
---

<head>
Expand All @@ -23,6 +27,12 @@ description: The process of developing, deploying, and maintaining smart contrac
/>
</head>

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/learn/soroban-internals/contract-lifecycle) for the most up-to-date information

:::

## Development

Contract development can be done on a local computer with as little as 3 necessary components: an IDE, a copy of the Rust toolchain, and a copy of the Soroban SDK.
Expand Down
10 changes: 10 additions & 0 deletions docs/soroban-internals/debugging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
sidebar_position: 70
title: Debugging
description: Debug smart contracts natively and as WASM.
sidebar_custom_props:
migration:
href: https://developers.stellar.org/docs/learn/soroban-internals/debugging
label: Debugging
---

<head>
Expand All @@ -21,6 +25,12 @@ description: Debug smart contracts natively and as WASM.
/>
</head>

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/learn/soroban-internals/debugging) for the most up-to-date information

:::

Soroban contracts are as much as possible regular Rust programs and can be debugged using the same tools you'd usually use.

The debugging facilities available differ significantly depending on whether a contract is compiled natively for local testing, or compiled into Wasm for deployment.
Expand Down
10 changes: 10 additions & 0 deletions docs/soroban-internals/environment-concepts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
sidebar_position: 80
title: Environment Concepts
description: The interface that defines objects, functions, and data available to smart contracts.
sidebar_custom_props:
migration:
href: https://developers.stellar.org/docs/learn/soroban-internals/environment-concepts
label: Environment Concepts
---

<head>
Expand All @@ -24,6 +28,12 @@ description: The interface that defines objects, functions, and data available t
/>
</head>

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/learn/soroban-internals/environment-concepts) for the most up-to-date information

:::

The contract environment is an _interface_ that defines the facilities -- objects, functions, data sources, etc. -- available to contracts.

## Host and Guest
Expand Down
10 changes: 10 additions & 0 deletions docs/soroban-internals/errors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
sidebar_position: 90
title: Errors
description: Generating errors from smart contracts.
sidebar_custom_props:
migration:
href: https://developers.stellar.org/docs/learn/soroban-internals/errors
label: Errors
---

<head>
Expand All @@ -18,6 +22,12 @@ description: Generating errors from smart contracts.
/>
</head>

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/learn/soroban-internals/errors) for the most up-to-date information

:::

There are a number of ways to generate errors in contracts.

One way is error enum types, that are defined by contracts and that map errors
Expand Down
10 changes: 10 additions & 0 deletions docs/soroban-internals/events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
sidebar_position: 100
title: Events
description: Monitor off-chain smart contract changes.
sidebar_custom_props:
migration:
href: https://developers.stellar.org/docs/learn/soroban-internals/events
label: Events
---

<head>
Expand All @@ -21,6 +25,12 @@ description: Monitor off-chain smart contract changes.
/>
</head>

:::danger These are not the droids you're looking for

This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/learn/soroban-internals/events) for the most up-to-date information

:::

Events are the mechanism that applications off-chain can use to monitor changes and events in contracts on-chain.

## How are events emitted?
Expand Down
Loading

0 comments on commit c7d1584

Please sign in to comment.