займ на карту онлайн кредит банк

Web3 “Transaction ran out of gas” error – actual gasUsed is well below limit

0

I’m calling the contract method with very high gas like so:

managerABI.methods.createNew(web3.utils.asciiToHex("123"), 100).send({   from: accounts[0],   value: web3.utils.toWei(".1", "ether"),   gas: '5000000' }) 

Then I’m getting the error:

(node:94410) UnhandledPromiseRejectionWarning: Error: Transaction ran out of gas. Please provide more gas: {   "blockHash": "0xac9dc0342c7d5d8e57e99f4009399cd0a8c3cf21d94d8192136ec73df265b9e5",   "blockNumber": 2603017,   "contractAddress": null,   "cumulativeGasUsed": 1790383,   "from": "0x0000000000000000000000000000000000000000", //from address   "gasUsed": 22089,   "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",   "status": false,   "to": "0xba331c69815541dacbed106fc8c4ae5739504c25",   "transactionHash": "0xb4c2b18bea109f64c6e977dfab2a770027a32a2e49766489a18ddf1520409b25",   "transactionIndex": 5,   "events": {} } 

I’m not sure why the contractAddress is null above. Calling getter methods works without issue.

Unless I’m misunderstanding the meaning of gasUsed above, because gasUsed is so far below the gas that I set in the method call, there must be another reason that the transaction is failing.

EDIT:

I THINK this is happening because the method I’m trying to call creates another contract (actually two other contracts, each of a different type). So maybe the heart of my question is about calling methods that create new contracts. It works in Remix where all of the contracts are defined in one place, but I’m not sure how Web3 handles this.

Any ideas?