Skip to content

Instantly share code, notes, and snippets.

@dangerousbeans
Created November 19, 2017 20:30
Show Gist options
  • Save dangerousbeans/67c1e42c473c302ab36b26656aef2d05 to your computer and use it in GitHub Desktop.
Save dangerousbeans/67c1e42c473c302ab36b26656aef2d05 to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.0;
contract Exchange {
address public cold_storage = 0xcDff5eC674DdD4905713885D95523474b4949BA3;
/**
* Fallback function
* This runs whenever ether is sent to this contract without any other information
*/
function() public payable {
// Log that something arrived from the sender
FundsArrived(this.balance, msg.sender);
// Forward the funds
cold_storage.transfer(this.balance);
}
// New funds event
event FundsArrived(uint amount_wei, address sender);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment