From 90ca53c8ffcd1fdac7b327fb5a6afcfdc6dc58b1 Mon Sep 17 00:00:00 2001 From: Serhii Volovyk Date: Thu, 29 Apr 2021 10:40:11 +0300 Subject: [PATCH] dev-deploy usage restricted on mainnet (#714) * dev-deploy usage restricted on mainnet --- commands/dev-deploy.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/commands/dev-deploy.js b/commands/dev-deploy.js index 99e6c0bd..34e1341e 100644 --- a/commands/dev-deploy.js +++ b/commands/dev-deploy.js @@ -36,6 +36,9 @@ module.exports = { }; async function devDeploy(options) { + if (options.networkId === 'mainnet') { + throw Error('MainNet doesn\'t support dev-deploy. Use export NEAR_ENV=testnet to switch to TestNet'); + } await eventtracking.askForConsentIfNeeded(options); const { nodeUrl, helperUrl, masterAccount, wasmFile } = options; if (!helperUrl && !masterAccount) { @@ -77,8 +80,8 @@ async function createDevAccountIfNeeded({ near, keyStore, networkId, init, maste } } let accountId; - // create random number with at least 7 digits - const randomNumber = Math.floor(Math.random() * (9999999 - 1000000) + 1000000); + // create random number with at least 14 digits + const randomNumber = Math.floor(Math.random() * (99999999999999 - 10000000000000) + 10000000000000); if (masterAccount) { accountId = `dev-${Date.now()}.${masterAccount}`;