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. You can send Ether to a contract even if it does not implement a payable function. Generally, sending Ether to a non-payable function will result in a failed transaction.
  2. A developer can easily overlook this and include some conditions in the contract that check for strict balance equality:
require(this.balance == 1 ether);
  1. Using such conditions can result in a permanent Denial Of Service (DoS) and can make the contract useless.
  2. There are multiple methods to force Ether to a contract. It can either be sent through the self-destruct function or by guessing a contract address that might be created in the future.
  1. The self-destruct function is generally used for removing the data of a contract from the blockchain. It also ...
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