Building the DApp

Let's write the smart contracts for digitalizing fiat currency and storing cell phone numbers linked to bank accounts. Here is the smart contract for digitalizing fiat currency:

pragma solidity ^0.4.18;contract USD {    address centralBank;        mapping (address => uint256) balances;    uint256 totalDestroyed;    uint256 totalIssued;        event usdIssued(uint256 amount, address to);    event usdDestroyed(uint256 amount, address from);    event usdTransferred(uint256 amount, address from, address to,      string description);        function USD() {        centralBank = msg.sender;    }        function issueUSD(uint256 amount, address to) {        if(msg.sender == centralBank) {            balances[to] += amount;             totalIssued += amount;            usdIssued(amount, to);        }    }     function destroyUSD(uint256 ...

Get Blockchain for Enterprise now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.