From 306d13155673e013b0201349ca1997dc470c0bea Mon Sep 17 00:00:00 2001 From: Shahar Yakir Date: Sun, 19 Jun 2022 14:49:43 +0300 Subject: [PATCH] fix testnet deployment (#10) --- build/_deploy.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/_deploy.ts b/build/_deploy.ts index fa63437..876dd3a 100644 --- a/build/_deploy.ts +++ b/build/_deploy.ts @@ -22,15 +22,17 @@ async function main() { console.log(`=================================================================`); console.log(`Deploy script running, let's find some contracts to deploy..`); + const isTestnet = process.env.TESTNET || process.env.npm_lifecycle_event == "deploy:testnet"; + // check input arguments (given through environment variables) - if (process.env.TESTNET || process.env.npm_lifecycle_event == "deploy:testnet") { + if (isTestnet) { console.log(`\n* We are working with 'testnet' (https://t.me/testgiver_ton_bot will give you test TON)`); } else { console.log(`\n* We are working with 'mainnet'`); } // initialize globals - const client = new TonClient({ endpoint: `https://${process.env.TESTNET ? "testnet." : ""}toncenter.com/api/v2/jsonRPC` }); + const client = new TonClient({ endpoint: `https://${isTestnet ? "testnet." : ""}toncenter.com/api/v2/jsonRPC` }); const deployerWalletType = "org.ton.wallets.v3.r2"; // also see WalletV3R2Source class used below const newContractFunding = toNano(0.02); // this will be (almost in full) the balance of a new deployed contract and allow it to pay rent const workchain = 0; // normally 0, only special contracts should be deployed to masterchain (-1)