Category: Blockchain

  1. Updated

    Solidity: call() vs delegatecall()

    Category: Blockchain

    delegatecall runs in the context of the caller contract.

  2. Updated

    Solidity: Multicall - Aggregate Multiple Contract Calls

    Category: Blockchain

    The main idea of Multicaller is to aggregate multiple contract function calls into a single one. It's usually to batch contract reads from off-chain apps. However, it could also be used to batch contract writes.

  3. Updated

    Demystifying Solidity ABI Encoding

    Category: Blockchain

    There are many encode functions in Solidity: abi.encode(), abi.encodePacked(), abi.encodeWithSignature(), and abi.encodeCall(). Which one to use, and when.

  4. Updated

    Solidity: Read Contract Storage by Slots with Foundry

    Category: Blockchain

    State variables are stored in different "slots" in a contract, and each slot is 32 bytes (256 bits). However, multiple adjacent state variables declared in the contract may be packed into the same slot by the Solidity compiler if their combined size does not exceed 32 bytes.

  5. Updated

    Solidity: CREATE vs CREATE2

    Category: Blockchain

    How to deploy a contract using `CREATE2` which is introduced in EIP-1014 to provide more flexible address generation.

  6. Updated

    Solidity: calldata, memory, and storage

    Category: Blockchain

    If you can, try to use calldata as data location because it will avoid copies, reduce gas usage, and also make sure that the data cannot be modified.

  7. Updated

    hardhat-deploy: Upgradeable Contracts with Linked Libraries

    Category: Blockchain

    Whenever the library is changed, hardhat-deploy will deploy a new implementation and upgrade the proxy.

  8. Updated

    Deploy Ethereum RPC Provider Load Balancer with HAProxy in Kubernetes (AWS EKS)

    Category: Blockchain, DevOps

    Put a HAProxy load balancer in front of multiple Ethereum RPC providers, and adjust traffic weights by the latency and block timestamp of each endpoint.

  9. Updated

    Deploy graph-node (The Graph) in Kubernetes (AWS EKS)

    Category: Blockchain, DevOps

    Two ways to run a self-hosted graph-node on Amazon EKS: a single node with one PostgreSQL database, or a cluster with a primary-secondary PostgreSQL cluster.

  10. Updated

    The Graph: Subgraph and GRT Token

    Category: Blockchain

    The Graph is a protocol for indexing and querying Blockchain data.