From 2e1c2ee8f326371641325c3b1377953014e3f46c Mon Sep 17 00:00:00 2001 From: AlexG <39581753+Reveloper@users.noreply.github.com> Date: Sun, 29 Jan 2023 13:03:03 +0400 Subject: [PATCH] deployment-script-fix --- sources/jetton.deploy.ts | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sources/jetton.deploy.ts b/sources/jetton.deploy.ts index 3ec5b9b..054c456 100644 --- a/sources/jetton.deploy.ts +++ b/sources/jetton.deploy.ts @@ -1,4 +1,4 @@ -import { beginCell, contractAddress, toNano, TonClient, TonClient4, Address, WalletContractV4, internal, fromNano} from "ton"; +import { beginCell, contractAddress, toNano, TonClient, TonClient4, Address, WalletContractV4, internal, fromNano, Cell} from "ton"; import {mnemonicToPrivateKey} from "ton-crypto"; import {buildOnchainMetadata} from "./utils/jetton-helpers"; import {SampleJetton} from "./output/jetton_SampleJetton"; @@ -18,7 +18,6 @@ import {SampleJetton} from "./output/jetton_SampleJetton"; }) // Insert your test wallet's 24 words, make sure you have some test Toncoins on its balance. Every deployment spent 0.5 test toncoin. - let mnemonics = "multiply voice predict admit hockey fringe flat bike napkin child quote piano year cloud bundle lunch...."; // read more about wallet apps https://ton.org/docs/participate/wallets/apps#tonhub-test-environment let keyPair = await mnemonicToPrivateKey(mnemonics.split(" ")); @@ -39,8 +38,8 @@ import {SampleJetton} from "./output/jetton_SampleJetton"; const jettonParams = { name: "TactJet", - description: "My jetton", - image: "https://www.linkpicture.com/q/download_183.png" // Image url + description: "Test tact contract - 4", + image: "https://ipfs.io/ipfs/QmbPZjC1tuP6ickCCBtoTCQ9gc3RpkbKx7C1LMYQdcLwti" // Image url }; // Owner should usually be the deploying wallet's address. @@ -52,14 +51,23 @@ import {SampleJetton} from "./output/jetton_SampleJetton"; // Compute init data for deployment let init = await SampleJetton.init(owner, content); - let destination_address = contractAddress(workchain, init); + + let deployAmount = toNano('0.5'); + let supply = 500; + let amount = BigInt(supply * Math.pow(10, 9)); + // send a message on new address contract to deploy it let seqno: number = await contract.getSeqno(); + + //TL-B mint#01fb345b amount:int257 = Mint + let msg = beginCell().storeBuffer(Buffer.from("01fb345b", "hex")).storeInt(amount, 257).endCell(); + console.log('🛠️Preparing new outgoing massage from deployment wallet. Seqno = ', seqno); console.log('Current deployment wallet balance = ', fromNano(balance).toString(), '💎TON'); + console.log('Totally supply for deployed Token = ', supply, ', amount = ', amount.toString()); await contract.sendTransfer({ seqno, secretKey, @@ -70,7 +78,7 @@ import {SampleJetton} from "./output/jetton_SampleJetton"; code : init.code, data : init.data }, - body: 'Deploy' + body: msg })] }); console.log('======deployment message sent to ', destination_address, ' ======');