1 LP Value = ( Total value of Pool / Circulating supply LP )
RAY Price = 10.85
RAY Amount = 1,486,494.518254 Token
let imageBuffer = Buffer.from(body.profilePicture.split(',')[1], 'base64'); | |
console.log(imageBuffer); | |
Jimp.read(imageBuffer, function(err, image) { | |
if (err) { | |
context.done(err, | |
prepareErrorResponse(response, 'Unable to remove EXIF data from profile picture')); | |
} | |
console.log('before transform: ', image); | |
image = image.resize(400, 400).exifRotate((err, exifRotatedData) => { |
import random | |
# Returns a random prime number with n bits | |
def generate_prime(n): | |
while True: | |
p = random.getrandbits(n) | |
if is_prime(p): | |
return p | |
# Returns the result of evaluating a polynomial with coefficients |
TL;DR - jump to the challenge at the end | |
====ON BLOCKING EVIL BOTS===== | |
On a resent job interview I had for "Incapsula" a few days ago I was put to the challenge to break | |
their bot protection mechanism. Apparently node.js is not that common among bot writes and most bots | |
are not able to run javascript. | |
The challenge had two parts - | |
1. find what the code does. | |
2. implement a bot that will break the code without using js. | |
3. think how to make this code unbreakable |
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), | |
}; | |
})); |
const axios = require("axios"); | |
const { MultiCall } = require("eth-multicall"); | |
const crypto = require("crypto"); | |
const Web3 = require("web3"); | |
const _ = require("lodash"); | |
const { providers } = require("ethers"); |
/** | |
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) => { |