Posts

Showing posts from August, 2023

Blockchain Basics: A Non-Technical Introduction in 25 Steps Paperback (Daniel Drescher, 2017)

Image
  Cryptographic hash functions exhibit the following properties Provide hash values for any kind of data quickly Deterministic Pseudorandom One-way usage Collision resistant Application of hash functions to data can be accomplished by using the following patterns Repeated hashing Independent hashing Combined hashing Sequential hashing Hierarchical hashing Hash values can be used To compare data To detect whether data that were supposed to stay unchanged have been altered To refer to data in a change-sensitive manner To store a collection of data in a change-sensitive manner To create computationally expensive tasks Blockchain blocks The blockchain-data-structure is a specific kind of data structure that is made up of ordered units called blocks Each block of the blockchain-data-structure consists of a block header and a Merkle tree that contains transaction data The blockchain-data-structure consists of two major data structures: an ordered chain of block headers and Merkle trees O...

Simplest Way to use ERC-1822 Universal Upgradeable Proxy Standard (UUPS)

Image
There are already many articles on UUPS and the explanation of how it works, I am going to jump right into the simplified code of UUPS. One of the downside of using a proxy is that many fraud projects and money game make use of it which may affect your credibility when you use a proxy contract, as they thought you are associated with these degens. I have combined the entire contract bundle into a single UUPS.sol file. // SPDX-License-Identifier: None pragma solidity 0.8.19; pragma abicoder v1; abstract contract UUPSUpgradeable {     bytes32 private constant _SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;     address private immutable __self = address(this);     address internal owner;     bool inited;     struct AddrS { address value; }     modifier onlyProxy() {         require(address(this) != __self && addrS().value == __self && owner == msg.sender, "Proxy faile...