good day, friends 👋
got stuck for some time with the following issue:
i have 2 smart contracts, first one smth like factory which deploys second one.
first one contract has method which deploys second contract. the problem is, this method in first contract is payable and i want to send msg.value to the second contract, but i can’t because of reverted execution… example:
function createChild(address _seller, uint256 _time) external payable {
require(msg.value > 0);
Child child = new Child(_seller, _time);
payable(address(child)).transfer(msg.value); // here is an error, also tried:
payable(child).transfer(msg.value);
childArray.push(child);
is there any mistakes or everything is right and there is problem with my code for interacting with SC?
Feb 11, 2022, 9:38 AM
nvm, figured out
Feb 11, 2022, 9:50 AM