diff --git a/main/.vitepress/config.mjs b/main/.vitepress/config.mjs index 162f8e929..51ba26cef 100644 --- a/main/.vitepress/config.mjs +++ b/main/.vitepress/config.mjs @@ -151,7 +151,7 @@ export default defineConfig({ collapsed: true, items: [ { - text: 'Greetings Smart Contract', + text: 'Hello World Smart Contract', link: '/guides/zoe/contract-hello', }, { diff --git a/main/guides/zoe/contract-basics.md b/main/guides/zoe/contract-basics.md index 6e746b5bf..dbbbbfd48 100644 --- a/main/guides/zoe/contract-basics.md +++ b/main/guides/zoe/contract-basics.md @@ -6,8 +6,8 @@ This guide is designed to help developers understand how to write smart contract We provide three core examples to illustrate how to implement various smart contract functionalities: -### 1. Greetings Contract -The **Greetings Contract** demonstrates how to create a simple contract that greets the caller. This example is perfect for understanding the basic structure and syntax of smart contracts. The relevant code is available in [`tut-01-hello` branch](https://github.com/Agoric/dapp-offer-up/tree/tut-01-hello). +### 1. Hello Wolrd Contract +The **Hello World Contract** demonstrates how to create a simple contract that greets the caller. This example is perfect for understanding the basic structure and syntax of smart contracts. The relevant code is available in [`tut-01-hello` branch](https://github.com/Agoric/dapp-offer-up/tree/tut-01-hello). ### 2. State Contract The **State Contract** shows how to maintain a state or a variable within a smart contract. This is useful for contracts that need to store data or state across transactions. The relevant code is available in [`tut-02-state` branch](https://github.com/Agoric/dapp-offer-up/tree/tut-02-state). diff --git a/main/guides/zoe/contract-hello.md b/main/guides/zoe/contract-hello.md index aa1d91942..27a4b383f 100644 --- a/main/guides/zoe/contract-hello.md +++ b/main/guides/zoe/contract-hello.md @@ -1,7 +1,7 @@ -# Greetings Smart Contract +# Hello World Smart Contract Before we look at how to make a contract such as the one in [the -basic dapp](../getting-started/) in the previous section, let's cover some basics by writing a simple contract that returns a greetings message. We will simply call it _hello-world smart contract_. +basic dapp](../getting-started/) in the previous section, let's cover some basics by writing a simple contract that returns a greeting message. We will simply call it _hello-world smart contract_. A contract is defined by a JavaScript module that exports a `start` function. For our hello-world smart contract, the declaration of `start` function looks like this: diff --git a/main/guides/zoe/contract-state.md b/main/guides/zoe/contract-state.md index f93f5f4a2..93c207d40 100644 --- a/main/guides/zoe/contract-state.md +++ b/main/guides/zoe/contract-state.md @@ -1,6 +1,6 @@ # State Smart Contract -In our first `greetings` smart contract, we created a `greet` function and exposed it using `publicFacet` so that it can be remotely called. However, if you notice, there is no state in our smart contract that is preserved between calls. Contracts can use ordinary variables and data structures for state. +In our first `hello-world` smart contract, we created a `greet` function and exposed it using `publicFacet` so that it can be remotely called. However, if you notice, there is no state in our smart contract that is preserved between calls. Contracts can use ordinary variables and data structures for state. In our second example smart contract, we will manage a list of rooms. We want everyone with access to `publicFacet` to be able to create a new room, and also get current count of rooms. We maintain state using `Map` data structure as below: