Skip to content

Instantly share code, notes, and snippets.

View thanhlmm's full-sized avatar
🔥
On fire

Thanh Le thanhlmm

🔥
On fire
View GitHub Profile
@thanhlmm
thanhlmm / config.json
Last active June 27, 2024 08:19
RPC list
{
"proxy": "",
"max_retries": 5,
"request_timeout": 60,
"phishing_db": ["https://cfg.rpchub.io/agg/scam-addresses.json"],
"phishing_db_update_interval": 3600,
"authority_db": [
{
"name": "goplus",
"url": "https://cfg.rpchub.io/agg/goplus-db.json",
@thanhlmm
thanhlmm / config.js
Created June 18, 2024 11:13
Convert chainlist to config
const extraRpcs = {
1: {
rpcs: [
// Quicknode -> tracks IP
{
url: "https://endpoints.omniatech.io/v1/eth/mainnet/public",
tracking: "none",
},
{
{"v":"5.8.1","fr":30,"ip":0,"op":292,"w":800,"h":600,"nm":"Day Night icon Small","ddd":0,"assets":[{"id":"comp_0","nm":"5","fr":30,"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Layer 114","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[400.001,325.723,0],"ix":2,"l":2},"a":{"a":0,"k":[425.508,325.223,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.3,"y":1},"o":{"x":0.45,"y":0},"t":22,"s":[{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[23.382,-18],[23.382,-18],[23.382,-18],[23.382,-18],[23.382,-18],[23.382,-18]],"c":true}]},{"i":{"x":0.3,"y":1},"o":{"x":0.45,"y":0},"t":36,"s":[{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[6.7,32.8],[17.865,8.874],[17.865,24.993],[44.651,24.993],[33.487,48.918],[33.487,32.8]],"c":true}]},{"t":45,"s":[{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o"
@thanhlmm
thanhlmm / token.csv
Created June 27, 2023 15:30
Token list
We can't make this file beautiful and searchable because it's too large.
contract_address,name
0x0000000000000000000000000000000000000000,Ethereum
0x000000000000073760fc462304360d9e887e4ef4,Fides
0x0000000000000af8fe6e4de40f4804c90fa8ea8f,EPS API
0x00000000000045166c45af0fc6e4cf31d9e14b9a,TopBidder
0x0000000000004946c0e9f43f4dee607b0ef1fa1c,Chi Gastoken by 1inch
0x000000000000657bb201dd00a0e4f2ae643c1533,Croc
0x000000000000c1cb11d5c062901f32d06248ce48,Liquid Gas Token
0x000000000000cb2d80a37898be43579c7b616844,REDUX
0x000000000000ce024a2c86451474057d3ad8ea33,Gastoken by QNWDao
@thanhlmm
thanhlmm / data.csv
Created June 27, 2023 15:20
Token list with name
We can't make this file beautiful and searchable because it's too large.
contract_address,name
0x0000000000000000000000000000000000000000,Ethereum
0x000000000000073760fc462304360d9e887e4ef4,Fides
0x0000000000000af8fe6e4de40f4804c90fa8ea8f,EPS API
0x00000000000045166c45af0fc6e4cf31d9e14b9a,TopBidder
0x0000000000004946c0e9f43f4dee607b0ef1fa1c,Chi Gastoken by 1inch
0x000000000000657bb201dd00a0e4f2ae643c1533,Croc
0x000000000000c1cb11d5c062901f32d06248ce48,Liquid Gas Token
0x000000000000cb2d80a37898be43579c7b616844,REDUX
0x000000000000ce024a2c86451474057d3ad8ea33,Gastoken by QNWDao
{
"v": "0x0",
"r": "0x706ba3cb6bbee0bd021d01141d6f867d99127531e7bddfc20833934df63cc70a",
"s": "0x587a88b840459c26819b541cf30fdcda82a36e5ebba8ea4be8542fa7434d600f",
"nonce": "0x1c",
"blockNumber": "0x1047c0a",
"from": "0x8980dbbe60d92b53b08ff95ea1aaaabb7f665bcb",
"to": "0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7",
"gas": "0x6ce90",
"gasPrice": "0x861c46800",
@thanhlmm
thanhlmm / sum_uint256.sql
Created January 7, 2023 11:06
Sum uint256
-- SELECT from_big_endian_64(FROM_HEX('00000000000000000000000000000000000000000000000000005af3107a4000')) AS integer_value
WITH input as (
SELECT ARRAY [ from_big_endian_32(FROM_HEX(SUBSTR(string_column, 1, 8))),
from_big_endian_32(FROM_HEX(SUBSTR(string_column, 9, 8))),
from_big_endian_32(FROM_HEX(SUBSTR(string_column, 17, 8))),
from_big_endian_32(FROM_HEX(SUBSTR(string_column, 25, 8))),
from_big_endian_32(FROM_HEX(SUBSTR(string_column, 33, 8))),
from_big_endian_32(FROM_HEX(SUBSTR(string_column, 41, 8))),
from_big_endian_32(FROM_HEX(SUBSTR(string_column, 49, 8))),
from_big_endian_32(FROM_HEX(SUBSTR(string_column, 57, 8))) ] as input1,
sR5PuI5lVU|7|PbmdQbyvPxHWPVEvhuhdl3hvQ3f|7l|TIAQu|o|AhbDvPBIxQk|o|AQsLBhBHAhbF|W|PTf7lVQvP8UAhkPxQTRAQxobFWQ7PbXvh
sR5PuI5lVU|A|PbmdQbyvPxHWPVEvhuhdl3hvQ3f|AP|TIAQu|8|AhbDvPBIxQk|R|AQsLBhBHAhbF|d|PTf7lVQvP8UAhkPxQTRAQxobFWQ7PbXvh
@thanhlmm
thanhlmm / App.jsx
Last active December 12, 2021 11:52
Frontend ELT
const TodoList = () => {
// Extract
const [todos, setTodos] = useState([]); // Todos loaded from backend
const [status, setStatus] = useState('Done');
const [keyword, setKeyWord] = useState('');
const [priority, setPriority] = useState('Important');
// Extract flow 1
const filteredTodos = useMemo(() => {
return todos.filter(item => {
@thanhlmm
thanhlmm / test.js
Last active November 26, 2021 15:07
Array select
const a = [1,2,3]
// Add item
a.push(4);
// Remove item 2
const newA = a.filter(item => item != 2)
// Check if 1 exist in array
a.includes(1)