Skip to content

Instantly share code, notes, and snippets.

@hrkrshnn
hrkrshnn / generic.org
Last active April 21, 2024 01:51
Some generic writeup about common gas optimizations, etc.

Upgrade to at least 0.8.4

Using newer compiler versions and the optimizer gives gas optimizations and additional safety checks for free!

The advantages of versions 0.8.* over <0.8.0 are:

  • Safemath by default from 0.8.0 (can be more gas efficient than some library based safemath).
  • Low level inliner from 0.8.2, leads to cheaper runtime gas. Especially relevant when the contract has small functions. For
@ConanMishler
ConanMishler / aBLOCK.md
Last active December 3, 2021 11:46
aBLOCK

Buy/trade aBLOCK and redeem aBLOCK for BLOCK

First, set up MetaMask1...

  1. Open Chrome, FireFox, Brave, or Edge browser, install MetaMask1 as a Browser Extension, then create a MetaMask1 wallet (if you haven't done so previously).

  2. Ensure the Network Dropdown at the top of MetaMask1 is set to Ethereum Mainnet, and that you have some ETH in your MetaMask1 wallet to cover gas fees.

  3. Add the aBLOCK token to MetaMask1:

  • Open MetaMask1 and scroll to the bottom of your Assets list
@druska
druska / engine.c
Created September 17, 2018 15:18
Quant Cup 1's winning order book implementation
/*****************************************************************************
* QuantCup 1: Price-Time Matching Engine
*
* Submitted by: voyager
*
* Design Overview:
* In this implementation, the limit order book is represented using
* a flat linear array (pricePoints), indexed by the numeric price value.
* Each entry in this array corresponds to a specific price point and holds
* an instance of struct pricePoint. This data structure maintains a list