Created
October 13, 2018 09:45
-
-
Save rbreve/05c44dcbd231dd3c44f57e321d798f51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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