0

From : truffle migrate --network kovan >> ProviderError: VM Exception while processing transaction: revert

>truffle migrate --reset --network kovan

Warning: Both truffle-config.js and truffle.js were found. Using truffle-config.js.

Compiling your contracts...
===========================
> Compiling .\contracts\Token.sol
> Artifacts written to D:\Blockchain Dev\t2\build\contracts
> Compiled successfully using:
   - solc: 0.5.8+commit.23d335f2.Emscripten.clang

Warning: Both truffle-config.js and truffle.js were found. Using truffle-config.js.

Migrations dry-run (simulation)
===============================
> Network name:    'kovan-fork'
> Network id:      42
> Block gas limit: 0x7a1200


1_initial_migration.js
======================

   Replacing 'Migrations'
   ----------------------
   > block number:        13446679
   > block timestamp:     1568292923
   > account:             0x8cf9f3920726e671716Fe6c44821DC0b56035B8D
   > balance:             5.86826832679724222
   > gas used:            246393
   > gas price:           2 gwei
   > value sent:          0 ETH
   > total cost:          0.000492786 ETH

   -------------------------------------
   > Total cost:         0.000492786 ETH


2_deploy_smartcontract.js
=========================

   Deploying 'Token'
   -----------------
   > block number:        13446681
   > block timestamp:     1568292936
   > account:             0x7D163E973E31a7532dB7EfeeAaaE360FEBD48126
   > balance:             99.999477718
   > gas used:            261141
   > gas price:           2 gwei
   > value sent:          0 ETH
   > total cost:          0.000522282 ETH


   Deploying 'Shop'
   ----------------
   > block number:        13446682
   > block timestamp:     1568292946
   > account:             0x8cf9f3920726e671716Fe6c44821DC0b56035B8D
   > balance:             5.86661835279724222
   > gas used:            797964
   > gas price:           2 gwei
   > value sent:          0 ETH
   > total cost:          0.001595928 ETH

Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (D:\Blockchain Dev\t2\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\web3\node_modules\web3-core-helpers\src\errors.js:42:1)
    at t.InvalidResponse [as onreadystatechange] (D:\Blockchain Dev\t2\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\web3\node_modules\web3-providers-http\src\index.js:92:1)
    at t._a [as dispatchEvent] (D:\Blockchain Dev\t2\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\xhr2-cookies\dist\xml-http-request-event-target.js:27:61)
    at t.dispatchEvent [as _setReadyState] (D:\Blockchain Dev\t2\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\xhr2-cookies\dist\xml-http-request.js:208:1)
    at t._setReadyState [as _onHttpRequestError] (D:\Blockchain Dev\t2\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\xhr2-cookies\dist\xml-http-request.js:349:1)
    at ClientRequest._onHttpRequestError (D:\Blockchain Dev\t2\node_modules\truffle-hdwallet-provider\dist\webpack:\truffle-hdwallet-provider\Users\gnidan\src\work\truffle\node_modules\xhr2-cookies\dist\xml-http-request.js:252:47)
    at ClientRequest.emit (events.js:197:13)
    at TLSSocket.socketErrorListener (_http_client.js:397:9)
    at TLSSocket.emit (events.js:197:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at processTicksAndRejections (internal/process/next_tick.js:76:17)
   -------------------------------------
   > Total cost:          0.00211821 ETH


Summary
=======
> Total deployments:   3
> Final cost:          0.002610996 ETH

Warning: Both truffle-config.js and truffle.js were found. Using truffle-config.js.
Warning: Both truffle-config.js and truffle.js were found. Using truffle-config.js.

Starting migrations...
======================
> Network name:    'kovan'
> Network id:      42
> Block gas limit: 0x7a1200


1_initial_migration.js
======================

   Replacing 'Migrations'
   ----------------------
   > transaction hash:    0x71f1ecd87d73ac93b1a0b851cbec1ee14ea33f4c6e8d1f0337c5f2a735238565
   > Blocks: 1            Seconds: 5
   > contract address:    0x99B3B76E319A398B7f31C425Bf86bf3F9A00e1ef
   > block number:        13446694
   > block timestamp:     1568292972
   > account:             0x8cf9f3920726e671716Fe6c44821DC0b56035B8D
   > balance:             5.86353325279724222
   > gas used:            261393
   > gas price:           20 gwei
   > value sent:          0 ETH
   > total cost:          0.00522786 ETH


   > Saving migration to chain.
   > Saving artifacts
   -------------------------------------
   > Total cost:          0.00522786 ETH


2_deploy_smartcontract.js
=========================

   Deploying 'Token'
   -----------------
   > transaction hash:    0x6a66f4e346b295ae6a7b930049dcf2a78d1f60466acc28e06a2f6d382bdc2a21
   > Blocks: 2            Seconds: 5
   > contract address:    0x55eAe6a8AA8d78E76E23469D60fCA9D871acf737
   > block number:        13446699
   > block timestamp:     1568292992
   > account:             0x8cf9f3920726e671716Fe6c44821DC0b56035B8D
   > balance:             5.85716997279724222
   > gas used:            276141
   > gas price:           20 gwei
   > value sent:          0 ETH
   > total cost:          0.00552282 ETH


   Deploying 'Shop'
   ----------------
   > transaction hash:    0xcbc525179d836c872fcc4abf4554580bff9407a89f0b47b83494c6854d2f5b2b
   > Blocks: 1            Seconds: 5
   > contract address:    0x35599a6CA54496cfA5F6E57aCf7D59b0c27376A1
   > block number:        13446703
   > block timestamp:     1568293008
   > account:             0x8cf9f3920726e671716Fe6c44821DC0b56035B8D
   > balance:             5.84091069279724222
   > gas used:            812964
   > gas price:           20 gwei
   > value sent:          0 ETH
   > total cost:          0.01625928 ETH

Error: Error: Error: invalid address (arg="_to", coderType="address", value=undefined)
    at Object.run (C:\Users\WINDOWS\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-migrate\index.js:92:1)
    at processTicksAndRejections (internal/process/next_tick.js:81:5)

Truffle v5.0.33 (core: 5.0.33)

Node v11.12.0

PS D:\Blockchain Dev\t2>
  • The problem appears to be in a migrations/2_deploy_smartcontract.js. I'd recommend to try to narrow down the line that causes the problem and update the question with the results. – Ismael Sep 13 at 20:44
0

Looks like the same problem as in previous question. You should add two last arguments (0 and 2) to HDWalletProvider(mnemonic, link, 0, 2) cause now your accounts[1] is undefined, bcause it was not unlocked by the provider. You also can try to console.log(accounts) to check the number of unlocked accounts.

Also, I still see Migrations dry-run (simulation) - this means you haven't switched it off.

  • I can now migrate to kavan. Thank you very much, very much. – YU Kunakorn Sep 15 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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