> ## Documentation Index
> Fetch the complete documentation index at: https://docs.int3face.zone/llms.txt
> Use this file to discover all available pages before exploring further.

# TON demo

* Demos
* TON demo

On this page

## Requirements[​](#requirements "Direct link to Requirements")

1. Access to Int3face node on int3-test-2
2. TON testnet wallet
3. TON-bridge repository

Current bridge address on TON is `EQCgQY3KSzPEh-uAuERDX2rh5pea2B5TedRdoExsIU7m_IZ4`

## TON testnet wallet[​](#ton-testnet-wallet "Direct link to TON testnet wallet")

1. Create a wallet on TON testnet - [https://wallet.ton.org/?testnet=true](https://wallet.ton.org/?testnet=true)
2. Request some tokens from the faucet - [https://t.me/testgiver\_ton\_bot](https://t.me/testgiver_ton_bot)
3. Save your wallet mnemonic

## TON-bridge repository[​](#ton-bridge-repository "Direct link to TON-bridge repository")

This repository contains cli tool that allows to communicate with the bridge contract

1. Install Node.js v18
2. `ts-node` (install with `npm install ts-node`)
3. Essential ton packages (install with `npm install @ton/ton @ton/crypto @ton/core`)
4. Clone the repository `git clone https://github.com/Int3facechain/ton-bridge.git`

## Inbound Transfer[​](#inbound-transfer "Direct link to Inbound Transfer")

**You should have at least 1.2 TON in your wallet**

1. Create new wallet in Int3face or use existing wallet

```shell theme={null}
# Create new wallet
int3faced keys add "$your_key_name"

# List existing wallets
int3faced keys list
```

We will use address `int3104s3nrdvh2d33p53gyzy5sczcep2dkmagpvhrk`

2. Lets check current balance of our wallet

```
int3faced q bank balances int3104s3nrdvh2d33p53gyzy5sczcep2dkmagpvhrk
```

<img src="https://mintcdn.com/bitfrst/pbB7o9wvRojtuJ7u/docs/demos/ton/docs/assets/images/testnet_init_balance-05cee720985c20312f3392baa31c84a5.png?fit=max&auto=format&n=pbB7o9wvRojtuJ7u&q=85&s=772f4639e9bda88aa508df0517e94484" alt="init_balance" width="1273" height="258" data-path="docs/demos/ton/docs/assets/images/testnet_init_balance-05cee720985c20312f3392baa31c84a5.png" />

3. Go to the `ton-bridge` folder

4. Set env variables with the TON wallet mnemonic and version

```shell theme={null}
export WALLET_MNEMONIC="spare throw guide income fade burst regular ranch fence basket frown security upset faith stay time recipe random exhaust admit leader undo soup muscle"
export WALLET_VERSION=v3r2
```

5. Send deposit transaction to the TON bridge contract

```
npx blueprint run
```

* Select `depositInt3faceBridge`
* Select `testnet`
* Select `Mnemonic`
* Enter bridge address `EQCgQY3KSzPEh-uAuERDX2rh5pea2B5TedRdoExsIU7m_IZ4`
* Enter Int3face destination address `int3104s3nrdvh2d33p53gyzy5sczcep2dkmagpvhrk`
* Wait for deposit completion

<img src="https://mintcdn.com/bitfrst/pbB7o9wvRojtuJ7u/docs/demos/ton/docs/assets/images/testnet_deposit_completed-2ecf396f978d4bc4fec723f25ba80825.png?fit=max&auto=format&n=pbB7o9wvRojtuJ7u&q=85&s=46ef8ffd79ade46199cc26f9b4716db6" alt="deposit_completed" width="1273" height="410" data-path="docs/demos/ton/docs/assets/images/testnet_deposit_completed-2ecf396f978d4bc4fec723f25ba80825.png" />

Now the transaction should be observed by the Observer and sent to the Int3face chain.

6. Check your balance on the Int3face

We should see that TON tokens were minted to our wallet.

```
int3faced q bank balances int3104s3nrdvh2d33p53gyzy5sczcep2dkmagpvhrk
```

<img src="https://mintcdn.com/bitfrst/pbB7o9wvRojtuJ7u/docs/demos/ton/docs/assets/images/testnet_updated_balance-15050c634873ce401d660289dfe0123a.png?fit=max&auto=format&n=pbB7o9wvRojtuJ7u&q=85&s=8d2e3712394c21dd5a7f3eb4d76e0006" alt="updated_balance" width="1273" height="295" data-path="docs/demos/ton/docs/assets/images/testnet_updated_balance-15050c634873ce401d660289dfe0123a.png" />

## Outbound Transfer[​](#outbound-transfer "Direct link to Outbound Transfer")

Lets send some TON tokens back to the TON chain.

We will use `EQBnAShkO0i9XeRgGwf84NhGbb3_onAZXnUYo5MzaBh07_z8` address as a recipient

1. Execute outbound transfer request for the x/bridge

```shell theme={null}
int3faced tx bridge outbound-transfer EQBnAShkO0i9XeRgGwf84NhGbb3_onAZXnUYo5MzaBh07_z8 ton-ton 100000000 --from int3face-node-114 --chain-id int3-test-2

...
txhash: 3E9CAA41D7ACE30E6A286D921647C8304C28CA01AC97925E36BFAF9FFD626223
...
```

<img src="https://mintcdn.com/bitfrst/pbB7o9wvRojtuJ7u/docs/demos/ton/docs/assets/images/testnet_execute_outbound-019949583c4e0fbc2e65aab43d24707b.png?fit=max&auto=format&n=pbB7o9wvRojtuJ7u&q=85&s=ad57bca20f2e67bb16c02f824e4caa3c" alt="execute_outbound" width="1273" height="936" data-path="docs/demos/ton/docs/assets/images/testnet_execute_outbound-019949583c4e0fbc2e65aab43d24707b.png" />

3. Lets check that our tx is successful in the Int3face

```
int3faced q tx EBA98D0CDF77700BDC0096E03CB013A2FA5D72945E3B2239CCF0ED69A50EE16C
```

<img src="https://mintcdn.com/bitfrst/pbB7o9wvRojtuJ7u/docs/demos/ton/docs/assets/images/testnet_outbound_result-db7b379bd1fab67830d586e098a5bcf5.png?fit=max&auto=format&n=pbB7o9wvRojtuJ7u&q=85&s=b7645d4de9587bbd6cfb675073440a92" alt="outbound_result" width="1273" height="189" data-path="docs/demos/ton/docs/assets/images/testnet_outbound_result-db7b379bd1fab67830d586e098a5bcf5.png" />

4. We can verify the transfer in the [TON explorer](https://testnet.tonviewer.com/kQBnAShkO0i9XeRgGwf84NhGbb3_onAZXnUYo5MzaBh070d2)

<img src="https://mintcdn.com/bitfrst/pbB7o9wvRojtuJ7u/docs/demos/ton/docs/assets/images/testnet_recipient_balance-b9a57b516524ecfc2f51b37ded9e4eec.png?fit=max&auto=format&n=pbB7o9wvRojtuJ7u&q=85&s=fa63ccb1406579938c81ec2b3fabe727" alt="recipient_balance" width="1178" height="326" data-path="docs/demos/ton/docs/assets/images/testnet_recipient_balance-b9a57b516524ecfc2f51b37ded9e4eec.png" />

We should see an incoming transfer there
