As of hardhat v2.4.0, there is now support for setting arbitrary values in any contract. This is a very power feature when used with mainnet forking, as it unlocks the ability to manipulate the state of any forked contract. I find it extremely helpful during testing, in particular when I need a test account to be loaded up with tokens that can't be bought on DEXes (e.g. curve LP tokens or yearn…
Prelude While browsing CT, a post by @fifikobayashi caught my eye: MEV out in the wild! For someone who has only been living in the protocol and application layer, I saw this as the opportunity for me to start a side project ultilizing MEV (somehow). and get familiar with the infrastructure side of things. Project Hunting The flashbots repository was quite organized, and within minutes, I found…
Recently, I found myself increasingly reliant on (free) 3rd party tools such as ethtx.info to decode and debug failed mainnet transactions. This made me felt quite uneasy as: I don't know who made it I did not know how they did it What do I do if the service is down when I desperately need it? No one to complain…. And so, I decided to write one myself.
Update #1 solc-sjw has been renamed to solt. Read the accompanying blogpost. It is a well known fact that the hardest part of being a solidity developer is verifying your deployed contracts on etherscan. (See here, here, here, and here) As a defi veteran (8 months and counting), I've had countless nightmarish encounters with verifying contracts on etherscan. Now that I've emerged victorious from…
It's 2022. Quantitative easing in response to the covid-19 economic fallout has resulted in a cobra effect. The whole world has plunged into the worse recession yet. Traditional finance is gone, while Ethereum is the only glimmer of hope for the new fintech revolution – One that can save the world from this economic nightmare. Enter: you. You are a talented and aspiring developer who wants…
Requires dapp.tools to be installed. This is just a cheatsheet for me to reference in the future. HEVM Create Directory for HEVM State HEVM uses an empty git directory to track state changes. mkdir /tmp/hevm-state cd /tmp/hevm-state git init git commit --allow-empty -m 'init' Get Contract Bytecode w/ Args Appended If you're deploying a contract, make sure --calldata is empty and you have: --code…
Recently, a a good friend of mine has been explaining to me how powerful the traverse function is in Haskell. The main point being that it's a generalization of both map and fold. For those who are unfamiliar, traverse has the following function definition: traverse :: (Applicative f, Traversable t) => (a -> f b) -> t a -> f (t b) At first glance, it was very unclear to me how one could obtain the…
Grab the source code for the blogpost here. Recommended prereading: public-key cryptography snarkjs tutorial truffle ethers Prelude For the past few months, I've been building a couple of toy dApp projects on Ethereum that ultilize zero knowledge proofs, specifically zk-SNARKs. As there is little material out there regarding building dApps that ultilizes zero knowledge proofs, I thought I would…
Prelude For the past few months I've been working with the Ethereum Foundation on a Minimal Anti Collusion Infrastructure (MACI) project that utilises zero knowledge proofs. Working on this project has been technically challenging and thorougly enjoyable but not without some difficulties. As the main form of communication between collaborators were through google hangouts / signal calls, there…
Prelude This blog post goes through the technical internal workings of heiswap.exchange, for anyone who wants to learn how to build their own zero-knowledge mixer, or for anyone who is simply curious. This blog post assumes you have a basic understanding of elliptical curves, public-key cryptography, and the bitcoin protocol. Introduction Source: cointelegraph.com What is a Mixer? A mixer is tool…
Prelude Woah! I wasn't expecting this level of attention on my current side project - heiswap. Apologies to everyone who I didn't reply to on twitter, the amount of attention I got was a little bit overwhelming and hard to keep up with… Just some guy retweeting my tweet To anyone wondering how to pronounce the project name, its heiswap (hey-swap) :-) Updates Just a couple quick updates on…
Motivation I was looking for a new project to work on, stumbled on Vitalik's HackMD post, and thought why not? It sounded like fun, and so heiswap.exchange was born. Quicklinks (Latest) Smart contract deployed on Ropsten Solidity + WebApp Source Code (OLD) Smart contract deployed on Ropsten Introduction Heiswap (黑 swap) is an Ethereum mixer that allows users to ‘wash’ their ETH in a…
Prelude I've been trying to find a quick and easy example on how to setup application metrics logging on kubernetes using prometheus and grafana, from someone with minimal kubernetes experience. However after scouring the web, the examples I could find had lots of assumed knowledge on how kubernetes and its tooling worked, or just overly verbose. This article is more for me as a reference guide on…
Prelude This post is merely a reference guide for me to setup Kubernetes with Ingress. What's The Difference Between Ingress And A Loadbalancer? LoadBalancer lives on L4 on the OSI model, Ingress services lives on L7 of the OSI model. Use ingress for a single app with a single domain to be mapped to an IP address, use ingress to map multiple subdomains to multiple apps within your cluster. For…
Background While doing my research on bulletproofs, a common term kept popping up – Pederson Commitments. Only problem was that most of the articles I found online were very academic based, which contained lots of big words that I didn't understand. This article will attempt to explain the motivation behind pederson commitments, how they work, accompanied with simple examples. Pederson…
Motivation RSA (Rivest-Shamir-Adleman) is one of the first public-key cryptosystems and is widely used for secure data transmission. In such a cryptosystem, the encryption key is public and is different from the decryption key which is kept secret. If I wanted to comprehend zero knowledge proofs, then understanding the grand-daddy of public-key cryptosystems is a must. Background Maths Exponential…
Motivation In my quest to understand zero knowledge proofs from the ground up, I've decided to go back to the basics, and really understand how everyday cryptography tools work, not just how to use them. In this post, I'll attempt to explain how and why the diffie hellman key exchange protocol works, along with proofs and a working example. The examples are purely for educational purposes only!…
Prelude Before starting out my last Haskell project, I've been trying usage examples for ExceptT nested within StateT and other MonadTransformers. Only problem is that I couldn't really find any nice examples without the constant usage of lift. I was thinking about writing a long winded blog post, but code is more powerful than words (and people have done it better than I could), so I decided to…
Background When I started developing in Haskell, there were many opinions on what build-tools, what IDE/text-editor you should use. Each coming with their own pros and cons. After playing around with the number of options, I eventually found a setup which just works, and would like to share that tool stack with anyone / newcomers who are still undecided on what toolchain they should use. Project…
Prelude For one of my (now retired) projects, I wanted to make use of a bunch of Instagram data, and so I scrapped them. Amongst the scrapped data was all the cities in the world, along with the number of Instagram posts that ‘tagged’ that particular city. I thought it would be cool to do a quick visualization of the data, and so I did. Most Instagrammed Cities Should you wish to play…
Prelude Recently, I've been playing around with a really neat accounting tool: ledger-cli. I love the simplicity of it, because all it is is a text-file that respects the ledger format. And because it's just a text-file, it works pretty much everywhere: Linux, Windows, MacOS, you name it. Not only that, I don't have to download legacy GTK2/GTK3/QT libraries to display the GUI. And, because it's a…
Prelude State monads, introduced to me during the data61 functional programming course was one of my most memorable encounter with a monad. This was mainly because things only started to clicked and made a tiny bit of sense after a couple of weeks of frustration. This article is my attempt to explain the underlying mechanics of the State Monad to try and relief the frustration of whomever who was…
This post is merely to guide future me on how to install GHC v8.x.x on Ubuntu 16.04 without using stack. e.g. For ghc 8.2.2 sudo add-apt-repository ppa:hvr/ghc sudo apt-get update sudo apt-get install ghc-8.2.2 cabal-install-2.2 sudo ln -s /opt/ghc/bin/ghc-8.2.2 /usr/bin/ghc sudo ln -s /opt/ghc/bin/ghci /usr/bin/ghci sudo ln -s /opt/cabal/bin/cabal-2.2 /usr/bin/cabal
Prelude A couple of days ago, an idea came to mind: Crypto-currencies that have a high marketcap must have a consensus on quality discussions within their community that distinguishes themselves from the rest of the pack. Sounds like a reasonable hypothesis, no? Now if I could somehow find cryptocurrencies with a similar pattern of quality discussions on Reddit which haven't ‘mooned’…
Assumed Knowledge: Convolutional Neural Networks, Variational Autoencoders Disclaimer: This article does not cover the mathematics behind Capsule Networks, but rather the intuition and motivation behind them. What are Capsule Networks and why do they exist? The Capsule Network is a new type of neural network architecture conceptualized by Geoffrey Hinton, the motivation behind Capsule Networks is…
Motivation: I've been trying to find a tutorial on building an Oracle in Ethereum, only problem is that the articles online are either out of date (pre web3 v1.0.x) or the source code provided is structured in such a way that makes it incredibly tough to follow (having python, c# and javascript in one project with no clear description of what each language is doing and why its necessary). This…
I've been wanting to get my hands dirty with the innards of blockchain lately, combine that with my itch to do a project in Haskell, the bch project (blockchain in haskell) was born. This article will walk you through building a minimal blockchain in Haskell. So what is a blockchain anyway? According to google: In layman terms, a blockchain is just an database. Data is stored in…
What is ZENChat? ZENChat is a messaging application that ultilizes the ZEN blockchain to provide a fully secure, private, and anonymous way to send messages up to 340 bytes. It is also UTF-8 compatiable, meaning you can send emojis over the blockchain. This tutorial will help you get started in setting up ZENChat. Setting up zend for ZENChat You can find zen.conf in the following locations: -…
I just wanted to build something cool using machine learning on a bunch of public images. But after showing it to a couple of my “friends” they thought it was too creepy and Selfie Central might sue me for breaking their platform policy and I should stop doing it. So, I did what most sane people would do - write a blog post detailing how I did it, and open source it.
makerarepepes.me Pepes, can't get enough of them, that's why I made a website that turns rough sketches of pepes into a rare pepe (unique to your sketch!). The approach for this is very similar to how I did my Bob Ross styled paintings, the only difference is the architecture of the network and the dataset. Network The network uses the pix2pix architecture, so if you would like further reading on…
I've been playing around with autoencoders, and have been fully fascinated with the idea of using one in a cool, fun project, and so drawlikebobross was born. What is drawlikebobross? drawlikebobross aims to turn a patched color photo into a Bob Ross styled photo, like so: Basically turning rough color patches into an image that (hopefully) looks like it could be drawn from Bob Ross. It also…
Link to the boilerplate project Recently I've been building a RESTful microservice, one the the requirements that the microservice has is that it has MessagePack support (it's like JSON but smaller). Flask doesn't support MessagePack by default, and the documentation on extending Flask for custom Request types was lacking at the time of this writing, and as such I've decided to write a post to…