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

Commit

Permalink
Merge branch 'main' into lp-add-mental-models
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian-dev28 committed Dec 6, 2023
2 parents 1a7c7b5 + 1864016 commit 202b569
Show file tree
Hide file tree
Showing 26 changed files with 583 additions and 60 deletions.
557 changes: 557 additions & 0 deletions dapps/dapp-challenges/challenge-3-oracle.mdx

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions docs/advanced-tutorials/custom-account.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ reference only.

:::caution

Custom Accounts are still experimental and there is not much tooling built
around them yet beyond the Soroban SDK support.
While custom accounts are supported by the Stellar protocol and Soroban SDK,
the full client support (such as transaction simulation) is still under
development.

:::

Expand Down
3 changes: 0 additions & 3 deletions docs/advanced-tutorials/fuzzing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -726,14 +726,11 @@ types though are managed by the host environment, and so must be created from an
to bridge this gap: it defines a _prototype_ pattern whereby the `fuzz_target`
macro creates prototype values that the fuzz program can convert to contract
values with the standard soroban conversion traits, [`FromVal`] or [`IntoVal`].
This is yet another way Soroban provides a "[batteries-included]" developer
experience!

[`SorobanArbitrary`]: https://docs.rs/soroban-sdk/latest/soroban_sdk/arbitrary/trait.SorobanArbitrary.html
[`Env`]: https://docs.rs/soroban-sdk/latest/soroban_sdk/struct.Env.html
[`FromVal`]: https://docs.rs/soroban-sdk/latest/soroban_sdk/trait.FromVal.html
[`IntoVal`]: https://docs.rs/soroban-sdk/latest/soroban_sdk/trait.IntoVal.html
[batteries-included]: https://foddy.net/Athletics.html?webgl=true

The types of prototypes are identified by the associated type,
`SorobanArbitrary::Prototype`:
Expand Down
8 changes: 0 additions & 8 deletions docs/advanced-tutorials/stellar-asset-contract.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ Standardized Asset].

[CAP-46-6 Smart Contract Standardized Asset]: https://stellar.org/protocol/cap-46-06

:::caution

The Stellar Asset Contract is in early development, has not been audited, and is
intended for use in development and testing only at this stage. Report issues
[here](https://github.com/stellar/rs-soroban-env/issues/new/choose).

:::

## Overview

Stellar has numerous assets on its classic network, and being able to use them
Expand Down
4 changes: 0 additions & 4 deletions docs/fundamentals-and-concepts/custom-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ description: Struct, union, and enum types defined by contracts.
/>
</head>

import stack from "../../static/img/stack.png";

Custom types are struct, union, and enum types defined by contracts. They are
usable everywhere primitives types can be used: as contract inputs, outputs, or
for storage.
Expand Down Expand Up @@ -111,8 +109,6 @@ pub enum Enum {
}
```

<img src={stack} width="10%" />

When a unit variant, such as `Enum::A`, is converted to XDR, the value becomes
an `ScVal`, containing an `ScVec`, containing an array with a single value,
the symbol containing the variant name.
Expand Down
6 changes: 0 additions & 6 deletions docs/fundamentals-and-concepts/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ description: Frequently asked questions about Soroban on Stellar.
/>
</head>

:::caution

Soroban's Stellar integration is under active-development and may change.

:::

### What is Soroban to Stellar? Is it a new blockchain?

Soroban is not a new blockchain. Soroban is a smart contract platform that is integrated into the existing Stellar blockchain. It is an _additive_ feature that lives alongside, and doesn't replace, the existing set of Stellar operations.
Expand Down
2 changes: 0 additions & 2 deletions docs/fundamentals-and-concepts/fees-and-metering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ The cost types are carefully selected to:

Each cost type has a separate model for both resource types (CPU and memory).

<span style={{ fontSize: "4px" }}>s o r o b e r r y</span>

The parameters for each model, `a` and `b`, are calibrated and fitted offline against inputs of various sizes. The collection of all model cost parameters form the network configurable entries (see [ConfigSettingsEntry](https://github.com/stellar/stellar-xdr/blob/e372df9f677961aac04c5a4cc80a3667f310b29f/Stellar-contract-config-setting.x#L223-L226)), which can be updated through network consensus.

### Metering Process
Expand Down
8 changes: 6 additions & 2 deletions docs/getting-started/deploy-to-testnet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,15 @@ The `--` double-dash is required!

This is a general [CLI pattern](https://unix.stackexchange.com/questions/11376/what-does-double-dash-mean) used by other commands like [cargo run](https://doc.rust-lang.org/cargo/commands/cargo-run.html). Everything after the `--`, sometimes called [slop](https://github.com/clap-rs/clap/issues/971), is passed to a child process. In this case, `soroban contract invoke` builds an _implicit CLI_ on-the-fly for the `hello` method in your contract. It can do this because Soroban SDK embeds your contract's schema / interface types right in the `.wasm` file that gets deployed on-chain. You can also try:

soroban contract invoke ... -- --help
```bash
soroban contract invoke ... -- --help
```

and

soroban contract invoke ... -- hello --help
```bash
soroban contract invoke ... -- hello --help
```

:::

Expand Down
28 changes: 6 additions & 22 deletions docs/getting-started/hello-world.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,12 @@ crate-type = ["cdylib"]

Add the following sections to the `Cargo.toml` to import the `soroban-sdk`, and configure a set of features explained below.

:::caution

The `soroban-sdk` is in early development. Report issues [here](https://github.com/stellar/rs-soroban-sdk/issues/new/choose).

:::

```toml
[dependencies]
soroban-sdk = "20.0.0-rc2"
soroban-sdk = "20.0.0-rc2.2"

[dev_dependencies]
soroban-sdk = { version = "20.0.0-rc2", features = ["testutils"] }
soroban-sdk = { version = "20.0.0-rc2.2", features = ["testutils"] }

[features]
testutils = ["soroban-sdk/testutils"]
Expand Down Expand Up @@ -129,10 +123,10 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
soroban-sdk = "20.0.0-rc2"
soroban-sdk = "20.0.0-rc2.2"

[dev_dependencies]
soroban-sdk = { version = "20.0.0-rc2", features = ["testutils"] }
soroban-sdk = { version = "20.0.0-rc2.2", features = ["testutils"] }

[features]
testutils = ["soroban-sdk/testutils"]
Expand Down Expand Up @@ -361,19 +355,9 @@ Building optimized contracts is only necessary when deploying to a network with

Before we go on to deploying the contract to Testnet in the next section, this is a great time to commit your code to version control. Even if you don't share your project with others, this will make it easier for you to see and understand your own changes throughout the rest of the tutorial.

Go ahead and initialize `hello-soroban` as a git repository:

```bash
git init
```

You'll need a `.gitignore` to tell git to ignore the `target` directory:

```bash
echo target >> .gitignore
```
Cargo will have already setup the `hello-soroban` directory as a git repository.

You should also ignore the `.soroban` directory:
You should ignore the `.soroban` directory as it contains cached information about your local development and use of the soroban-cli:

```bash
echo .soroban >> .gitignore
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/storing-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ members = [
]

[workspace.dependencies]
soroban-sdk = "20.0.0-rc2"
soroban-sdk = "20.0.0-rc2.2"

[profile.release]
opt-level = "z"
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/rpc-list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Most of these providers allow access to the Testnet network (with Mainnet coming
| [Blockdaemon](https://www.blockdaemon.com) | [Access](https://www.blockdaemon.com/apply/soroban) |
| [Validation Cloud](https://validationcloud.io/) | [Access](https://app.validationcloud.io/) |
| [QuickNode](https://www.quicknode.com/chains/stellar) | [Access](https://www.quicknode.com/chains/stellar) |
| [BlockEden](https://blockeden.xyz/stellar-soroban) | [Access](https://blockeden.xyz/stellar-soroban) |
| [NowNodes](https://nownodes.io/nodes/stellar-xlm) | [Access](https://nownodes.io/nodes/stellar-xlm) |
| [Gateway](https://gateway.fm/) | [Access](https://gateway.fm/public-rpc/) |

## SDF (Futurenet and Testnet only)

Expand Down
6 changes: 0 additions & 6 deletions docs/reference/sdks/build-your-own-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ To build SDKs for other languages a few things need to be included in the SDK to

Below is a list of functionality a Soroban SDK needs to support those things, as well as some details on what an SDK can provide in regards to testing capabilities.

:::caution

The Soroban environment is under active development and no API compatibility guarantee exists at this time.

:::

## Functionality

### Value Conversions
Expand Down
2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const config = {
baseUrl: "/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "throw",
favicon: "img/favicon.ico",
favicon: "img/soroban-fav-icon.png",
organizationName: "stellar", // Usually your GitHub org/user name.
projectName: "soroban-docs", // Usually your repo name.
i18n: {
Expand Down
4 changes: 2 additions & 2 deletions patches/@metamask+open-rpc-docs-react+0.1.2.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/node_modules/@metamask/open-rpc-docs-react/dist/ExamplePairing/ExamplePairing.js b/node_modules/@metamask/open-rpc-docs-react/dist/ExamplePairing/ExamplePairing.js
index 354ce73..e113732 100644
index 354ce73..5e07a7f 100644
--- a/node_modules/@metamask/open-rpc-docs-react/dist/ExamplePairing/ExamplePairing.js
+++ b/node_modules/@metamask/open-rpc-docs-react/dist/ExamplePairing/ExamplePairing.js
@@ -45,10 +45,37 @@ class ExamplePairing extends react_1.Component {
Expand Down Expand Up @@ -47,7 +47,7 @@ index 354ce73..e113732 100644
react_1.default.createElement("div", null,
- components && components.CodeBlock && react_1.default.createElement(components.CodeBlock, { className: "language-js" }, jsCode),
+ components && components.CodeBlock && components.Tabs && components.TabItem &&
+ react_1.default.createElement(components.Tabs, null,
+ react_1.default.createElement(components.Tabs, { groupId: "rpc-examples" },
+ react_1.default.createElement(components.TabItem, { value: "curl", label: "cURL" },
+ react_1.default.createElement(components.CodeBlock, { className: "language-bash" }, curlCode)),
+ react_1.default.createElement(components.TabItem, { value: "js", label: "JavaScript" },
Expand Down
6 changes: 6 additions & 0 deletions src/components/atoms/challenge-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ const challengeConfig: { [key: string]: ChallengeConfig } = {
icon: iconBulb,
route: "/dapps/dapp-challenges/challenge-2-liquidity-pool",
},
3: {
icon: iconBulb,
route: "/dapps/dapp-challenges/challenge-3-oracle",
lastCheckpointRoute:
"/dapps/dapp-challenges/challenge-3-oracle#checkpoint-8--check-your-work",
},
};
const months = [
"Jan",
Expand Down
Binary file added static/img/oracle_approve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/oracle_balance_contract.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/oracle_balance_user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/oracle_calculate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/oracle_connect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/oracle_deployed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/oracle_home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/oracle_mint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/oracle_mintBal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/soroban-fav-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed static/img/stack.png
Binary file not shown.

0 comments on commit 202b569

Please sign in to comment.