Hi,
I have two contracts and I am trying to send ether from on contract to another. This is the code I tried to use.
(bool secondary, ) = payable(otherContractAddress).call{value: amountToSend}("");
require(secondary, "Failed");
This code fails and returns "Failed" when called with the address of my smart contract as the otherContractAddress. When I change otherContractAddress to a simple wallet address the function works properly. I assume it is an issue with callback functionality on the other contract.
Is there an easier way to send money from contract to contract?