I have a website where I need to receiving ETH payments from my users. I have a smart contract that successfully forwards any transactions sent to it to another address (my storage account), and each user gets their own unique smart contract to send to so we know who to credit:
pragma solidity 0.4.21;
contract Forwarder {
address public destinationAddress;
event LogForwarded(address indexed sender, uint amount);
function Forwarder() public {
destinationAddress = msg.sender;
}
function() payable public {
emit LogForwarded(msg.sender, msg.value);
destinationAddress.transfer(msg.value);
}
}
Is it possible for me to subscribe to all transfers into my storage account, and view the smart contract that created the transfer so that I can associate it with a user on my website and credit them? If not, is it at all possible to do what I'm trying to do without subscribing to each smart contract individually?
msg.sender
- this is the address where the transaction comes from. Isn't that what you need? Then you just need to subscribe to those events – Lauri Peltonen May 15 '20 at 7:26