Gas Golfing by Optimizing Storage

What is storage in Solidity?


The do’s and don’ts

Photo by NRKbeta on Unsplash


Cheat Sheet

Photo by Gabby K from Pexels (not actually discrete math)

1. Definitions

// Set A contains elements 1,2 and 3
A = {1,2,3}
// 2 is an element of A
2∈A
// 4 is not an element of A
4∉A

2. Number Sets

Naturals    N = {1,2,3,4,...}
Integers Z = {...,-2,-1,0,1,2,...}
Rationals Q = Ratio of 2 integers. example: 1/2
Irrationals Q′= Can't be represented as ratios of integers
Real R = Q and Q′
Imaginary I = Everything not in the reals. Ex: (√x = -1)
Complex C = Reals and imaginaries

3. Set Equality

A = {1,2,3}
B = {2,3,2,2,3,1,2,3,2,1,1,2,3,2,2,3,1,1,3,2,1}
A = B

4. Set Builder Notation

A = {1,2,3,4,5,6,7,8,9}//…


Validating for Staleness


The Math Behind The Madness

  1. The governance protocol, for which I was responsible for.
  2. And the oracle which would do the tweeting, which Patrick was in charge of.

The Premise


Does it work yet?

Image by mohamed Hassan from Pixabay


Get crypto prices in a single function call

Photo by Miloslav Hamřík on Pixabay.


Earn interest using the Aave protocol: a JavaScript tutorial

AAVE


Find and use oracles to retrieve off-chain data in your smart contracts

Image by Gerd Altmann from Pixabay

How to Use Chainlink Oracles


Choosing who we trust and share our lives with

Photo by Sam Manns on Unsplash

Alex Roan

Engineer at Chainlink Labs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store