Читать книгу Cryptocurrency All-in-One For Dummies онлайн
164 страница из 200
The following sections touch on a few things to keep in mind as you build your first few DAOs, build smart contracts, and debug your new blockchain systems.
Putting money in a DAO
Don’t trust large sums of money to untested contracts and contracts that haven’t been fully vetted. Large contracts are more often targeted by hackers. The DAO hack described earlier in this chapter (see the sidebar, “With great power comes … great power”) showed that even well-thought-out contracts have unexpected weaknesses.
Building smarter smart contracts
Smart contract programming requires a different mindset than standard contract writing. There is no third party to make things right if the contract executes in a way that you didn’t expect or intend. The immutable and distributed nature of blockchains makes it tough to change an unwanted outcome.
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.