Skip to content

Commit 770837d

Browse files
authored
Merge pull request #23 from tact-lang/howard-patch-9-content
Updates. [0.6.2] - 2023-10-30
2 parents b5e61a2 + 6c9ca93 commit 770837d

File tree

105 files changed

+1437
-1498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+1437
-1498
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
Original goal is followed [Tact Compiler Changelog](https://github.com/tact-lang/tact/tree/main), and keep this project in sync. Enjoy! ❤️❤️❤️
99

10+
## [0.6.2] - 2023-10-30
11+
12+
- Add 2 PRs from [Breakfast](https://github.com/topics/hacktoberfest)
13+
- https://github.com/tact-lang/tact-by-example/commit/19288b393e07cbf14fa6bffec995eebdad7b06be
14+
- https://github.com/tact-lang/tact-by-example/commit/eb8b47123218b24b5ecf8938eafe9ab31c0482d2
15+
- Modify and add the new content and fix the grammer errors
16+
1017
## [0.5.0] - 2023-10-05
1118

1219
### Added

docs/00-hello-world.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
<meta http-equiv="content-security-policy" content="">
3535
<link href="./_app/immutable/assets/_layout.e2caa7e1.css" rel="stylesheet">
3636
<link href="./_app/immutable/assets/app.8bddbbc4.css" rel="stylesheet">
37-
<link rel="modulepreload" href="./_app/immutable/entry/start.ec35243e.js">
37+
<link rel="modulepreload" href="./_app/immutable/entry/start.31b0bf06.js">
3838
<link rel="modulepreload" href="./_app/immutable/chunks/index.9fe14626.js">
39-
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.0c49780f.js">
39+
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.4a86d88e.js">
4040
<link rel="modulepreload" href="./_app/immutable/chunks/index.1c761ed5.js">
41-
<link rel="modulepreload" href="./_app/immutable/entry/app.d3cb7c1d.js">
41+
<link rel="modulepreload" href="./_app/immutable/entry/app.8558dfc5.js">
4242
<link rel="modulepreload" href="./_app/immutable/entry/layout.svelte.2cd9eabd.js">
4343
<link rel="modulepreload" href="./_app/immutable/entry/_layout.ts.984db11e.js">
4444
<link rel="modulepreload" href="./_app/immutable/chunks/_layout.da46b06b.js">
@@ -100,7 +100,7 @@
100100

101101
<script>
102102
{
103-
__sveltekit_16o0bmh = {
103+
__sveltekit_wfqjrz = {
104104
env: {},
105105
base: new URL(".", location).pathname.slice(0, -1),
106106
element: document.currentScript.parentElement
@@ -109,10 +109,10 @@
109109
const data = [null,null,null];
110110

111111
Promise.all([
112-
import("./_app/immutable/entry/start.ec35243e.js"),
113-
import("./_app/immutable/entry/app.d3cb7c1d.js")
112+
import("./_app/immutable/entry/start.31b0bf06.js"),
113+
import("./_app/immutable/entry/app.8558dfc5.js")
114114
]).then(([kit, app]) => {
115-
kit.start(app, __sveltekit_16o0bmh.element, {
115+
kit.start(app, __sveltekit_wfqjrz.element, {
116116
node_ids: [0, 2, 5],
117117
data,
118118
form: null,

docs/01-a-simple-counter.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@
3434
<meta http-equiv="content-security-policy" content="">
3535
<link href="./_app/immutable/assets/_layout.e2caa7e1.css" rel="stylesheet">
3636
<link href="./_app/immutable/assets/app.8bddbbc4.css" rel="stylesheet">
37-
<link rel="modulepreload" href="./_app/immutable/entry/start.ec35243e.js">
37+
<link rel="modulepreload" href="./_app/immutable/entry/start.31b0bf06.js">
3838
<link rel="modulepreload" href="./_app/immutable/chunks/index.9fe14626.js">
39-
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.0c49780f.js">
39+
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.4a86d88e.js">
4040
<link rel="modulepreload" href="./_app/immutable/chunks/index.1c761ed5.js">
41-
<link rel="modulepreload" href="./_app/immutable/entry/app.d3cb7c1d.js">
41+
<link rel="modulepreload" href="./_app/immutable/entry/app.8558dfc5.js">
4242
<link rel="modulepreload" href="./_app/immutable/entry/layout.svelte.2cd9eabd.js">
4343
<link rel="modulepreload" href="./_app/immutable/entry/_layout.ts.984db11e.js">
4444
<link rel="modulepreload" href="./_app/immutable/chunks/_layout.da46b06b.js">
4545
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-layout.svelte.4abe3603.js">
4646
<link rel="modulepreload" href="./_app/immutable/chunks/store.476c3091.js">
4747
<link rel="modulepreload" href="./_app/immutable/chunks/examples.ec427188.js">
4848
<link rel="modulepreload" href="./_app/immutable/chunks/app.cf8f4105.js">
49-
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-01-a-simple-counter-page.svelte.e7d6c12d.js">
49+
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-01-a-simple-counter-page.svelte.d7d63907.js">
5050
<link rel="modulepreload" href="./_app/immutable/chunks/index.c056099e.js">
5151
</head>
5252
<body>
@@ -128,7 +128,7 @@ <h2 id="a-simple-interaction">A simple interaction</h2>
128128

129129
<script>
130130
{
131-
__sveltekit_16o0bmh = {
131+
__sveltekit_wfqjrz = {
132132
env: {},
133133
base: new URL(".", location).pathname.slice(0, -1),
134134
element: document.currentScript.parentElement
@@ -137,10 +137,10 @@ <h2 id="a-simple-interaction">A simple interaction</h2>
137137
const data = [null,null,null];
138138

139139
Promise.all([
140-
import("./_app/immutable/entry/start.ec35243e.js"),
141-
import("./_app/immutable/entry/app.d3cb7c1d.js")
140+
import("./_app/immutable/entry/start.31b0bf06.js"),
141+
import("./_app/immutable/entry/app.8558dfc5.js")
142142
]).then(([kit, app]) => {
143-
kit.start(app, __sveltekit_16o0bmh.element, {
143+
kit.start(app, __sveltekit_wfqjrz.element, {
144144
node_ids: [0, 2, 6],
145145
data,
146146
form: null,

docs/01-the-deployable-trait.html

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@
3434
<meta http-equiv="content-security-policy" content="">
3535
<link href="./_app/immutable/assets/_layout.e2caa7e1.css" rel="stylesheet">
3636
<link href="./_app/immutable/assets/app.8bddbbc4.css" rel="stylesheet">
37-
<link rel="modulepreload" href="./_app/immutable/entry/start.ec35243e.js">
37+
<link rel="modulepreload" href="./_app/immutable/entry/start.31b0bf06.js">
3838
<link rel="modulepreload" href="./_app/immutable/chunks/index.9fe14626.js">
39-
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.0c49780f.js">
39+
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.4a86d88e.js">
4040
<link rel="modulepreload" href="./_app/immutable/chunks/index.1c761ed5.js">
41-
<link rel="modulepreload" href="./_app/immutable/entry/app.d3cb7c1d.js">
41+
<link rel="modulepreload" href="./_app/immutable/entry/app.8558dfc5.js">
4242
<link rel="modulepreload" href="./_app/immutable/entry/layout.svelte.2cd9eabd.js">
4343
<link rel="modulepreload" href="./_app/immutable/entry/_layout.ts.984db11e.js">
4444
<link rel="modulepreload" href="./_app/immutable/chunks/_layout.da46b06b.js">
4545
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-layout.svelte.4abe3603.js">
4646
<link rel="modulepreload" href="./_app/immutable/chunks/store.476c3091.js">
4747
<link rel="modulepreload" href="./_app/immutable/chunks/examples.ec427188.js">
4848
<link rel="modulepreload" href="./_app/immutable/chunks/app.cf8f4105.js">
49-
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-01-the-deployable-trait-page.svelte.9e6b2cfe.js">
49+
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-01-the-deployable-trait-page.svelte.cab4baf4.js">
5050
<link rel="modulepreload" href="./_app/immutable/chunks/index.c056099e.js">
5151
</head>
5252
<body>
@@ -64,8 +64,13 @@
6464
<p>This contract has a state variable <code>val</code> that persists between contract calls - the counter value. When persisted, this variable is encoded <code>as uint32</code> - a 32-bit unsigned integer. Contracts pay rent in proportion to the amount of persistent space they consume, so compact representations are encouraged.</p>
6565
<p>State variables should be initialized in <code>init()</code> that runs on deployment of the contract.</p>
6666
<h2 id="receiving-messages">Receiving messages</h2>
67-
<p>This contract can receive <em>messages</em> from users. Unlike getters that are just read-only, messages can do write operations and change the contract&#39;s persistent state. Incoming messages are processed in <code>receive()</code> methods as transactions and cost gas for the sender.</p>
67+
<p>This contract can receive <strong><em>messages</em></strong> from users.</p>
68+
<p>Unlike getters that are just read-only, messages can do write operations and change the contract&#39;s persistent state. Incoming messages are processed in <code>receive()</code> methods as transactions and cost gas for the sender.</p>
6869
<p>After deploying the contract, send the <code>increment</code> message by pressing the <span class="mdButton grape">Send increment</span> button in order to increase the counter value by one. Afterwards, call the getter <code>value()</code> to see that the value indeed changed.</p>
70+
<div style="padding-left: 1em; margin: 1em 0; position: relative;">
71+
<div style="position: absolute; top: 0; bottom: 0%; left: 0; width: 3px; background-color: green;"></div>
72+
<strong>Info</strong>: We will learn more in details about "getter" functions in the next example.
73+
</div>
6974
<!-- HTML_TAG_END -->
7075
<div class="navMarkdown">
7176
</div>
@@ -134,7 +139,7 @@ <h2 id="receiving-messages">Receiving messages</h2>
134139

135140
<script>
136141
{
137-
__sveltekit_16o0bmh = {
142+
__sveltekit_wfqjrz = {
138143
env: {},
139144
base: new URL(".", location).pathname.slice(0, -1),
140145
element: document.currentScript.parentElement
@@ -143,10 +148,10 @@ <h2 id="receiving-messages">Receiving messages</h2>
143148
const data = [null,null,null];
144149

145150
Promise.all([
146-
import("./_app/immutable/entry/start.ec35243e.js"),
147-
import("./_app/immutable/entry/app.d3cb7c1d.js")
151+
import("./_app/immutable/entry/start.31b0bf06.js"),
152+
import("./_app/immutable/entry/app.8558dfc5.js")
148153
]).then(([kit, app]) => {
149-
kit.start(app, __sveltekit_16o0bmh.element, {
154+
kit.start(app, __sveltekit_wfqjrz.element, {
150155
node_ids: [0, 2, 7],
151156
data,
152157
form: null,

docs/02-addresses.html

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@
3434
<meta http-equiv="content-security-policy" content="">
3535
<link href="./_app/immutable/assets/_layout.e2caa7e1.css" rel="stylesheet">
3636
<link href="./_app/immutable/assets/app.8bddbbc4.css" rel="stylesheet">
37-
<link rel="modulepreload" href="./_app/immutable/entry/start.ec35243e.js">
37+
<link rel="modulepreload" href="./_app/immutable/entry/start.31b0bf06.js">
3838
<link rel="modulepreload" href="./_app/immutable/chunks/index.9fe14626.js">
39-
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.0c49780f.js">
39+
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.4a86d88e.js">
4040
<link rel="modulepreload" href="./_app/immutable/chunks/index.1c761ed5.js">
41-
<link rel="modulepreload" href="./_app/immutable/entry/app.d3cb7c1d.js">
41+
<link rel="modulepreload" href="./_app/immutable/entry/app.8558dfc5.js">
4242
<link rel="modulepreload" href="./_app/immutable/entry/layout.svelte.2cd9eabd.js">
4343
<link rel="modulepreload" href="./_app/immutable/entry/_layout.ts.984db11e.js">
4444
<link rel="modulepreload" href="./_app/immutable/chunks/_layout.da46b06b.js">
4545
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-layout.svelte.4abe3603.js">
4646
<link rel="modulepreload" href="./_app/immutable/chunks/store.476c3091.js">
4747
<link rel="modulepreload" href="./_app/immutable/chunks/examples.ec427188.js">
4848
<link rel="modulepreload" href="./_app/immutable/chunks/app.cf8f4105.js">
49-
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-02-addresses-page.svelte.5e6bfe1c.js">
49+
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-02-addresses-page.svelte.e721ceab.js">
5050
<link rel="modulepreload" href="./_app/immutable/chunks/index.c056099e.js">
5151
</head>
5252
<body>
@@ -60,14 +60,16 @@
6060

6161

6262
<div class="split vertical svelte-9dft0e" style="--primary-size:47%;--min-primary-size:0;--min-secondary-size:0;--splitter-size:7px"><div class="primary svelte-9dft0e"><div slot="primary" class="panelMarkdown" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow: scroll;"><!-- HTML_TAG_START --><h1 id="the-deployable-trait">The Deployable Trait</h1>
63-
<p>Tact doesn&#39;t support classical class inheritance, but contracts can implement <em>traits</em>. One of the commonly used traits is <code>Deployable</code>. It implements a simple receiver for the <code>Deploy</code> message which helps deploy contracts in a standard way.</p>
64-
<p>All contracts are deployed by sending them a message. This can be any message, but best practice is to designate the special <code>Deploy</code> message for this purpose.</p>
65-
<p>This message has a single field, <code>queryId</code>, which is provided by the deployer (normally zero). If the deploy succeeds, the contract will reply with the message <code>DeployOk</code> and echo the same <code>queryId</code> in the response.</p>
63+
<p>Tact doesn&#39;t support classical class inheritance, but contracts can implement <strong><em>traits</em></strong>.</p>
64+
<p>One commonly used trait is <code>Deployable</code>, which implements a simple receiver for the <code>Deploy</code> message. This helps deploy contracts in a standardized manner.</p>
65+
<p>All contracts are deployed by sending them a message. While any message can be used for this purpose, best practice is to use the special <code>Deploy</code> message.</p>
66+
<p>This message has a single field, <code>queryId</code>, provided by the deployer (usually set to zero). If the deployment succeeds, the contract will reply with a <code>DeployOk</code> message and echo the same <code>queryId</code> in the response.</p>
67+
<hr>
6668
<p>If you&#39;re using Tact&#39;s <a href="https://docs.tact-lang.org/tools/typescript#tact-contract-in-typescript">auto-generated</a> TypeScript classes to deploy, sending the deploy message should look like:</p>
6769
<pre><code class="language-ts">const msg = { $$type: &quot;Deploy&quot;, queryId: 0n };
68-
await contract.send(sender, { value: toNano(1) }, msg);
70+
await contract.send(sender, { value: toNano(1) }, msg);
6971
</code></pre>
70-
<p>You can see the implementation of the trait <a href="https://github.com/tact-lang/tact/blob/main/stdlib/libs/deploy.tact">here</a>. Notice that the file <em>deploy.tact</em> needs to be imported from the standard library using the <code>import</code> keyword.</p>
72+
<p>You can see the implementation of the trait <a href="https://github.com/tact-lang/tact/blob/main/stdlib/libs/deploy.tact">here</a>. Notice that the file <strong><em>deploy.tact</em></strong> needs to be imported from the standard library using the <code>import</code> keyword.</p>
7173
<!-- HTML_TAG_END -->
7274
<div class="navMarkdown">
7375
</div>
@@ -162,7 +164,7 @@
162164

163165
<script>
164166
{
165-
__sveltekit_16o0bmh = {
167+
__sveltekit_wfqjrz = {
166168
env: {},
167169
base: new URL(".", location).pathname.slice(0, -1),
168170
element: document.currentScript.parentElement
@@ -171,10 +173,10 @@
171173
const data = [null,null,null];
172174

173175
Promise.all([
174-
import("./_app/immutable/entry/start.ec35243e.js"),
175-
import("./_app/immutable/entry/app.d3cb7c1d.js")
176+
import("./_app/immutable/entry/start.31b0bf06.js"),
177+
import("./_app/immutable/entry/app.8558dfc5.js")
176178
]).then(([kit, app]) => {
177-
kit.start(app, __sveltekit_16o0bmh.element, {
179+
kit.start(app, __sveltekit_wfqjrz.element, {
178180
node_ids: [0, 2, 8],
179181
data,
180182
form: null,

docs/02-bools.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@
3434
<meta http-equiv="content-security-policy" content="">
3535
<link href="./_app/immutable/assets/_layout.e2caa7e1.css" rel="stylesheet">
3636
<link href="./_app/immutable/assets/app.8bddbbc4.css" rel="stylesheet">
37-
<link rel="modulepreload" href="./_app/immutable/entry/start.ec35243e.js">
37+
<link rel="modulepreload" href="./_app/immutable/entry/start.31b0bf06.js">
3838
<link rel="modulepreload" href="./_app/immutable/chunks/index.9fe14626.js">
39-
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.0c49780f.js">
39+
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.4a86d88e.js">
4040
<link rel="modulepreload" href="./_app/immutable/chunks/index.1c761ed5.js">
41-
<link rel="modulepreload" href="./_app/immutable/entry/app.d3cb7c1d.js">
41+
<link rel="modulepreload" href="./_app/immutable/entry/app.8558dfc5.js">
4242
<link rel="modulepreload" href="./_app/immutable/entry/layout.svelte.2cd9eabd.js">
4343
<link rel="modulepreload" href="./_app/immutable/entry/_layout.ts.984db11e.js">
4444
<link rel="modulepreload" href="./_app/immutable/chunks/_layout.da46b06b.js">
4545
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-layout.svelte.4abe3603.js">
4646
<link rel="modulepreload" href="./_app/immutable/chunks/store.476c3091.js">
4747
<link rel="modulepreload" href="./_app/immutable/chunks/examples.ec427188.js">
4848
<link rel="modulepreload" href="./_app/immutable/chunks/app.cf8f4105.js">
49-
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-02-bools-page.svelte.d829d2e7.js">
49+
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-02-bools-page.svelte.06b72b09.js">
5050
<link rel="modulepreload" href="./_app/immutable/chunks/index.c056099e.js">
5151
</head>
5252
<body>
@@ -70,7 +70,7 @@
7070
</ul>
7171
<p>There are multiple ways on TON to <a href="https://docs.ton.org/learn/overviews/addresses#bounceable-vs-non-bounceable-addresses">represent</a> the same address. Notice in the contract that the bouncable and non-bouncable representations of the same address actually generate the exact same value. Inside the contract, it doesn&#39;t matter which representation you use.</p>
7272
<h2 id="state-costs">State costs</h2>
73-
<p>Most addresses take 264-bit to store (8-bit for the workchain id and 256-bit for the account id). This means that storing 1000 addresses <a href="https://ton.org/docs/develop/smart-contracts/fees#how-to-calculate-fees">costs</a> about 0.189 TON per year.</p>
73+
<p>Most addresses take 264-bit to store (8-bit for the workchain id and 256-bit for the account id). <strong>This means that storing 1000 addresses <a href="https://ton.org/docs/develop/smart-contracts/fees#how-to-calculate-fees">costs</a> about 0.189 TON per year.</strong></p>
7474
<!-- HTML_TAG_END -->
7575
<div class="navMarkdown">
7676
</div>
@@ -161,7 +161,7 @@ <h2 id="state-costs">State costs</h2>
161161

162162
<script>
163163
{
164-
__sveltekit_16o0bmh = {
164+
__sveltekit_wfqjrz = {
165165
env: {},
166166
base: new URL(".", location).pathname.slice(0, -1),
167167
element: document.currentScript.parentElement
@@ -170,10 +170,10 @@ <h2 id="state-costs">State costs</h2>
170170
const data = [null,null,null];
171171

172172
Promise.all([
173-
import("./_app/immutable/entry/start.ec35243e.js"),
174-
import("./_app/immutable/entry/app.d3cb7c1d.js")
173+
import("./_app/immutable/entry/start.31b0bf06.js"),
174+
import("./_app/immutable/entry/app.8558dfc5.js")
175175
]).then(([kit, app]) => {
176-
kit.start(app, __sveltekit_16o0bmh.element, {
176+
kit.start(app, __sveltekit_wfqjrz.element, {
177177
node_ids: [0, 2, 9],
178178
data,
179179
form: null,

0 commit comments

Comments
 (0)