If your contract is big enough, offer bug-hunting bounties that incentivize the community to find vulnerabilities and flaws in your contract.
As with many things, the complexity of your contract also increases the likelihood of errors and attack vectors. Keep your contract logic simple. Build out small modules that hold each section of the contract. Creating a contract in this manner will help you compartmentalize any issues.
Finding bugs in the system
Don’t reinvent the wheel by building your own tools such as random number generators. Instead, leverage the work that the community has already done and that has been well tested.
You can only control for things within your own contract. Be cautious of external contract calls. They can execute malicious code and take away your control.
The Ethereum community has an excellent known bug list and even more helpful tips on how to build secure smart contracts. You can find it at eth.wiki/en/howto/smart-contract-safety
.
Creating Your Own ERC-20 Token
This section shows you how to create your own token on the Ethereum network. Before you read through this section, make sure that you’ve set up MetaMask. If you haven’t, refer to Chapter 3of this minibook, where you find detailed instructions for setting up your computer and downloading MetaMask.
To create your token, follow these steps:
1 Go to https://www.createmytoken.com
.
2 Click Ethereum Network.
3 Click Create ERC-20 Token for free!.
4 Connect your MetaMask wallet by clicking Connect.
5 Name your token and give it a Token (ticker) Symbol.
6 Make sure that All Functionality is set to the On position.
7 Type in your initial supply of tokens, such as 100,000,000.Under the Ready to Deploy? box, make sure you have enough ETH in your MetaMask wallet to cover the gas fees. For example, at the time of this writing, the estimated cost was 0.05 ETH. If this amount is acceptable to you, click Deploy Token!.
Congratulations! You’ve created your own token. With tools like https://www.createmytoken.com
, it’s easy and fast to create a token on various platforms. If you’re curious to find out more about Ethereum, head to Book 4.
Chapter 6
Getting Your Hands on Hyperledger
IN THIS CHAPTER
Uncovering Hyperledger Foundation
Discovering key Hyperledger projects
Building an asset tracking platform
Creating chaincode smart contracts
Hyperledger is a foundation that supports a community of software developers and technology enthusiasts who are building industry standards for blockchain frameworks and platforms. Hyperledger’s work is crucial because they’re creating blockchain technology that fits the needs of businesses. Cryptocurrencies on public blockchains have regulatory implications and liabilities that prevent many companies from utilizing these networks. Hyperledger has many of the same benefits of public blockchain technology but operates without a cryptocurrency. With big supporters such as Intel and IBM, Hyperledger is the “trusted” deployment platform for enterprise teams.
Hyperledger and its unique project are growing every day. As of this writing, it has 190 member companies and several blockchain applications. Hyperledger’s first few projects include Fabric, Iroha, and Sawtooth. These are frameworks that developers can use to build private blockchains, create smart contracts, and build distributed identity for people and things.
This chapter shows you how to create an asset tracking and a smart auction application using Hyperledger’s Composer tool and introduces you to the Fabric, Iroha, and Sawtooth projects. You’ll gain a deep understanding of what the future of commercialized blockchain will hold for your company and industry. This knowledge can help you as you explore which technologies to utilize and which to avoid, saving you development time and resources.
Getting to Know Hyperledger
At the end of 2015, the Linux Foundation formed the Hyperledger project to develop an enterprise-grade and open-source distributed ledger framework. They hoped to focus the blockchain community on building robust, industry-specific applications, platforms, and hardware systems to support businesses.
The Linux Foundation saw that many different groups were building blockchain technology without a cohesive direction. The industry was duplicating effort, and the tribalism was leading teams to solve the same problem twice. The foundation members saw similarities between the birth of the Internet and the emergence of blockchain technology: If blockchain was going to realize its fullest potential, an open-source and collaborative development strategy was desperately needed.
The Hyperledger project is led by Executive Director Brian Behlendorf, who has decades of experience dating back to the original Linux Foundation and Apache Foundation, as well as being a chief technology officer (CTO) of the World Economic Forum. So, it’s not surprising that Hyperledger has been well received. Many of the top business and industry leaders have joined the project, including Accenture, Visa, Fujitsu Limited, IBM, FedEx, JPMorgan Chase, and Microsoft. It has also attracted many of the top blockchain organizations.
Hyperledger’s technical steering committees ensure robustness and interoperability between these different technologies. The hope is that the cross-industry, open-source collaboration will advance blockchain technology and deliver billions of dollars in economic value by sharing the costs of research and development across many organizations.
Hyperledger is identifying and addressing the critical features and requirements missing from the blockchain technology ecosystem. It’s also fostering a cross-industry open standard for distributed ledgers and holding open space for developers to contribute to building better blockchain systems.
Hyperledger has a project life cycle similar to that of the Linux Foundation. A proposal is submitted, and then the accepted proposal is brought into incubation. When a project has reached a stable state, it graduates and is moved into an active state. Each of the projects were initially led by a large corporation or start-up, and since then, many of them have created strategic partnerships to share in the project’s development. For example, Fabric was led by IBM, Sawtooth by Intel, and Iroha by Soramitsu, but now many additional partnerships have helped advance each project.
Hyperledger, like many open-source projects, uses GitHub ( www.github.com/hyperledger
) and a chat service ( https://chat.hyperledger.org
) to connect with teams working on each of the projects. These are great places to get the latest updates and to check on the progress that these projects are making in development.
Читать дальше