Skip to content

Instantly share code, notes, and snippets.

View BeehiveNECOwners
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
View TrustlessOTC.md

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 Oct 4, 2018
Trustless Developer Guide - Authentication Example
View efx_auth.js
// 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 Oct 4, 2018
Trustless Developer Guide - 7
View efx_unlock.js
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 Sep 24, 2018
Trustless Developer Guide - 7
View efx_cancelOrders.js
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 Sep 24, 2018
Trustless Developer Guide - 6
View efx_getOrdersAuth.js
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 Sep 24, 2018
Trustless Developer Guide - 5
View efx_getOrders.js
// Get all open orders
const openOrders = await efx.getOrders()
// Get all historical orders
const historicalOrders = await efx.getOrderHist()
@plutoegg
plutoegg / efx_submitOrder.js
Created Sep 24, 2018
Trustless Developer Guide - 4
View efx_submitOrder.js
const symbol = 'ZRXETH'
const amount = -15
const price = 0.0025
const orderId = await efx.submitOrder(symbol, amount, price)
@plutoegg
plutoegg / efx_websocket.js
Created Sep 24, 2018
Trustless Developer Guide - 0
View efx_websocket.js
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,