Skip to Content
Building Ethereum Dapps
book

Building Ethereum Dapps

by Roberto Infante
March 2019
Intermediate to advanced
504 pages
17h
English
Manning Publications
Content preview from Building Ethereum Dapps

Appendix A. SimpleCoin inherited from Ownable

Listing A.1. Refactored SimpleCoin contract, inherited from Ownable
pragma solidity ^0.4.16;
pragma solidity ^0.4.24;

import "./Listing6_4_Ownable.sol";

contract SimpleCoin is Ownable {                             1 mapping (address => uint256) public coinBalance; mapping (address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; event Transfer(address indexed from, address indexed to, uint256 value); event FrozenAccount(address target, bool frozen); constructor(uint256 _initialSupply) public { owner = msg.sender; mint(owner, _initialSupply); } function transfer(address _to, uint256 _amount) public { require(_to != 0x0); require(coinBalance[msg.sender] > _amount); require(coinBalance[_to] ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Blockchain Development with Hyperledger

Blockchain Development with Hyperledger

Salman A. Baset, Luc Desrosiers, Nitin Gaur, Petr Novotny
Ethereum For Dummies

Ethereum For Dummies

Michael G. Solomon

Publisher Resources

ISBN: 9781617295157Publisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link