Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

fbslo

🏠
Working from home
View GitHub Profile
View metamask.js
async function sendTx(){
let accounts = await ethereum.request({ method: 'eth_requestAccounts' });
let your_address = ''
let amount = 1
const transactionParameters = {
nonce: '0x00', // ignored by MetaMask
to: your_address, // Required except during contract publications.
from: accounts[0], // must match user's active address.
chainId: 1, // Used to prevent transaction reuse across blockchains. Auto-filled by MetaMask.
gas: '0x186A0',
View Uniswap.json
{
"name": "uniswap",
"timestamp": "2021-03-28T14:37:21.973Z",
"version": {
"major": 1,
"minor": 3,
"patch": 1
},
"tags": {},
"logoURI": "/images/coins/wbnb.png",
View ConvertWithTransfer.sol
// File: node_modules\@openzeppelin\contracts\token\ERC20\IERC20.sol
pragma solidity ^0.5.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
interface IERC20 {
/**
View ConvertWithBurn.sol
// File: node_modules\@openzeppelin\contracts\token\ERC20\IERC20.sol
pragma solidity ^0.5.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
interface IERC20 {
/**
View gist:7dfae1b50136a3fc16560903685fa4fb
var Twit = require('twit')
const CONSUMER_KEY=''
const CONSUMER_SECRET=''
const ACCESS_TOKEN=''
const ACCESS_TOKEN_SECRET=''
var T = new Twit({
consumer_key: CONSUMER_KEY,
consumer_secret: CONSUMER_SECRET,
View witness-pinger.js
var ping = require('ping');
var hive = require("@hiveio/hive-js")
var host = "ipAddress"
var fromNumber = "+1..."
var toNumber = "+1..."
var accountSid = 'TwillioSID';
var authToken = 'TwillioAPISecret';
var owner = 'fbslo'
var privateSignigKey = "5J..."
View whe-config-explained.env
#FRONTEND
#Hive Engine (HE) token name
TOKEN_NAME=
#HE token symbol
TOKEN_SYMBOL=
#Number of decimal places HE token has
HIVE_TOKEN_PRECISION=
#Number of decimal places Ethereum token has
@fbslo
fbslo / twitter-deleter.js
Created Oct 29, 2020
Delete tweets older than 23h
View twitter-deleter.js
const Twit = require('twit')
const USERNAME = 'GPujs'
//get this from https://developer.twitter.com/en/portal/dashboard
const CONSUMER_KEY = ''
const CONSUMER_SECRET = ''
const ACCESS_TOKEN = ''
const ACCESS_TOKEN_SECRET = ''
View bitcoiner-twitter-bot.js
/* I threw this together in one hour, so it's not pretty, no error handling,
* not tested...
* Enjoy ;)
*/
const abi = [{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_account","type":"address"}],"name":"unBlacklist","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutabilit
View wHIVE
pragma solidity ^0.5.11;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.