contract ContractA {
constructor() payable {}
function getTransfer() public {
uint256 transferAmount = 0.1 ether;
(bool success, ) = msg.sender.call{value: transferAmount}("");
require(success, "Transfer failed");
}
}
interface IContractA {
function getTransfer() external;
}
contract ContractB {
IContractA public contracta;
constructor(address contractAddress) payable {
contracta = IContractA(contractAddress);
}
function getTransfer() public payable {
contracta.getTransfer();
}
}
When calling ContractB.getTransfer() it always fails the msg.sender.call. Is it possible to do this?