Created
October 29, 2016 15:08
-
-
Save PhyrexTsai/cad7b5a8a092f021b7cd15fdb8d35242 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.0; | |
contract BuyNccuCoin { | |
function buy () returns (bool) { | |
// buy coin | |
// 客戶賣回給銀行 | |
// receiver 這邊要放銀行 | |
NccuBank nccuBank = new NccuBank(); | |
if (nccuBank.check() < msg.value) { | |
return false; | |
} | |
return nccuBank._send(nccuBank.minter, msg.value); | |
} | |
function sell(uint howMuchNccuCoin) returns (bool) { | |
// sell coin | |
// 銀行賣給客戶,要鑄造,之後轉帳 | |
NccuBank nccuBank = new NccuBank(); | |
return nccuBank.mint(nccuBank.minter, howMuchNccuCoin) && nccuBank._send(msg.sender, howMuchNccuCoin); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment