Skip to content

Instantly share code, notes, and snippets.

View dotmacro's full-sized avatar

Andrea Devers dotmacro

  • okTurtles
  • North Bay
View GitHub Profile

Keybase proof

I hereby claim:

  • I am dotmacro on github.
  • I am dotmacro (https://keybase.io/dotmacro) on keybase.
  • I have a public key ASBekTkVR5pW8t6boY6vdSpIbOnLd40ez9Xuv9Y7OxCRbwo

To claim this, I am signing this object:

@dotmacro
dotmacro / gas&costs.md
Last active November 15, 2015 03:24
Ethereum Gas & Costs TLDR

Ethereum Gas & Costs TLDR

Every Ethereum transaction must specify how much it’s willing to pay for its execution.1,2,8 This amount is withdrawn from the sender's account before the transaction is processed. Every computational step taken by the network consumes funds from this deposit.3 If the transaction completes before funds are exhausted, the network is paid for computation and the sender receives a refund of the remaining balance. If the funds are exhausted before the transaction completes, execution is undone 4 and the balance is transferred to the network as payment for computation. A “sub-limit” can also be set for transactions interacting with other transactions.5

Data costs “1 gas per zero byte and 5 gas per nonzero byte.”6

A function that sets values in storage AND completes successfully results in a refund, which is capp