|
34 | 34 | <meta http-equiv="content-security-policy" content=""> |
35 | 35 | <link href="./_app/immutable/assets/_layout.e2caa7e1.css" rel="stylesheet"> |
36 | 36 | <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"> |
38 | 38 | <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"> |
40 | 40 | <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"> |
42 | 42 | <link rel="modulepreload" href="./_app/immutable/entry/layout.svelte.2cd9eabd.js"> |
43 | 43 | <link rel="modulepreload" href="./_app/immutable/entry/_layout.ts.984db11e.js"> |
44 | 44 | <link rel="modulepreload" href="./_app/immutable/chunks/_layout.da46b06b.js"> |
45 | 45 | <link rel="modulepreload" href="./_app/immutable/entry/(examples)-layout.svelte.4abe3603.js"> |
46 | 46 | <link rel="modulepreload" href="./_app/immutable/chunks/store.476c3091.js"> |
47 | 47 | <link rel="modulepreload" href="./_app/immutable/chunks/examples.ec427188.js"> |
48 | 48 | <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"> |
50 | 50 | <link rel="modulepreload" href="./_app/immutable/chunks/index.c056099e.js"> |
51 | 51 | </head> |
52 | 52 | <body> |
|
60 | 60 |
|
61 | 61 |
|
62 | 62 | <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'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'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> |
66 | 68 | <p>If you're using Tact'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> |
67 | 69 | <pre><code class="language-ts">const msg = { $$type: "Deploy", queryId: 0n }; |
68 | | - await contract.send(sender, { value: toNano(1) }, msg); |
| 70 | +await contract.send(sender, { value: toNano(1) }, msg); |
69 | 71 | </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> |
71 | 73 | <!-- HTML_TAG_END --> |
72 | 74 | <div class="navMarkdown"> |
73 | 75 | </div> |
|
162 | 164 |
|
163 | 165 | <script> |
164 | 166 | { |
165 | | - __sveltekit_16o0bmh = { |
| 167 | + __sveltekit_wfqjrz = { |
166 | 168 | env: {}, |
167 | 169 | base: new URL(".", location).pathname.slice(0, -1), |
168 | 170 | element: document.currentScript.parentElement |
|
171 | 173 | const data = [null,null,null]; |
172 | 174 |
|
173 | 175 | 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") |
176 | 178 | ]).then(([kit, app]) => { |
177 | | - kit.start(app, __sveltekit_16o0bmh.element, { |
| 179 | + kit.start(app, __sveltekit_wfqjrz.element, { |
178 | 180 | node_ids: [0, 2, 8], |
179 | 181 | data, |
180 | 182 | form: null, |
|
0 commit comments