vm.mockCall in Solidity

Posted on Mon 24 July 2023 in tech • Tagged with solidity, ethereum, programming, tutorial

mocking calls to specific addresses in solidity

Mocking a specific address signature in Solidity is useful for simulating expected behavior from an existing address or instance of a contract. In mock testing dependencies are replaced with simulated implementations to isolate the behavior of the funtion under test.

Proxy contracts that …

Continue reading

Introduction to market making for engineers

Posted on Sat 20 May 2023 in tech • Tagged with bitcoin, ethereum, crypto, market-making, tutorial

Market Making in Crypto

High performance trading systems designers implement event sourcing models to build of low latency distributed systems. This is useful for market making where placing buy and sell orders rapidly lowers risk and improves profitability.

In this tutorial I explain how trading systems are designed to implement …

Continue reading

UUPS ERC-1822 Proxy Contract Implementation

Posted on Fri 21 April 2023 in tech • Tagged with solidity, programming, tutorial

Universal Upgradeable Proxy Standard UUPS ERC-1822 Tutorial and Complete Working Example

The first time I had to implement a UUPS proxy I found no clear example anywhere on the Internet. There are many trial implementations and even builders that enable one to implement a proxy in the background. It is …

Continue reading

Dynamic address set in solidity

Posted on Fri 17 February 2023 in tech • Tagged with solidity, ethereum, programming, tutorial

Dynamic Address Set

This is a complete step by step walkthrough implementation of a dynamic address set in Solidity for Ethereum blockchain.


  • foundry
  • modifier
  • event
  • dynamic data structures
  • unit testing

  • Full project on GitHub

  • Full tutorial on YouTube:

Compiled switch in modern c++

Posted on Tue 31 January 2023 in tech • Tagged with c++, c++20, programming, tutorial

Compiled Switch

This example demonstrates how to incorporate a compiled switch construct in an event driven application such as a market data handler or parser.

Full tutorial on YouTube:

std::generate in modern c++

Posted on Fri 27 January 2023 in tech • Tagged with c++, std::generate, lambda, tutorial


Many examples of std::generate in C++ involve a static. However using a static introduces issues around thread safety and usability in modern code. Here is a simple example using std::generate with a c++14 style lambda that defines and captures a local variable.

Full tutorial on …

Continue reading