Skip to content

Instantly share code, notes, and snippets.

Avatar

Fabien bonustrack

View GitHub Profile
View YEARN.MD

1: Go on the settings page here: https://snapshot.page/#/ybaby.eth/settings

2: Delete the strategies "erc20-balance-of" and "erc20-balance-of-delegation"

3: Add a strategy "pagination" with these params:

[
  {
 "symbol": "YFI",
View FEI.MD
{
  "symbol": "FEI-TRIBE Staked LP",
 "strategy": {
@bonustrack
bonustrack / index.ts
Last active Sep 26, 2020
STONK pool balances block 10356001
View index.ts
// https://etherscan.io/tx/0xeb008786a7d230180dbd890c76d6a7735430e836d55729a3ff6e22e254121192 Transaction
// https://etherscan.io/address/0x1985365e9f78359a9B6AD760e32412f4a445E862 Balancer pool
const { JsonRpcProvider } = require('@ethersproject/providers');
const snapshot = require('@bonustrack/snapshot.js/src');
// https://thegraph.com/explorer/subgraph/bonustrack/balancer?query=STONK%20pool%20before%20exploit
const poolShares = require('./subgraph-pool-shares.json');
const url = 'https://eth-mainnet.alchemyapi.io/v2/rXKbp7PTFm6hcrxU8NL-JGp5RMfRHDwg';
const provider = new JsonRpcProvider(url);
View balancer-verify-message.js
const { verifyMessage } = require('@ethersproject/wallet');
async function verify(signedMessage, sig, address, type) {
const message = JSON.parse(JSON.stringify(signedMessage));
if (type === 'author') {
delete message.authors[0].sig;
delete message.relayers;
}
if (type === 'relayer') delete message.relayers[0].sig;
const recovered = await verifyMessage(JSON.stringify(message), sig);
View balancer.js
const fs = require('fs');
const { getAddress } = require('ethers/utils');
const subgraphResult = require('./poolTokens.json');
const { mainnet } = require('./deployed.json');
const trustwalletImgs = require('./trustwallet.json');
const tokens = [];
const deployedTokens = mainnet.tokens.map(token => token.address.toLowerCase());
const tokensIds = [];
View messenger.js
const crypto = require('crypto');
const Mnemonic = require('bitcore-mnemonic');
const { publicKeyCreate } = require('secp256k1');
const objectHash = require('@obyte/ocore/object_hash');
const { Client } = require('obyte/lib');
const { sign } = require('obyte/lib/internal');
const { fromWif, toWif } = require('obyte/lib/utils');
// Settings
@bonustrack
bonustrack / secretHash.js
Last active Apr 23, 2019
Generate secret hash for SteemConnect application
View secretHash.js
const crypto = require('crypto');
const secret = 'random string';
const secretHash = crypto.createHash('sha256').update(secret).digest('hex');
console.log('Secret hash', secretHash);
View headers_commission.js
/*jslint node: true */
"use strict";
var crypto = require('crypto');
var async = require('async');
var db = require('./db.js');
var conf = require('./conf.js');
var _ = require('lodash');
var storage = require('./storage.js');
var eventBus = require('./event_bus.js');
View keybase.md

Keybase proof

I hereby claim:

  • I am bonustrack on github.
  • I am bonustrack (https://keybase.io/bonustrack) on keybase.
  • I have a public key whose fingerprint is 161A EB18 0A30 19E9 4AE7 8CE8 4C27 FBDF 5B0F EE36

To claim this, I am signing this object:

View gist:697bea5cbb92f5d905a3eacafb234d1d
> /usr/local/bin/npm ls
steem@0.3.28 /Users/fabien/WebstormProjects/steem
├─┬ babel-cli@6.16.0
│ ├─┬ babel-core@6.17.0
│ │ ├─┬ babel-code-frame@6.16.0
│ │ │ └── js-tokens@2.0.0
│ │ ├─┬ babel-generator@6.17.0
│ │ │ ├─┬ detect-indent@3.0.1
│ │ │ │ ├── get-stdin@4.0.1