Skip to content

Instantly share code, notes, and snippets.

View kendricktan's full-sized avatar

Kendrick Tan kendricktan

View GitHub Profile
@kendricktan
kendricktan / dump
Created July 22, 2020 02:38
ExpiringMultiPartLib
// With OneSplit.sol
0x616006610026600b82828239805160001a60731461001957fe5b30600052607381538281f3fe7300000000000000000000000000000000000000003014608060405260043610620000375760003560e01c8063bdc3f244146200003c575b600080fd5b8180156200004957600080fd5b50620000616200005b3660046200017e565b62000079565b6040516200007091906200036d565b60405180910390f35b600080826040516200008b90620000bc565b62000097919062000381565b604051809103906000f080158015620000b4573d6000803e3d6000fd5b509392505050565b615ae480620004ed83390190565b80356001600160a01b0381168114620000e257600080fd5b92915050565b600082601f830112620000f9578081fd5b813567ffffffffffffffff81111562000110578182fd5b62000125601f8201601f1916602001620004c4565b91508082528360208285010111156200013d57600080fd5b8060208401602084013760009082016020015292915050565b60006020828403121562000168578081fd5b620001746020620004c4565b9135825250919050565b60006020828403121562000190578081fd5b813567ffffffffffffffff80821115620001a8578283fd5b6101e0918401808603831315620001bd578384fd5b620001c883620004c4565b81358152602
@kendricktan
kendricktan / yaca_database.json
Last active November 27, 2020 07:18
Yet another cooking app's database
{
"f7704b1d-0dc7-4238-b072-55c9462e8457": {
"title": "The Best Banana Cake I've Ever Had | Sally's Baking Addiction",
"description": "This is absolutely the best banana cake I've ever had! It's supremely moist with cream cheese frosting, tons of banana, brown sugar, and cinnamon flavor.",
"url": "https://sallysbakingaddiction.com/best-banana-cake/",
"ingredients": [
"3 large ripe bananas (about 1 and 1/2 cups mashed)",
"1 teaspoon baking powder",
"1 teaspoon baking soda",
"1/2 teaspoon ground cinnamon",
@kendricktan
kendricktan / Lesson2.txt
Last active May 12, 2020 01:40
Russian Language Learning Dump
ДАВАЙТЕ ПОЗНАКОМИМСЯ
ПРИЯТНО ПОЗНАКОМИТЬСЯ
откуда
@kendricktan
kendricktan / index.js
Created April 29, 2020 07:09
Hegic.co index.js dump
This file has been truncated, but you can view the full file.
/*! For license information please see index.js.LICENSE.txt */
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/scripts/",n(n.s=349)}([function(e,t){"function"==typeof Objec
@kendricktan
kendricktan / gg.js
Created April 26, 2020 02:55
UMA Deploy with Ethers
const { ethers } = require("ethers");
const { legos } = require("@studydefi/money-legos");
const { BigNumber } = require("ethers/utils/bignumber");
const { RegistryRolesEnum } = require("../../common/Enums.js");
const { interfaceName } = require("../utils/Constants.js");
const HDWalletProvider = require("@truffle/hdwallet-provider");
const provider = new ethers.providers.JsonRpcProvider();
const hdwallet = new HDWalletProvider(
@kendricktan
kendricktan / links.txt
Created April 18, 2020 22:49
Generalizing flashloans for defi-discussions 2020
@kendricktan
kendricktan / gist:3af1fbdd3b6260ea571b9d61d7748967
Created April 15, 2020 08:52
Default Private Keys for Moonnet.space
Available Accounts
==================
(0) 0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1
(1) 0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0
(2) 0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b
(3) 0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d
(4) 0xd03ea8624C8C5987235048901fB614fDcA89b117
(5) 0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC
(6) 0x3E5e9111Ae8eB78Fe1CC3bb8915d5D461F3Ef9A9
(7) 0x28a8746e75304c0780E011BEd21C72cD78cd535E
@kendricktan
kendricktan / geth
Last active October 31, 2021 22:54
Ethereum Node Commands
geth --http --ws --http.addr "0.0.0.0" --http.port 8544 --ws.addr "0.0.0.0" --cache 8096
geth --http --ws --http.addr "0.0.0.0" --http.port 8544 --ws.addr "0.0.0.0" --cache 8096 --gcmode archive
mev-geth --http.api web3,net,eth,debug --ws.api web3,net,eth,debug --http --ws --http.addr "0.0.0.0" --http.port 8545 --ws.addr "0.0.0.0" --cache 8096 --gcmode full --graphql --graphql.vhosts '*' --rpc.txfeecap 0
@kendricktan
kendricktan / address2str.sol
Last active April 10, 2023 13:25
Solidity code to convert uint to string (v0.5.x)
function toAsciiString(address x) public view returns (string memory) {
bytes memory s = new bytes(40);
for (uint i = 0; i < 20; i++) {
byte b = byte(uint8(uint(x) / (2**(8*(19 - i)))));
byte hi = byte(uint8(b) / 16);
byte lo = byte(uint8(b) - 16 * uint8(hi));
s[2*i] = char(hi);
s[2*i+1] = char(lo);
}
@kendricktan
kendricktan / tfdh.py
Last active December 18, 2019 00:54
Terraform Deployment Helper
import argparse
import os
import subprocess
import sys
# Python 2 and Python 3 compatability
try:
subprocess_run = subprocess.run
except AttributeError: