pwasm-tutorial
pwasm-tutorial copied to clipboard
Not able to deploy contract in step 5
Command Given :
web3.eth.personal.unlockAccount(web3.eth.defaultAccount, "user").then(() => TokenDeployTransaction.estimateGas()).then(gas => TokenDeployTransaction.send({gasLimit: 5000000, from: web3.eth.defaultAccount})).then(contract => { console.log("Address of new contract: " + contract.options.address); TokenContract = contract; }).catch(err => console.log(err));
Error:
Promise {
Error: Returned error: The execution failed due to an exception. at Object.ErrorResponse (/home/krishnan/pwasm-tutorial/node_modules/web3-core-helpers/src/errors.js:29:16) at /home/krishnan/pwasm-tutorial/node_modules/web3-core-requestmanager/src/index.js:140:36 at XMLHttpRequest.request.onreadystatechange (/home/krishnan/pwasm-tutorial/node_modules/web3-providers-http/src/index.js:96:13) at XMLHttpRequestEventTarget.dispatchEvent (/home/krishnan/pwasm-tutorial/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22) at XMLHttpRequest._setReadyState (/home/krishnan/pwasm-tutorial/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14) at XMLHttpRequest._onHttpResponseEnd (/home/krishnan/pwasm-tutorial/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14) at IncomingMessage.
(/home/krishnan/pwasm-tutorial/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61) at IncomingMessage.emit (events.js:203:15) at IncomingMessage.EventEmitter.emit (domain.js:466:23) at endReadableNT (_stream_readable.js:1129:12) at process._tickCallback (internal/process/next_tick.js:63:19) parity version : Parity Ethereum version Parity-Ethereum/v2.6.0-beta-e38293b-20190708/x86_64-linux-gnu/rustc1.36.0
I have avoided the estimate gas command and given a new command.
The new command is
web3.eth.personal.unlockAccount(web3.eth.defaultAccount, "user").then(gas => TokenDeployTransaction.send({gasLimit: 500000000, from: web3.eth.defaultAccount})).then(contract => { console.log("Address of new contract: " + contract.options.address); TokenContract = contract; }).catch(err => console.log(err));
Error is
Promise {
Error: The contract code couldn't be stored, please check your gas limit. at Object.callback (/home/krishnan/pwasm-tutorial/node_modules/web3-core-method/src/index.js:333:46) at sendTxCallback (/home/krishnan/pwasm-tutorial/node_modules/web3-core-method/src/index.js:484:29) at /home/krishnan/pwasm-tutorial/node_modules/web3-core-requestmanager/src/index.js:147:9 at XMLHttpRequest.request.onreadystatechange (/home/krishnan/pwasm-tutorial/node_modules/web3-providers-http/src/index.js:96:13) at XMLHttpRequestEventTarget.dispatchEvent (/home/krishnan/pwasm-tutorial/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22) at XMLHttpRequest._setReadyState (/home/krishnan/pwasm-tutorial/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14) at XMLHttpRequest._onHttpResponseEnd (/home/krishnan/pwasm-tutorial/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14) at IncomingMessage.
(/home/krishnan/pwasm-tutorial/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61) at IncomingMessage.emit (events.js:203:15) at IncomingMessage.EventEmitter.emit (domain.js:466:23) at endReadableNT (_stream_readable.js:1129:12) at process._tickCallback (internal/process/next_tick.js:63:19)
Even changing the gaslimit to 8000000 didnt solve the issue.