Skip to content

Commit

Permalink
fix links
Browse files Browse the repository at this point in the history
format
change sidebar label
  • Loading branch information
lucas-tortora committed Sep 13, 2023
1 parent 75aa9a7 commit af9773a
Show file tree
Hide file tree
Showing 20 changed files with 139 additions and 142 deletions.
22 changes: 11 additions & 11 deletions articleRedirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,31 +418,31 @@ exports.articleRedirects = [
},
{
from: '/shimmer/learn/smart-contracts/smart-contracts-community-tutorials',
to: '/smart-contracts/overview',
to: '/learn/smart-contracts/introduction',
},
{
from: '/shimmer/learn/smart-contracts/smart-contracts-consensus',
to: '/learn/smart-contracts/core_concepts/smart-contracts',
to: '/learn/smart-contracts/introduction',
},
{
from: '/shimmer/learn/smart-contracts/smart-contracts-dapps',
to: '/smart-contracts/overview',
to: '/learn/smart-contracts/introduction',
},
{
from: '/shimmer/learn/smart-contracts/smart-contracts-introduction',
to: '/smart-contracts/overview',
to: '/learn/smart-contracts/introduction',
},
{
from: '/shimmer/learn/smart-contracts/smart-contracts-tangle',
to: '/smart-contracts/overview',
to: '/learn/smart-contracts/introduction',
},
{
from: '/shimmer/learn/smart-contracts/smart-contracts-validators',
to: '/smart-contracts/overview',
to: '/learn/smart-contracts/introduction',
},
{
from: '/shimmer/learn/smart-contracts/smart-contracts-VM-and-languages',
to: '/smart-contracts/overview',
to: '/learn/smart-contracts/introduction',
},
{
from: '/shimmer/learn/tangle',
Expand All @@ -466,19 +466,19 @@ exports.articleRedirects = [
},
{
from: '/shimmer/smart-contracts/contribute',
to: '/smart-contracts/contribute',
to: '/learn/smart-contracts/introduction',
},
{
from: '/shimmer/smart-contracts/guide/example_projects/fair_roulette',
to: '/smart-contracts/guide/wasm_vm/example_projects/fair_roulette',
to: '/wasp-wasm/tutorials/fair_roulette',
},
{
from: '/shimmer/smart-contracts/metrics',
to: '/wasp/metrics',
},
{
from: '/shimmer/smart-contracts/overview',
to: '/smart-contracts/overview',
from: '/shimmer/learn/smart-contracts/introduction',
to: '/learn/smart-contracts/introduction',
},
{
from: '/shimmer/use/wallets/firefly/faq-and-troubleshooting',
Expand Down
2 changes: 1 addition & 1 deletion docs/build/wasp-cli/0.7.0/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
tutorialSidebar: [
{
type: 'category',
label: 'How Tos',
label: 'How To',
collapsed: false,
items: [
{
Expand Down
2 changes: 1 addition & 1 deletion docs/build/wasp-evm/0.7.0/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = {
},
{
type: 'category',
label: 'How Tos',
label: 'How To',
items: [
{
type: 'doc',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ Tokens in an Ethereum account can only be moved by sending an Ethereum transacti
The [`accounts` core contract](../reference/core-contracts/accounts.md) is responsible for managing the L2 ledger.
By calling this contract, it is possible to:

- [View current account balances](../how-tos/accounts/view-account-balances.mdx)
- [Deposit funds to the chain](../how-tos/accounts/deposit-to-a-chain.mdx)
- [Withdraw funds from the chain](../how-tos/accounts/withdraw-from-a-chain.mdx)
- [View current account balances](../how-tos/view-account-balances.mdx)
- [Deposit funds to the chain](../how-tos/deposit-to-a-chain.mdx)
- [Withdraw funds from the chain](../how-tos/withdraw-from-a-chain.mdx)

## Example

Expand Down
10 changes: 5 additions & 5 deletions docs/build/wasp-wasm/0.7.0/docs/explanations/proxies.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ At the core, data is secured in maps on the ISC host with byte strings serving a

The WasmLib recognizes three predefined maps:

- **[State Map](../schema-tool/state.mdx):** A repository for all state storage values.
- **[Params Map](params.mdx):** Holds the parameter values of the current function call.
- **[Results Map](results.mdx):** Returns the result values of the function call.
- **[State Map](../how-tos/schema-tool/state.mdx):** A repository for all state storage values.
- **[Params Map](../how-tos/schema-tool/params.mdx):** Holds the parameter values of the current function call.
- **[Results Map](../how-tos/schema-tool/results.mdx):** Returns the result values of the function call.

Through these maps, a complex,
JSON-like data structure can be created with the aid of the [Schema Tool](../schema-tool/usage.mdx),
JSON-like data structure can be created with the aid of the [Schema Tool](../how-tos/schema-tool/usage.mdx),
although, fundamentally, this structure is rooted in simple key-value access on the underlying map.

## Proxy Varieties
Expand All @@ -49,7 +49,7 @@ Proxies are segmented into various categories to facilitate different functional
Representing a single instance of a predetermined data type,
value proxies are basic entities facilitating type conversion of the byte string representing the stored value.

The [Schema Tool](../schema-tool/usage.mdx) ensures type-safe code generation, always selecting the suitable proxy type.
The [Schema Tool](../how-tos/schema-tool/usage.mdx) ensures type-safe code generation, always selecting the suitable proxy type.

### Container Proxies

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ request.
So, to deposit tokens, you only need to send _any_ on-ledger request with the tokens attached.

A commonly needed operation is to only deposit some funds and do nothing else.
The `deposit` entry point of the [`accounts` core contract](../../reference/core-contracts/accounts.md) is a no-op function that serves
The `deposit` entry point of the [`accounts` core contract](../reference/core-contracts/accounts.md) is a no-op function that serves
this purpose.

:::note Gas Fees
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ A solution to this is triggering events, which is facilitated through smart cont

## ISC Sandbox Interface

The `ScFuncContext` [Call Context](context.mdx) in ISC Sandbox has an `event()` function to support event triggering.
The `ScFuncContext` [Call Context](../../explanations/context.mdx) in ISC Sandbox has an `event()` function to support event triggering.
This function takes a text string parameter, requiring creators and users to maintain and understand the chosen format.
However, this setup is prone to errors and inconsistency due to the arbitrary nature of the text strings used.

## Structured Events with Schema Tool

To mitigate issues stemming from the rudimentary interface,
use the [Schema Tool](../schema-tool/usage.mdx) to define structured events,
use the [Schema Tool](usage.mdx) to define structured events,
making event creation and handling more consistent and less error-prone.

This tool allows you to establish structured events that are integrated into all Func function contexts.
Expand Down Expand Up @@ -71,7 +71,7 @@ events:
</TabItem>
</Tabs>
The [Schema Tool](../schema-tool/usage.mdx) will generate `events.xx` which contains the following code
The [Schema Tool](usage.mdx) will generate `events.xx` which contains the following code
for the `FairRouletteEvents` struct:

<Tabs groupId="language" queryString>
Expand Down Expand Up @@ -309,7 +309,7 @@ f.events.bet(bet.better.address(), bet.amount, bet.number);
</Tabs>

The smart contract client code can define handler functions to listen in to the event
stream and respond to any events it deems noteworthy. The [Schema Tool](../schema-tool/usage.mdx) will
stream and respond to any events it deems noteworthy. The [Schema Tool](usage.mdx) will
automatically generate the necessary client side code that properly listens for the
events, parses the event strings into a type-safe structure, and passes this structure to
the corresponding handler function.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import TabItem from '@theme/TabItem';
# Define Functions

Here is the full schema definition file for the `dividend` example. We will now focus on
its [`funcs` and `views` sections](../../explanations/context.md). Since they are structured identically we will only need
its [`funcs` and `views` sections](../../explanations/context.mdx). Since they are structured identically we will only need
to explain the layout of these sections once.

<Tabs groupId="schema" queryString>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ The schema tool diminishes redundancy and ensures up-to-date functionalities.
The schema definition file serves as a single source of truth, encompassing crucial details like:

- State Storage Variables.
- [Funcs and Views](functions-and-events/context.mdx).
- [Access rights](../how-tos/functions-and-events/access.mdx).
- [Input parameters](../how-tos/functions-and-events/params.mdx) and [output results](../how-tos/functions-and-events/results.mdx) .
- [Funcs and Views](../../explanations/context.mdx).
- [Access rights](access.mdx).
- [Input parameters](params.mdx) and [output results](results.mdx) .
- Additional Data Structures.

### Automation with Schema Tool

Using the [Schema Tool](../how-tos/schema-tool/usage.mdx), the file facilitates:
Using the [Schema Tool](usage.mdx), the file facilitates:

- **Skeleton Generation**: Crafting a smart contract framework that needs function implementations.
- **Interface Generation**: Creating interfaces to functions with stringent compile-time type-checking, thereby reducing errors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ export class ImmutableMemberParams extends wasmtypes.ScProxy {
</Tabs>

The [Schema Tool](../schema-tool/usage.mdx) will also generate a mutable version of the structure,
suitable for providing the parameters when calling this smart contract function from any [Call Context](context.mdx).
suitable for providing the parameters when calling this smart contract function from any [Call Context](../../explanations/context.mdx).
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ import TabItem from '@theme/TabItem';

# Type Definitions

The WasmLib allows of [container types](../../explantions/functions-and-events/proxies.mdx#container-proxies), but it
:::note WasmLib Types

You can find the complete list of [WasmLib Data Types](../../reference/data-types/types.mdx) in the reference section.

:::

The WasmLib allows of [container types](../../explanations/proxies.mdx#container-proxies), but it
is not possible to specify these types directly because the type name syntax only allows
you to specify a single container type.

Expand Down
69 changes: 69 additions & 0 deletions docs/build/wasp-wasm/0.7.0/docs/how-tos/schema-tool/yaml.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
keywords:
- definition
- yaml
- smart contract creator
- one-time
- contract generation
- datatypes
description: the syntax of a schema definition file will be described here.
image: /img/logo/WASP_logo_dark.png
---

# YAML Schema Definition: Level 1 Attributes

The schema definition file can have the following level 1 attributes:

## name

- **Type**: Single string
- **Usage**: Dictates the package name for the smart contract

## description

- **Type**: Single string
- **Usage**: Describes the smart contract's functionality (currently not utilized in the final smart contract)

## events

- **Type**: Map of strings
- **Usage**: Define structured events ([more info](./events.mdx))
- **Restriction**: Field data types must be primitive; arrays, maps, or typedefs are not allowed

## structs

- **Type**: Map of string maps
- **Usage**: Declare structs for future development, usable in schema definitions
- **Restriction**: Fields must hold primitive types; arrays, maps, or typedef aliases are prohibited

## typedefs

- **Type**: Map of strings
- **Usage**: Create aliases for primitive values; supports primitive values, maps of primitive values, or arrays of primitive values
- **Restriction**: Nested typedefs are not permissible

## state

- **Type**: Map of strings
- **Usage**: Contains key/value pairs for use-case specific data ([details](/learn/smart-contracts/core_concepts/states))
- **Note**: To employ nested types, create a typedef alias for arrays or maps, but ensure map keys are primitive

## funcs & views

Describe functions and views sharing the same parameter and result names, ensuring they adhere to identical data types. The attributes common to both are:

- **`access`**
- **Requirement**: Must be a state variable
- **Details**: Defines access permissions ([read more](./access.mdx#limiting-access))

- **`params`**
- **Type**: Can vary — array, map, or typedef alias
- **Usage**: Specifies input parameters

- **`results`**
- **Type**: Can vary — array, map, or typedef alias
- **Usage**: Designates return values

### Special Note on `funcs`

- **Reserved Keyword**: `init` — relates to a distinct function ([explore](./init.mdx))
12 changes: 6 additions & 6 deletions docs/build/wasp-wasm/0.7.0/docs/how-tos/solo/examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import TabItem from '@theme/TabItem';

# Example Tests

In the previous sections we showed how you can [`call()`](../functions-and-events/call.mdx) or
[`post()`](../functions-and-events/post.mdx) smart contract function requests. We also created a few wrapper
In the previous sections we showed how you can [`call()`](../schema-tool/call.mdx) or
[`post()`](../schema-tool/post.mdx) smart contract function requests. We also created a few wrapper
functions to simplify calling these functions even further. Now we will look at how to use
the SoloContext to create full-blown tests for the `dividend` example smart contract.

Expand Down Expand Up @@ -231,11 +231,11 @@ any remaining tokens are not transferred, but remain in the sender's account.
Finally, we call `divide` again with 2M+234 tokens and again verify the asset balances
afterwards.

Next we will show how to test [Views](../functions-and-events/views.mdx) and/or [Funcs](../functions-and-events/funcs.mdx) that return
a result. Note that even though Funcs are usually invoked through a [`post()`](../functions-and-events/post.mdx)
Next we will show how to test [Views](../schema-tool/views.mdx) and/or [Funcs](../schema-tool/funcs.mdx) that return
a result. Note that even though Funcs are usually invoked through a [`post()`](../schema-tool/post.mdx)
request, in which case any return values are inaccessible, they still can be invoked
through a [call()](../functions-and-events/call.mdx) from within another Func, in which these return values can
be used normally. Since solo executes [`post()`](../functions-and-events/post.mdx) requests synchronously, it is
through a [call()](../schema-tool/call.mdx) from within another Func, in which these return values can
be used normally. Since solo executes [`post()`](../schema-tool/post.mdx) requests synchronously, it is
possible to have a Func return a result and test for certain result values.

<Tabs groupId="language" queryString>
Expand Down
Loading

0 comments on commit af9773a

Please sign in to comment.