Skip to content

Instantly share code, notes, and snippets.

@alaingoldman
Created September 5, 2017 22:52
Show Gist options
  • Select an option

  • Save alaingoldman/fbf590fb6d9d6f29e36fe217c698e50c to your computer and use it in GitHub Desktop.

Select an option

Save alaingoldman/fbf590fb6d9d6f29e36fe217c698e50c to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.11;
contract PassToken {
string public constant name = "PassToken";
string public constant symbol = "PASS";
// 1 ether = 50 PAC
uint public constant price = 50;
uint public initial_supply = 12000000;
// limit 2 million for sale
// 10 million will remain
// give a balance uint for PASS
mapping(address => uint) balance;
address admin;
function PassCoin(){
admin = msg.sender;
}
modifier admin_only(){
require(admin == msg.sender);
_;
}
function PassToken(){
balance[msg.sender] = initial_supply;
}
event coinSold(address, uint);
function coinSale() payable{
require(msg.value >= 1 ether);
//require(balance[admin] > msg.value * 50);
msg.value;
balance[msg.sender] * price;
coinSold(msg.sender, msg.value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment