Skip to content

Instantly share code, notes, and snippets.

View thanhson1085's full-sized avatar

Nguyen Sy Thanh Son thanhson1085

  • Hanoi, Vietnam
View GitHub Profile
// Use ethers JS libray
// Required ERC20 Abi
// Required Uniswap/Pancakeswap Router Abi
// Required Provider wallet (who provide the liquidity)
// Required Buyer wallet (who want to buy TEST token)
// Read docs https://docs.uniswap.org/protocol/V2/reference/smart-contracts/router-02#addliquidityeth
// Read docs https://docs.uniswap.org/protocol/V2/reference/smart-contracts/router-02#swapexacttokensfortokens
console.log('addLiquidity TEST BUSD ...')
let amm = new ethers.Contract(config.get('AMMRouterAddress'), ammRouterAbi, provider)
#!/bin/bash
touch .pwd
export $(cat .env | xargs)
WORK_DIR=$PWD
WS_SECRET="${WS_SECRET:-bgfmsp2r7TgIYA2HW48SkBQE6L4CUc}"
TOMOCHAIN_DIR="${TOMOCHAIN_DIR:-${HOME}/go/src/github.com/tomochain/tomochain}"
TOMOXSDK_DIR="${TOMOXSDK_DIR:-${HOME}/go/src/github.com/tomochain/tomox-sdk}"
BOT_DIR="${BOT_DIR:-${HOME}/tomox-market-maker}"
TOMORELAYER_DIR="${TOMORELAYER_DIR:-${HOME}/tomorelayer}"
const web3Rpc = require('../models/web3rpc')
const config = require('config')
const logger = require('../helpers/logger')
const BigNumber = require('bignumber.js')
let sleep = (time) => new Promise((resolve) => setTimeout(resolve, time))
var nonce = 0
async function run (pkey, to) {
const account = web3Rpc.eth.accounts.privateKeyToAccount('0x' + pkey)
#!/bin/bash
for i in {004..005}
do
A='{"type":"A","name":"'
B='","content":"xxxx","ttl":120,"priority":10,"proxied":true}'
DATA="${A}${i}${B}"
curl -X POST "https://api.cloudflare.com/client/v4/zones/xxx/dns_records" \
-H "X-Auth-Email: admin@tomochain.com" \
-H "X-Auth-Key: xxx" \
ssh-agent bash -c 'ssh-add ./tmp_key; git push origin devnet -f'
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see https://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# set the internal field separator to line break, so that we can iterate easily over the verify-pack output
wget https://dl.eff.org/certbot-auto
chmod +x certbot-auto
mv certbot-auto /usr/bin/certbot
certbot -d [domain]
crontab -e
0 5 * * 1 /usr/bin/certbot -q renew --post-hook "systemctl reload nginx"
watch -n 3 "wc -l logfile"
#!/bin/bash
cd /tmp && git clone https://github.com/tomochain/tomox-quickstart.git
cd tomox-quickstart && bash setup.sh
0x5248bfb72fd4f234e062d3e9bb76f08643004fcd
0x5ac26105b35ea8935be382863a70281ec7a985e9
0x09c4f991a41e7ca0645d7dfbfee160b55e562ea4
0xb3157bbc5b401a45d6f60b106728bb82ebaa585b
0x741277a8952128d5c2ffe0550f5001e4c8247674
0x10ba49c1caa97d74b22b3e74493032b180cebe01
0x07048d51d9e6179578a6e3b9ee28cdc183b865e4
0x4b899001d73c7b4ec404a771d37d9be13b8983de
0x85cb320a9007f26b7652c19a2a65db1da2d0016f
0x06869dbd0e3a2ea37ddef832e20fa005c6f0ca39