Skip to content

Instantly share code, notes, and snippets.

@rbreve
Created October 13, 2018 09:45
Show Gist options
  • Save rbreve/05c44dcbd231dd3c44f57e321d798f51 to your computer and use it in GitHub Desktop.
Save rbreve/05c44dcbd231dd3c44f57e321d798f51 to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.21;
contract Lempira {
address public bancoCentral;
uint public supply;
mapping (address => uint) public saldos;
event Enviado(address desde, address hacia, uint valor);
constructor(uint amount) public {
bancoCentral = msg.sender;
supply = amount;
saldos[msg.sender] = amount;
}
function send(address recipiente, uint amount) public {
if (saldos[msg.sender] < amount) return;
saldos[msg.sender] -= amount;
saldos[recipiente] += amount;
emit Enviado(msg.sender, recipiente, amount);
}
function miBalance() public view returns (uint){
return saldos[msg.sender];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment