Skip to content

Instantly share code, notes, and snippets.

@base698
Created June 1, 2017 14:21
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 base698/253286fd3026a5d6a8324d3f48cf3344 to your computer and use it in GitHub Desktop.
Save base698/253286fd3026a5d6a8324d3f48cf3344 to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.10;
contract Stock {
mapping (address => shares) stockHolders;
uint numShares;
function Stock() {
numShares = 100;
}
function payDividend(uint amount) {
// get num stock holders
// divide amount by num_stock_holders
// pay out amount to all stock_holders
}
function buyStock() {
// check total shares
// add to mapping the number of shares owner has
}
function getShares() constant returns (uint) {
return stockHolders[msg.sender];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment