I want to allow my users to deposit funds, and have all those funds sent to a mainwallet cos its gonna be very small amounts of ether ($2-$5 worth) for alot of users. So id imagine i can create a forwarding contract for each user so i can detect payments to the contract and have it all in one place instead of spending my whole week manually transferring small amounts from each account. I suppose theres a script for that.Which approach would you reccomend and if the forwarding contract approach, can you explain whats wrong with this contract. Im getting alot of warnings
pragma solidity ^0.4.2;
/**
* Contract that will forward any incoming Ether to its creator
*/
contract Forwarder {
// Address to which any funds sent to this contract will be forwarded
address public destinationAddress;
/**
* Create the contract, and set the destination address to that of the creator
*/
function Forwarder() {
destinationAddress = msg.sender;
}
/**
* Default function; Gets called when Ether is deposited, and forwards it to the destination address
*/
function() payable {
if (!destinationAddress.send(msg.value))
throw;
}
/**
* It is possible that funds were sent to this address before the contract was deployed.
* We can flush those funds to the destination address.
*/
function flush() {
if (!destinationAddress.send(this.balance))
throw;
}
}