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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.