I have seen that when I create a new smart contract from another smart contract Remix Ethereum return to me the address of smart contract. But When I do it with web3js the callback function just return to me a transactionHash and no more information. When I try to get eth.getTransactionReceipt("transactionHash") I saw contractAddress is null.
I can work arround by use event but my question is that How can Remix Ethereum can do that?
pragma solidity ^0.4.24;
contract Project {
address public founder;
constructor () public {
founder = msg.sender;
}
function createRequest(string _title) public returns (address) {
address addrRequest = new Request(_title);
return addrRequest;
}
}
contract Request {
string public title;
constructor(string _title) public {
title = _title;
}
}