Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit 300c9db

Browse files
committed
feat: update book/deploy page
1 parent c7e5db4 commit 300c9db

File tree

2 files changed

+37
-5
lines changed

2 files changed

+37
-5
lines changed

cspell.json

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"Timeouted",
4444
"Toncoin",
4545
"Toncoins",
46+
"topup",
4647
"Uninit",
4748
"vogons", // 42 vogons
4849
"workchain",

pages/book/deploy.mdx

+36-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,48 @@
1-
# Deploy
1+
# Deployment of Tact contracts
2+
3+
import { Callout } from 'nextra-theme-docs'
4+
5+
In Tact, it's a common practice to make contracts inherit the [`Deployable{:tact}`][deployable] trait and deploy them via a sending special [`Deploy{:tact}`][deploy] message alongside the [initial state](/book/expressions#initof).
6+
7+
Note, that contracts inheriting such trait return excessive funds upon deployment. That is, if you try to deploy a contract with any sufficient amount of Toncoins, the most of it (excluding fees) will be immediately returned to you after the deployment.
8+
9+
<Callout>
10+
11+
As a result, those contracts would have an empty Toncoin balance after the deployment. It's a good practice to introduce an empty `"topup"{:tact}` [receiver](/book/contracts#receiver-functions) function that can be used to top up the contract's balance at any given moment:
12+
13+
```tact
14+
receive("topup") {}
15+
```
16+
17+
</Callout>
18+
19+
## Deploying with `@ton/blueprint` [#blueprint]
20+
21+
<Callout>
22+
23+
To be written as per [#290](https://github.com/tact-lang/tact-docs/issues/290).
24+
25+
</Callout>
26+
27+
## Deploying with `@tact-lang/deployer` [#deployer]
28+
29+
{/* To be enhanced in: https://github.com/tact-lang/tact-docs/issues/290 */}
230

331
Tact Deployer is a small library that integrates with [TON Verifier](https://verifier.ton.org) that allows you to deploy your contracts safely using your favorite wallet without needing to manage keys or deploy contracts manually. Tact Deployer also automatically verifies your contract's source code and you can be sure that your compiler is not compromised.
432

5-
## Requirements
33+
### Requirements [#deployer-requirements]
634

735
Your contract MUST have the `Deployer` trait from the `@stdlib/deploy` package to be able to use Tact Deployer.
836

9-
## Installation
37+
### Installation [#deployer-installation]
1038

1139
To add Tact Deployer to your project, just use `yarn`:
1240

1341
```bash
1442
yarn add @tact-lang/deployer
1543
```
1644

17-
## How to use
45+
### Usage [#deployer-usage]
1846

1947
When you build your smart contracts using Tact, it produces a package (*.pkg) file that has all the required information about the built smart contract. To deploy your smart contract, you need to create a deployer instance, pass your package file to it and provide initial data for your contract.
2048

@@ -47,4 +75,7 @@ console.log('Address: ' + address.toString({ testOnly: testnet }));
4775
console.log('Deploy link: ' + link);
4876
```
4977

50-
After following this link you will be able to deploy and verify your smart contract.
78+
After following this link you will be able to deploy and verify your smart contract.
79+
80+
[deployable]: /ref/stdlib-deploy#deployable
81+
[deploy]: /ref/stdlib-deploy#deploy

0 commit comments

Comments
 (0)