0

I have a contract

// SPDX-License-Identifier: MIT

pragma solidity ^ 0.8.15;

contract MomContract { bool public failed =false; constructor(){ new Son(address(this));

}
function SetFailed(bool _failed) public{
    failed=_failed;
}


} contract Son{ constructor(address _mom){ MomContract mom=MomContract(_mom); mom.SetFailed(true);

}

}

When I try to deploy it with remix, it fails with revert

The transaction has been reverted to the initial state.
Note: The called function should be payable if you send value and the value you send should be less than your current balance.
Debug the transaction to get more information.

I see no error in it, but how do I communicate from contract to contract?

Julissa DC
  • 1,888
  • 1
  • 8
  • 21
Andy D
  • 23
  • 3

0 Answers0