Skip to content

Instantly share code, notes, and snippets.

@base698 base698/stock.sol
Created Jun 1, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.