Skip to content

Instantly share code, notes, and snippets.

@alaingoldman
Last active September 6, 2017 23:03
Show Gist options
  • Select an option

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

Select an option

Save alaingoldman/f50f30eaabed223a0b0d11aa5e139130 to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.12;
contract PassToken {
uint x = 123;
mapping(address => uint) balance;
function whats_x() constant returns(uint){
return x;
}
event print_warning(address, string, uint);
function change_x(uint newx){
x = newx;
}
function print_tokens(uint amount){
balance[msg.sender] += amount;
print_warning(msg.sender, "Is printing", amount);
}
function coin_balance() constant returns(uint){
return balance[msg.sender];
}
function give_me_money() payable{}
function eth_balance() returns(uint){
return this.balance;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment