Skip to content

Instantly share code, notes, and snippets.

Created May 22, 2017 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/db8ff45a1398c9572705294ec0c26175 to your computer and use it in GitHub Desktop.
Save anonymous/db8ff45a1398c9572705294ec0c26175 to your computer and use it in GitHub Desktop.
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.11+commit.68ef5810.js&optimize=undefined&gist=
pragma solidity ^0.4.0;
contract Hub {
function contribute(address _address) payable returns (address) {
Project project = Project(_address);
project.fund.value(msg.value)(msg.sender);
return msg.sender;
}
}
contract Project {
uint amount;
mapping (address => uint) public contributors;
function fund(address sender) payable {
amount += msg.value;
contributors[sender] = msg.value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment