My contract (contract A) is meant to send txs to another contract (Contract B). I want to end up having the fallback payable function of Contract B get called. I try to accomplish this by making a function in Contract A to take in an address (contract B address) and then transfer 00
eth to contract B from contract A.
function txTest(address recipient_addr) payable external
{
recipient_addr.transfer(0);
}
However this currently does not work even if the contract address I put in as the recipient_addr has a fallback payable function.
If I use another non contract address as the recipient_addr then transfer will go off without issue.
Is it possible to have Contract A manage to call Contract B's fallback payable function?
Thank you for the help.
EDIT: The actual fallback function that should be called.
function () external payable {
buyObject(msg.sender);
}
function buyObject(address _beneficiary) onlyValidPurchase
onlyBuyer(_beneficiary)
onlyValidAddress(_beneficiary) public payable {
uint numTokens = calculateTokens();
shopSettings.fundsRaised = shopSettings.fundsRaised.add(msg.value);
object.mint(_beneficiary, numTokens);
ObjectPurchase(msg.sender, _beneficiary, msg.value, numTokens);
forwardFunds();
}