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

Web3 “Transaction ran out of gas” on method that creates a contract


I have the following Solidity code:

pragma solidity ^0.4.17;  contract Parent {    function createChild() public {         new Child();     } }  contract Child {  } 

Which I’m calling with web3 like this:

const item = await managerABI.methods.createChild().send({    from: accounts[0],    gas: '5000000', }) 

Although the function is very simple and the gas limit is very high, I’m getting the error Transaction ran out of gas. Additionally, the full error message shows "gasUsed": 21577, which appears to mean that the actual gas used in the operation was well below the limit.

Any help is appreciated.