Skip to content

Instantly share code, notes, and snippets.

View itoonx's full-sized avatar
👻
Deep

Makkhawan Voraboot itoonx

👻
Deep
View GitHub Profile
@itoonx
itoonx / multisig-redeemscript.go
Created August 6, 2021 09:00
redeem script of a 2 of 3 multi sig, to put in a P2SH address
package main
import (
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcutil"
)
func BuildMultiSigRedeemScript() (string, error) {
// you can use your wif
const pools = await Utils.multiCall([...Array(parseInt(poolLength)).keys()].map(id => {
return {
pid: id.toString(),
poolInfo: new Web3EthContract(abi, masterChef).methods[poolInfoFunctionName](id),
};
}));
@itoonx
itoonx / web3_multi_providers.js
Created May 28, 2021 14:38
multicall + web 3 multi provider
const axios = require("axios");
const { MultiCall } = require("eth-multicall");
const crypto = require("crypto");
const Web3 = require("web3");
const _ = require("lodash");
const { providers } = require("ethers");
@itoonx
itoonx / example_amm.js
Last active May 10, 2021 15:18
Example Swap -> AMM Model of Uniswap
/**
Example Swap -> AMM Model of Uniswap V1,V2
**/
// Testing online
// https://jsfiddle.net/itoonx/xqah6e9v/
const asset = 'BNB'
/*
* @Author: itoonx
* @Date: 2018-05-01 22:55:25
* @Last Modified by: itoonx
* @Last Modified time: 2018-08-30 08:14:49
*/
const fs = require('fs')
const path = require('path')
const chalk = require('chalk')
const fs = require('fs')
const path = require('path')
const httpStatus = require('http-status')
const EthereumTx = require('ethereumjs-tx')
const etherwallet = require('ethereumjs-wallet')
const { web3, engine } = require('../../config/web3provider')
const getERC20Balance = async (address_without_0x, contractAddress) => {
return new Promise(async (resolve, reject) => {
@itoonx
itoonx / AMMUniswap.md
Last active July 31, 2021 13:01
AMM Model of UniswapV2

AMM Model of UniswapV2

LP Token calculator - สูตรการหามูลค่า LP Token

1 LP Value = ( Total value of Pool / Circulating supply LP )

RAY Price = 10.85

RAY Amount = 1,486,494.518254 Token

// บอทปั้มเงิน TLM เกม Alien Worlds (เงินจะเอาไปแลกเงินจริงใน Binance ได้)
// ไว้ทดสอบเฉย ๆ อย่าเอาไปใช้จริง คนเขียนไม่รับผิดชอบต่อบั๊กใด ๆ ทั้งสิ้น
//
// วิธีใช้:
// 1. สมัคร + เข้า https://play.alienworlds.io/
// 2. ต้องเคย mine แบบ manual ก่อน 1 ครั้ง
// 3. ก๊อปสคริปท์นี้ไปแปะใน Console (F12)
// น่าจะมีบั๊กพวก rate limit อะไรทั้งหลาย กับ if/loop บางอันเอาออกได้
// ลองรันเล่น ๆ 5 ชม จาก user เปล่า ๆ ได้มา 8 TLM (ขึ้นกับดวงและอื่นๆด้วยมั่ง)
// ใครว่าง ๆ แก้เป็นยิงเข้า API โดยตรงไม่ผ่าน JS น่าจะเสถียรกว่าเยอะมาก
@itoonx
itoonx / cloudSettings
Last active November 24, 2020 16:44
cloudSettings
{"lastUpload":"2020-11-24T09:44:36.209Z","extensionVersion":"v3.4.3"}
@itoonx
itoonx / file.json
Created February 19, 2020 17:56
Bank
{
"th": {
"bbl": { "code": "002", "color": "#1e4598", "official_name": "BANGKOK BANK PUBLIC COMPANY LTD.", "nice_name": "Bangkok Bank" },
"kbank": { "code": "004", "color": "#138f2d", "official_name": "KASIKORNBANK PUBLIC COMPANY LTD.", "nice_name": "Kasikornbank" },
"rbs": { "code": "005", "color": "#032952", "official_name": "THE ROYAL BANK OF SCOTLAND PLC", "nice_name": "Royal Bank of Scotland" },
"ktb": { "code": "006", "color": "#1ba5e1", "official_name": "KRUNG THAI BANK PUBLIC COMPANY LTD.", "nice_name": "Krungthai Bank" },
"jpm": { "code": "008", "color": "#321c10", "official_name": "JPMORGAN CHASE BANK, NATIONAL ASSOCIATION", "nice_name": "J.P. Morgan" },
"mufg": { "code": "010", "color": "#d61323", "official_name": "THE BANK OF TOKYO-MITSUBISHI UFJ, LTD.", "nice_name": "Bank of Tokyo-Mitsubishi UFJ" },
"tmb": { "code": "011", "color": "#1279be", "official_name": "TMB BANK PUBLIC COMPANY LIMITED.", "nice_name": "TMB Bank" },
"scb": { "code": "014", "col