CryptoFly.us | CRYPTOCURRENCY BITCOIN SHIRTS CLOTHING APPAREL HATS

CRYPTO NEWS

How blockchain technology can pave the way to a new future, explained

Mass adoption of privacy-preserving computation might become a significant improvement for blockchain.

web3 erroneously returning error

This is strange. My web3 script to deploy a contract seems to work, but always activates the .on(‘error’, fcn) clause even though there is no error. The message says Transaction has been reverted by the EVM but it has not really been reverted. It returns the contract address, the contract is there and I can::Listen

This is strange. My web3 script to deploy a contract seems to work, but always activates the .on(‘error’, fcn) clause even though there is no error.

The message says Transaction has been reverted by the EVM but it has not really been reverted. It returns the contract address, the contract is there and I can call it with other scripts.

Code:

con   .deploy({data:getBinary()} )   .send({from: eb, gas: 1000000, gasPrice: gprice}, (err, txhash) => {     if (txhash) console.log( "sent txhash: ", txhash );   } )   .on('error', (err) => { console.log("borked: ", err); })   .on('transactionHash', (h) => { console.log( "hash: ", h ); } )   .on('receipt', (r) => { console.log( 'rcpt: ' + r.contractAddress); } )   .on('confirmation', (cn, rcpt) => { console.log( 'cn: ', cn ); } )   .then( (con) => {     console.log( "SCA", con.options.address );     process.exit(0);   } )   .catch( err => { console.log } ); 

Result:

$ node cli.js 0 0 0 deploy sent txhash:  0x73c25e524056d76937429a92349f019d436c452b006cb4178e4170e5b24aa5b4 hash:  0x73c25e524056d76937429a92349f019d436c452b006cb4178e4170e5b24aa5b4 borked:  Error: Transaction has been reverted by the EVM: {   "transactionHash": "0x73c25e524056d76937429a92349f019d436c452b006cb4178e4170e5b24aa5b4",   "transactionIndex": 0,   "blockHash": "0xa7afc701efd8fcc397536f018a3307c5d38d6031431c3887298693a9b11edfc0",   "blockNumber": 6,   "gasUsed": "0x0b60fa",   "cumulativeGasUsed": "0x0b60fa",   "contractAddress": "0x786a010206921e8ea1181d86da22adbd87259d33",   "logs": [],   "status": "0x01",   "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",   "to": null }     at TransactionReceiptValidator.validate (/home/skull/node_modules/web3-core-method/dist/web3-core-method.cjs.js:146:16)     at /home/skull/node_modules/web3-core-method/dist/web3-core-method.cjs.js:44:68     at process._tickCallback (internal/process/next_tick.js:109:7) 

How blockchain technology can pave the way to a new future, explained

Shopping cart
There are no products in the cart!
Continue shopping
0