I'd like to have a contract A which upon being sent ether, it transfers the ether to contract B, which upon receiving an eth transfer executes some logic.
Is there a way to do this without contract A having to know anything about contract B? Meaning, the user would just send eth to contract A's address which would then initiate the logic above.
So far, I've tried the following: There's contract A which upon sending ether to it gets its fallback function executed.
Said fallback function calls contractB.transfer(msg.value) to forward that ether to contract B.
Contract B has a fallback function which calls another function where its logic lies (say store the eth received in an internal state variable).
The problem here is that this approach fails due to the 2300 gas stipend.
The simplest approach would be to have contract A call some contract B's function instead of transfer(), but I'd like contract A not having to know anything about contract B other than the address.
Is there any other way to solve this?
I am aware of limitations in fallback functions. What I'm asking is if there's another way to do this that doesn't require Contract A knowing anything of Contract B other than its address.