0

I am following this instructions https://hardhat.org/tutorial/deploying-to-a-live-network.html

When I run the following command (last step of the instructions)

npx hardhat run scripts/deploy.js --network ropsten --verbose

I receive this:

  hardhat:core:config Loading Hardhat config from /Users/myuser/Library/Mobile Documents/com~apple~CloudDocs/BlockchainProjects/krypt/smart_contract/hardhat.config.js +0ms
  hardhat:core:global-dir Looking up Client Id at /Users/myuser/Library/Application Support/hardhat-nodejs/analytics.json +0ms
  hardhat:core:global-dir Client Id found: 286bbcd2-e092-4d91-9301-8a0bc02921f1 +11ms
  hardhat:core:hre Creating HardhatRuntimeEnvironment +0ms
  hardhat:core:hre Running task run +51ms
  hardhat:core:hre Running task compile +1ms
  hardhat:core:hre Running task compile:get-compilation-tasks +0ms
  hardhat:core:hre Running task compile:solidity +0ms
  hardhat:core:hre Running task compile:solidity:get-source-paths +1ms
  hardhat:core:hre Running task compile:solidity:get-source-names +5ms
  hardhat:core:hre Running task compile:solidity:get-dependency-graph +7ms
  hardhat:core:hre Running task compile:solidity:read-file +2ms
  hardhat:core:hre Running task compile:solidity:get-compilation-jobs +5ms
  hardhat:core:tasks:compile The dependency graph was divided in '1' connected components +0ms
  hardhat:core:hre Running task compile:solidity:get-compilation-job-for-file +1ms
  hardhat:core:compilation-job File '/Users/myuser/Library/Mobile Documents/com~apple~CloudDocs/BlockchainProjects/krypt/smart_contract/contracts/Transaction.sol' will be compiled with version '0.8.0' +0ms
  hardhat:core:hre Running task compile:solidity:handle-compilation-jobs-failures +2ms
  hardhat:core:hre Running task compile:solidity:filter-compilation-jobs +0ms
  hardhat:core:tasks:compile '1' jobs were filtered out +5ms
  hardhat:core:hre Running task compile:solidity:merge-compilation-jobs +2ms
  hardhat:core:hre Running task compile:solidity:compile-jobs +1ms
  hardhat:core:tasks:compile No compilation jobs to compile +1ms
  hardhat:core:hre Running task compile:solidity:log:nothing-to-compile +0ms
  hardhat:core:hre Running task compile:solidity:log:compilation-result +4ms
  hardhat:core:hre Running task compile:remove-obsolete-artifacts +0ms
  hardhat:core:tasks:run Running script scripts/deploy.js in a subprocess so we can wait for it to complete +0ms
  hardhat:core:scripts-runner Creating Hardhat subprocess to run scripts/deploy.js +0ms
  hardhat:core:config Loading Hardhat config from /Users/myuser/Library/Mobile Documents/com~apple~CloudDocs/BlockchainProjects/krypt/smart_contract/hardhat.config.js +0ms
  hardhat:core:hre Creating HardhatRuntimeEnvironment +0ms
  hardhat:core:hre Creating provider for network ropsten +175ms
Transactions deployed to:  0x64afCB54c2493Fb9Ec97aeaC0f340b7abc27730b
ReferenceError: proccess is not defined
    at runMain (/Users/myuser/Library/Mobile Documents/com~apple~CloudDocs/BlockchainProjects/krypt/smart_contract/scripts/deploy.js:13:5)
ReferenceError: proccess is not defined
ReferenceError: proccess is not defined

   ... lots of binary ...

    RuntimeError: abort(ReferenceError: proccess is not defined). Build with -s ASSERTIONS=1 for more info.
        at process.abort (/Users/myuser/Library/Mobile Documents/com~apple~CloudDocs/BlockchainProjects/krypt/smart_contract/node_modules/solc/soljson.js:1:13938)
        at process.emit (node:events:390:28)
        at process.emit (/Users/myuser/Library/Mobile Documents/com~apple~CloudDocs/BlockchainProjects/krypt/smart_contract/node_modules/source-map-support/source-map-support.js:516:21)
        at emit (node:internal/process/promises:136:22)
        at processPromiseRejections (node:internal/process/promises:242:25)
        at processTicksAndRejections (node:internal/process/task_queues:97:32)

however, when I check my ropsten-eth balance on metamask I can see that I spent some ropsten-eth for deploying.

I have also a json file of the smart contract with abi section in my folder artifacts/contracts/contract.

But because of my error I cannot see the address where the smart contract was deployed to and I don't know what led to the error.

my deploy.js file

const main = async () => {
  const Transactions = await hre.ethers.getContractFactory("Transactions");
  const transactions = await Transactions.deploy();

  await transactions.deployed();

  console.log('Transactions deployed to: ', transactions.address);
}

const runMain = async () => {
  try {
    await main();
    proccess.exit(0);
  } catch (error) {
    console.error(error);
    proccess.exit(1);
  }
}

runMain();

my hardhat.config.js file

const { solidity } = require('ethereum-waffle')

require('@nomiclabs/hardhat-waffle')

module.exports = {
  solidity: '0.8.0',
  networks: {
    ropsten: {
      url: 'https://eth-ropsten.alchemyapi.io/v2/*****************',
      accounts: [ '******************************' ]
    }
  }
}

I don't see how this relates to https://stackoverflow.com/questions/30239060/uncaught-referenceerror-process-is-not-defined

1 Answer 1

0

The issue is that process is misspelt as proccess. It should be

try {
    await main();
    process.exit(0);
} catch (error) {
    console.error(error);
    process.exit(1);
}
1
  • oh stupid. thanks very much for pointing out! When new to a topic, one thinks always there must be something I don't know instead of checking what is known Jan 27, 2022 at 10:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.