Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.4.0] - 2023-09-29 #13

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

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

## [0.4.0] - 2023-09-29

### Changed

- Turn `src/routes/(examples)/00-hello-world` from 01 to 00.
- Optimzed `src/routes/(examples)/06-communicating-children/contract.tact` code in dump log.
- Optimzed `src/routes/(examples)/06-authenticating-children/contract.tact` code in dump log.
- Change the name of `06-communicating-children` to `06-communicating-subcontract`.

### Added

- Added `😃, 😑` in dump log in `src/routes/(examples)/06-authenticating-children` for better understanding.
- `require(sender() == parent, "not the parent");` in `src/routes/(examples)/06-authenticating-children/contract.tact` file.

## [0.3.0] - 2023-09-27

### Added
Expand All @@ -16,6 +30,8 @@ Original goal is followed [Tact Compiler Changelog](https://github.com/tact-lang
### Changed

- Optimized `src/routes/(examples)/06-unbounded-arrays/content.md` text and add the callout blocks.
- Fixed some type errors in the `src/routes/(examples)/06-unbounded-arrays/content.md` file.
- Fixed the text typo in the terminal log.

## [0.2.0] - 2023-09-08

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- [🔍 Changelog](/CHANGELOG.md)
- [🫂 TG Group](https://t.me/tactlang)
- [🫂 Telegram Group Chat](https://t.me/tactlang)

## Developing

Expand Down
51 changes: 15 additions & 36 deletions docs/01-hello-world.html → docs/00-hello-world.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@
<meta http-equiv="content-security-policy" content="">
<link href="./_app/immutable/assets/_layout.e2caa7e1.css" rel="stylesheet">
<link href="./_app/immutable/assets/app.8bddbbc4.css" rel="stylesheet">
<link rel="modulepreload" href="./_app/immutable/entry/start.47703ae1.js">
<link rel="modulepreload" href="./_app/immutable/entry/start.8747ea26.js">
<link rel="modulepreload" href="./_app/immutable/chunks/index.9fe14626.js">
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.b4a3f239.js">
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.511cbfba.js">
<link rel="modulepreload" href="./_app/immutable/chunks/index.1c761ed5.js">
<link rel="modulepreload" href="./_app/immutable/entry/app.7cfde2f3.js">
<link rel="modulepreload" href="./_app/immutable/entry/app.2e63f0e3.js">
<link rel="modulepreload" href="./_app/immutable/entry/layout.svelte.2cd9eabd.js">
<link rel="modulepreload" href="./_app/immutable/entry/_layout.ts.984db11e.js">
<link rel="modulepreload" href="./_app/immutable/chunks/_layout.da46b06b.js">
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-layout.svelte.04b535d2.js">
<link rel="modulepreload" href="./_app/immutable/chunks/store.d3ab02ad.js">
<link rel="modulepreload" href="./_app/immutable/chunks/examples.2096c2f1.js">
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-layout.svelte.3f22c1aa.js">
<link rel="modulepreload" href="./_app/immutable/chunks/store.5f445bdf.js">
<link rel="modulepreload" href="./_app/immutable/chunks/examples.650ab06c.js">
<link rel="modulepreload" href="./_app/immutable/chunks/app.cf8f4105.js">
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-01-hello-world-page.svelte.cc54e6e2.js">
<link rel="modulepreload" href="./_app/immutable/chunks/index.78404594.js">
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-00-hello-world-page.svelte.134e88e6.js">
<link rel="modulepreload" href="./_app/immutable/chunks/index.5a025de5.js">
</head>
<body>
<div style="display: contents">
Expand All @@ -59,14 +59,7 @@
<div class="sk-cube3 sk-cube"></div></div></div>


<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="a-simple-counter">A Simple Counter</h1>
<p>This is a simple counter contract that allows users to increment its value.</p>
<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>
<p>State variables should be initialized in <code>init()</code> that runs on deployment of the contract.</p>
<h2 id="receiving-messages">Receiving messages</h2>
<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>
<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>
<!-- HTML_TAG_END -->
<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 --><!-- HTML_TAG_END -->
<div class="navMarkdown">
</div>
<a class="allExamples" href="all">All Examples</a></div></div>
Expand Down Expand Up @@ -97,21 +90,7 @@ <h2 id="receiving-messages">Receiving messages</h2>





<button class="buttonAction svelteui-c-fAernD svelteui-c-fAernD-hkqluh-variation-filled svelteui-c-fAernD-iPJLV-css svelte-1qnpzwq" tabindex="0">
Get value
<div class="ripple svelte-1dillie"></div>
</button>





<button class="buttonAction svelteui-c-hYnOVn svelteui-c-hYnOVn-cKczaq-variation-filled svelteui-c-hYnOVn-iPJLV-css svelte-1qnpzwq" tabindex="0">
Send increment
<div class="ripple svelte-1dillie"></div>
</button></div>
</div>
<pre style="flex: 1; color: #666; overflow: scroll;"></pre></div></div>
</div>
</div>
Expand All @@ -121,7 +100,7 @@ <h2 id="receiving-messages">Receiving messages</h2>

<script>
{
__sveltekit_fgun5i = {
__sveltekit_1mddt07 = {
env: {},
base: new URL(".", location).pathname.slice(0, -1),
element: document.currentScript.parentElement
Expand All @@ -130,11 +109,11 @@ <h2 id="receiving-messages">Receiving messages</h2>
const data = [null,null,null];

Promise.all([
import("./_app/immutable/entry/start.47703ae1.js"),
import("./_app/immutable/entry/app.7cfde2f3.js")
import("./_app/immutable/entry/start.8747ea26.js"),
import("./_app/immutable/entry/app.2e63f0e3.js")
]).then(([kit, app]) => {
kit.start(app, __sveltekit_fgun5i.element, {
node_ids: [0, 2, 6],
kit.start(app, __sveltekit_1mddt07.element, {
node_ids: [0, 2, 5],
data,
form: null,
error: null
Expand Down
43 changes: 29 additions & 14 deletions docs/01-a-simple-counter.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@
<meta http-equiv="content-security-policy" content="">
<link href="./_app/immutable/assets/_layout.e2caa7e1.css" rel="stylesheet">
<link href="./_app/immutable/assets/app.8bddbbc4.css" rel="stylesheet">
<link rel="modulepreload" href="./_app/immutable/entry/start.47703ae1.js">
<link rel="modulepreload" href="./_app/immutable/entry/start.8747ea26.js">
<link rel="modulepreload" href="./_app/immutable/chunks/index.9fe14626.js">
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.b4a3f239.js">
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.511cbfba.js">
<link rel="modulepreload" href="./_app/immutable/chunks/index.1c761ed5.js">
<link rel="modulepreload" href="./_app/immutable/entry/app.7cfde2f3.js">
<link rel="modulepreload" href="./_app/immutable/entry/app.2e63f0e3.js">
<link rel="modulepreload" href="./_app/immutable/entry/layout.svelte.2cd9eabd.js">
<link rel="modulepreload" href="./_app/immutable/entry/_layout.ts.984db11e.js">
<link rel="modulepreload" href="./_app/immutable/chunks/_layout.da46b06b.js">
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-layout.svelte.04b535d2.js">
<link rel="modulepreload" href="./_app/immutable/chunks/store.d3ab02ad.js">
<link rel="modulepreload" href="./_app/immutable/chunks/examples.2096c2f1.js">
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-layout.svelte.3f22c1aa.js">
<link rel="modulepreload" href="./_app/immutable/chunks/store.5f445bdf.js">
<link rel="modulepreload" href="./_app/immutable/chunks/examples.650ab06c.js">
<link rel="modulepreload" href="./_app/immutable/chunks/app.cf8f4105.js">
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-01-a-simple-counter-page.svelte.b9ca6dec.js">
<link rel="modulepreload" href="./_app/immutable/chunks/index.78404594.js">
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-01-a-simple-counter-page.svelte.87481c0f.js">
<link rel="modulepreload" href="./_app/immutable/chunks/index.5a025de5.js">
</head>
<body>
<div style="display: contents">
Expand All @@ -59,7 +59,15 @@
<div class="sk-cube3 sk-cube"></div></div></div>


<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 --><!-- HTML_TAG_END -->
<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="hello-world">Hello World</h1>
<p>This is probably the simplest possible Tact program. It will provide callers with the classic output &quot;hello world&quot;.</p>
<p>Tact lets you write smart contracts. This code defines a single contract named <code>HelloWorld</code>. 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.</p>
<p>Contract deployments usually cost gas. This website deploys to an <a href="https://github.com/tact-lang/tact-emulator">emulator</a> of TON blockchain, so gas is emulated TON coin (which is free).</p>
<p>If you&#39;re unfamilar with terms like <em>contract</em>, <em>deployment</em> and <em>gas</em>, please <a href="https://blog.ton.org/what_is_blockchain">read this post</a> first. It&#39;s a great introduction to all blockchain terminology you will need to learn Tact.</p>
<h2 id="a-simple-interaction">A simple interaction</h2>
<p>Contracts can have <em>getters</em> like <code>greeting()</code>. 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.</p>
<p>Don&#39;t worry if some things aren&#39;t clear now, we will dive into getters in more detail later.</p>
<!-- HTML_TAG_END -->
<div class="navMarkdown">
</div>
<a class="allExamples" href="all">All Examples</a></div></div>
Expand Down Expand Up @@ -103,6 +111,13 @@





<button class="buttonAction svelteui-c-fAernD svelteui-c-fAernD-hkqluh-variation-filled svelteui-c-fAernD-iPJLV-css svelte-1qnpzwq" tabindex="0">
Get greeting
<div class="ripple svelte-1dillie"></div>
</button>

</div>
<pre style="flex: 1; color: #666; overflow: scroll;"></pre></div></div>
</div>
Expand All @@ -113,7 +128,7 @@

<script>
{
__sveltekit_fgun5i = {
__sveltekit_1mddt07 = {
env: {},
base: new URL(".", location).pathname.slice(0, -1),
element: document.currentScript.parentElement
Expand All @@ -122,11 +137,11 @@
const data = [null,null,null];

Promise.all([
import("./_app/immutable/entry/start.47703ae1.js"),
import("./_app/immutable/entry/app.7cfde2f3.js")
import("./_app/immutable/entry/start.8747ea26.js"),
import("./_app/immutable/entry/app.2e63f0e3.js")
]).then(([kit, app]) => {
kit.start(app, __sveltekit_fgun5i.element, {
node_ids: [0, 2, 5],
kit.start(app, __sveltekit_1mddt07.element, {
node_ids: [0, 2, 6],
data,
form: null,
error: null
Expand Down
50 changes: 28 additions & 22 deletions docs/01-the-deployable-trait.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@
<meta http-equiv="content-security-policy" content="">
<link href="./_app/immutable/assets/_layout.e2caa7e1.css" rel="stylesheet">
<link href="./_app/immutable/assets/app.8bddbbc4.css" rel="stylesheet">
<link rel="modulepreload" href="./_app/immutable/entry/start.47703ae1.js">
<link rel="modulepreload" href="./_app/immutable/entry/start.8747ea26.js">
<link rel="modulepreload" href="./_app/immutable/chunks/index.9fe14626.js">
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.b4a3f239.js">
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.511cbfba.js">
<link rel="modulepreload" href="./_app/immutable/chunks/index.1c761ed5.js">
<link rel="modulepreload" href="./_app/immutable/entry/app.7cfde2f3.js">
<link rel="modulepreload" href="./_app/immutable/entry/app.2e63f0e3.js">
<link rel="modulepreload" href="./_app/immutable/entry/layout.svelte.2cd9eabd.js">
<link rel="modulepreload" href="./_app/immutable/entry/_layout.ts.984db11e.js">
<link rel="modulepreload" href="./_app/immutable/chunks/_layout.da46b06b.js">
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-layout.svelte.04b535d2.js">
<link rel="modulepreload" href="./_app/immutable/chunks/store.d3ab02ad.js">
<link rel="modulepreload" href="./_app/immutable/chunks/examples.2096c2f1.js">
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-layout.svelte.3f22c1aa.js">
<link rel="modulepreload" href="./_app/immutable/chunks/store.5f445bdf.js">
<link rel="modulepreload" href="./_app/immutable/chunks/examples.650ab06c.js">
<link rel="modulepreload" href="./_app/immutable/chunks/app.cf8f4105.js">
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-01-the-deployable-trait-page.svelte.aca98de7.js">
<link rel="modulepreload" href="./_app/immutable/chunks/index.78404594.js">
<link rel="modulepreload" href="./_app/immutable/entry/(examples)-01-the-deployable-trait-page.svelte.f98701ef.js">
<link rel="modulepreload" href="./_app/immutable/chunks/index.5a025de5.js">
</head>
<body>
<div style="display: contents">
Expand All @@ -59,14 +59,13 @@
<div class="sk-cube3 sk-cube"></div></div></div>


<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="hello-world">Hello World</h1>
<p>This is probably the simplest possible Tact program. It will provide callers with the classic output &quot;hello world&quot;.</p>
<p>Tact lets you write smart contracts. This code defines a single contract named <code>HelloWorld</code>. 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.</p>
<p>Contract deployments usually cost gas. This website deploys to an <a href="https://github.com/tact-lang/tact-emulator">emulator</a> of TON blockchain, so gas is emulated TON coin (which is free).</p>
<p>If you&#39;re unfamilar with terms like <em>contract</em>, <em>deployment</em> and <em>gas</em>, please <a href="https://blog.ton.org/what_is_blockchain">read this post</a> first. It&#39;s a great introduction to all blockchain terminology you will need to learn Tact.</p>
<h2 id="a-simple-interaction">A simple interaction</h2>
<p>Contracts can have <em>getters</em> like <code>greeting()</code>. 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.</p>
<p>Don&#39;t worry if some things aren&#39;t clear now, we will dive into getters in more detail later.</p>
<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="a-simple-counter">A Simple Counter</h1>
<p>This is a simple counter contract that allows users to increment its value.</p>
<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>
<p>State variables should be initialized in <code>init()</code> that runs on deployment of the contract.</p>
<h2 id="receiving-messages">Receiving messages</h2>
<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>
<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>
<!-- HTML_TAG_END -->
<div class="navMarkdown">
</div>
Expand Down Expand Up @@ -114,11 +113,18 @@ <h2 id="a-simple-interaction">A simple interaction</h2>


<button class="buttonAction svelteui-c-fAernD svelteui-c-fAernD-hkqluh-variation-filled svelteui-c-fAernD-iPJLV-css svelte-1qnpzwq" tabindex="0">
Get greeting
Get value
<div class="ripple svelte-1dillie"></div>
</button>

</div>




<button class="buttonAction svelteui-c-hYnOVn svelteui-c-hYnOVn-cKczaq-variation-filled svelteui-c-hYnOVn-iPJLV-css svelte-1qnpzwq" tabindex="0">
Send increment
<div class="ripple svelte-1dillie"></div>
</button></div>
<pre style="flex: 1; color: #666; overflow: scroll;"></pre></div></div>
</div>
</div>
Expand All @@ -128,7 +134,7 @@ <h2 id="a-simple-interaction">A simple interaction</h2>

<script>
{
__sveltekit_fgun5i = {
__sveltekit_1mddt07 = {
env: {},
base: new URL(".", location).pathname.slice(0, -1),
element: document.currentScript.parentElement
Expand All @@ -137,10 +143,10 @@ <h2 id="a-simple-interaction">A simple interaction</h2>
const data = [null,null,null];

Promise.all([
import("./_app/immutable/entry/start.47703ae1.js"),
import("./_app/immutable/entry/app.7cfde2f3.js")
import("./_app/immutable/entry/start.8747ea26.js"),
import("./_app/immutable/entry/app.2e63f0e3.js")
]).then(([kit, app]) => {
kit.start(app, __sveltekit_fgun5i.element, {
kit.start(app, __sveltekit_1mddt07.element, {
node_ids: [0, 2, 7],
data,
form: null,
Expand Down
Loading