Skip to content

Instantly share code, notes, and snippets.

View andreiashu's full-sized avatar

andreiashu andreiashu

View GitHub Profile
@andreiashu
andreiashu / 4.3.md
Created January 30, 2022 12:13 — forked from hayeah/4.3.md
yellopaper rewritten with source code references

4.3 The Block

The block in Ethereum is the collection of relevant pieces of information (known as the block header), together with information corresponding to the comprised transactions, and a set of other block headers that are known to have a parent equal to the present block’s parent’s parent (such blocks are known as uncles).

https://sourcegraph.com/github.com/ethereum/go-ethereum@479aa61f11724560c63a7b56084259552892819d/-/blob/core/types/block.go#L139

type Block struct {
	header       *Header
	uncles []*Header
@andreiashu
andreiashu / solidity.mapping.BoolvsInt.sol
Created February 16, 2022 12:47
gas costs and a small gotcha about address to bool mappings
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
contract MappingBool {
// NB: if you need to distinguish from nil vs false this method does not work
mapping(address => bool) entries;
// gas 44463