Skip to Content
Ethereum Cookbook
book

Ethereum Cookbook

by Manoj P R
August 2018
Intermediate to advanced
404 pages
11h 19m
English
Packt Publishing
Content preview from Ethereum Cookbook

How to do it...

  1. There are multiple ways a contract can interact with other contracts. Making validations around these interactions cannot be trusted, and the destination contract can manipulate them:
require(<external_contract_call>);
  1. It is recommended not to depend on untrusted third-party contracts for validations. The external call can make the contract useless.
  2. A place where this can be easily overlooked is while transferring Ether. If the destination address is an externally owned account, then the transfer will be successful. If it is a contract address, then the transfer will call the fallback function of that contract and execute the code written inside it.

  3. Write a fallback function that always cancels the transaction. This ...

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

Building Ethereum Dapps

Building Ethereum Dapps

Roberto Infante
Ethereum For Dummies

Ethereum For Dummies

Michael G. Solomon

Publisher Resources

ISBN: 9781789133998Supplemental Content