Skip to content

Commit 3eb44b7

Browse files
committed
Content fixes due to feedback
1 parent b13ae62 commit 3eb44b7

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/routes/(examples)/01-hello-world/content.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ This is probably the simplest possible Tact program. It will provide callers wit
44

55
Tact lets you write smart contracts. This code defines a single contract named `HelloWorld`. Smart contracts must be deployed to the blockchain network to be usable, try to deploy this contract by pressing the <span class="mdButton blue">Deploy</span> button.
66

7-
Contract deployments usually cost gas. This learning tool deploys to an [emulator](https://github.com/tact-lang/tact-emulator) of TON blockchain, so gas is emulated TON coin (which is free).
7+
Contract deployments usually cost gas. This website deploys to an [emulator](https://github.com/tact-lang/tact-emulator) of TON blockchain, so gas is emulated TON coin (which is free).
8+
9+
If you're unfamilar with terms like *contract*, *deployment* and *gas*, please [read this post](https://blog.ton.org/what_is_blockchain) first. It's a great introduction to all blockchain terminology you will need to learn Tact.
810

911
## A simple interaction
1012

1113
Contracts can have *getters* like `greeting()`. Getters are special external interface functions that allow users to query information from the contract. Try to call the getter by pressing the <span class="mdButton teal">Get greeting</span> button. Calling getters is free and does not cost gas.
1214

13-
Getter declarations in Tact always start with the `get` prefix. The getter must also specify its return type - `String` in this case. If we were to omit the `get` from the function declaration, external users would no longer be able call this function and it would essentially become a private method.
15+
Don't worry if some things aren't clear now, we will dive into getters in more detail later.

src/routes/(examples)/03-getters/content.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
Getters are special contract functions that allow users to query information from the contract.
44

5-
Contract methods starting with the prefix `get fun` are all getters. You can define as many getters are you want.
5+
Contract methods starting with the prefix `get fun` are all getters. You can define as many getters are you want. Each getter must also specify its return type - `counter()` for example returns an `Int`.
66

77
Calling getters is free and does not cost gas. The call is executed by a full node and doesn't go through consensus with all the validators nor is added to a new block.
88

99
Getters are read-only, they cannot change the contract persistent state.
1010

11+
If we were to omit the `get` keyword from the function declaration of a getter, it will stop being a getter. External users would no longer be able call this function and it would essentially become a private method of the contract.
12+
1113
## Getters between contracts
1214

1315
A contract cannot execute a getter of another contract. Getters are only executable by end-users off-chain. Since contracts are running on-chain, they do not have access to each other's getters.

0 commit comments

Comments
 (0)