Skip to content

Instantly share code, notes, and snippets.

@plutoegg
plutoegg / BeehiveNECOwners
Created November 16, 2021 15:05
Beehive NEC owners
Address NEC Amount ETH Amount Sent on L1
0x55a3df57B7AAEC16a162fD5316f35bEC082821CF 688544.852 18.38652303 YES
0x34f1e87e890b5683EF7b011b16055113c7194C35 415103.5907 11.08469798 YES
0xB104241052a8D46893aB8E903d9d2Ce11FAaB5C5 269551.7561 7.19796184 YES
0x5c0AC266833E36E98edB52070bCeA5Be6C1145c6 179261.1312 4.786890654 YES
0xbC90B3Ce40fc3Ed921D910f3e046C65954fFF7cB 90673.02565 2.421282607 YES
0xd1a0931de7a002D0D47117404BcBB3443faFb618 44022.91369 1.175563675 YES
0x71344ADED219B25d7d33Aee358Ce12E60CAE83d0 37905.60424 1.012210407 YES
0xFD0436eF0cBf9198ec4c3837F5f2567DAC38D9b6 31450.14368 0.8398273392 YES
0xdFEa4755c067DfABAF0a18C88D226337874469aC 26497.10026 0.7075639921 YES
@plutoegg
plutoegg / TrustlessOTC.md
Created April 1, 2019 14:47
Using TrustlessOTC

Trustless OTC Trade

The Trustless OTC smart contract is deployed at (0x62f49e904af170Ea377F399aCa76C13fF25a6F5E)[https://etherscan.io/address/0x62f49e904af170ea377f399aca76c13ff25a6f5e#code]

This contract allows trading of any tokens, between two counterparties without the need for a trusted escrow.

The instructions here assume the use of MyCrypto or a similar wallet to interact with the Ethereum blockchain.

Setting up a new trade

@plutoegg
plutoegg / efx_auth.js
Created October 4, 2018 14:00
Trustless Developer Guide - Authentication Example
// This example shows how to generate the signature from a raw private key
// Signing using hardware wallets such as Ledger or Trezor can be done using their documentation
const ethUtils = require('ethereumjs-utils')
const privKey = /* Your Private Key */
const nonce = ((Date.now() / 1000) + 350) + ''
const hash = ethUtils.hashPersonalMessage(ethUtils.toBuffer(nonce.toString(16)))
const signature = ethUtils.ecsign(hash, privKey)
@plutoegg
plutoegg / efx_unlock.js
Last active October 4, 2018 13:57
Trustless Developer Guide - 7
const token = 'ZRX'
const amount = 15
const response = await efx.contract.unlock(token, amount)
// If tokens are still locked for a longer time period, permission is required to unlock
// This permission can be requested from Ethfinex
@plutoegg
plutoegg / efx_cancelOrders.js
Created September 24, 2018 14:45
Trustless Developer Guide - 7
const sig = await efx.sign(parseInt(orderId).toString(16))
const sigConcat = ethUtils.toRpcSig(sig.v, ethUtils.toBuffer(sig.r), ethUtils.toBuffer(sig.s))
await efx.cancelOrder(parseInt(orderId), sigConcat)
@plutoegg
plutoegg / efx_getOrdersAuth.js
Created September 24, 2018 14:35
Trustless Developer Guide - 6
const ethUtils = require('ethereumjs-utils')
const privKey = /* Your Private Key */
const nonce = ((Date.now() / 1000) + 10800) + ''
const hash = ethUtils.hashPersonalMessage(ethUtils.toBuffer(nonce.toString(16)))
const signature = ethUtils.ecsign(hash, privKey)
// Get all open orders
const openOrders = await efx.getOrders(null, null, nonce, signature)
@plutoegg
plutoegg / efx_getOrders.js
Created September 24, 2018 14:31
Trustless Developer Guide - 5
// Get all open orders
const openOrders = await efx.getOrders()
// Get all historical orders
const historicalOrders = await efx.getOrderHist()
@plutoegg
plutoegg / efx_submitOrder.js
Created September 24, 2018 13:30
Trustless Developer Guide - 4
const symbol = 'ZRXETH'
const amount = -15
const price = 0.0025
const orderId = await efx.submitOrder(symbol, amount, price)
@plutoegg
plutoegg / efx_websocket.js
Created September 24, 2018 13:18
Trustless Developer Guide - 0
const BFX = require('bitfinex-api-node')
const { Order } = require('./node_modules/bitfinex-api-node/lib/models')
const bfx = new BFX({
apiKey: '',
apiSecret: '',
ws: {
autoReconnect: true,
seqAudit: false,