Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am nuevoalex on github.
  • I am nuevoalex (https://keybase.io/nuevoalex) on keybase.
  • I have a public key ASBcasK32uI68O4iOgYkEl0fkWrwA9xOH6JhQdsGeN8CEgo

To claim this, I am signing this object:

0xcf820822fccf17a1241bac4f799d53724aea7138
var Augur = require("augur.js");
var augur = new Augur();
var ethereumNode = { http: "http://127.0.0.1:8545", ws: "ws://127.0.0.1:8546" };
augur.connect({ ethereumNode });
augur.api.Cash.approve({
_spender: augur.contracts.addresses[augur.rpc.getNetworkID()].Augur,
contract /home/alex/Work/augur-core/source/contracts/Controlled.sol:Controlled:
============ Results ===========
EVM Code Coverage: 97.6%
Parity Multisig Bug 2: False
Callstack Depth Attack Vulnerability: False
Transaction-Ordering Dependence (TOD): True
Timestamp Dependency: False
Re-Entrancy Vulnerability: False
Assertion Failure: False
Flow1
[
{
"constant": true,
"inputs": [],
"name": "name",
"outputs": [
{
"name": "",
"type": "string"
}
pragma solidity ^0.4.20;
contract Controller {
function addToWhitelist(address _target) public returns (bool);
function removeFromWhitelist(address _target) public returns (bool);
function assertIsWhitelisted(address _target) public view returns (bool);
function registerContract(bytes32 _key, address _address, bytes20 _commitHash, bytes32 _bytecodeHash) public returns (bool);
function getContractDetails(bytes32 _key) public view returns (address, bytes20, bytes32);
function unregisterContract(bytes32 _key) public returns (bool);
function lookup(bytes32 _key) public view returns (address);
@nuevoalex
nuevoalex / EscapeHatchControllerProcedure.md
Last active July 20, 2018 17:28
EscapeHatchController Procedure

EscapeHatchController Procedure

Create Flattened Contract

Create the flattened contract code by running the following from the augur-core repo:

npm run build:flattener
cd source/contracts
../../venv/bin/solidity_flattener --allow . external/EscapeHatchController.sol > FlatEscapeHatchController.sol
[
{
"constant": true,
"inputs": [],
"name": "name",
"outputs": [
{
"name": "",
"type": "string"
}

Known Contract Bugs

The following vulnerabilities / bugs are already known and are not eligible for bounty:

Incorrect Reporting Fee Calculation

The reporting fee in Augur is calculated and adjusted by comparing the OI within the platform to a target OI which is based on the price of REP. The goal of this is to dynamically adjust the fee rate downward when the price is too speculative and upward when the price does not reflect the fees being collected.

There is an error in the current contracts however which will prevent the fee from ever rising. Namely the getRepMarketCapInAttoeth function does not properly convert units and will always be many orders of magnitude too high when comparing to the target market cap.

While this is a very serious problem for the platform long term the intention is to release a v2 of the contracts within a relatively short time frame and since the price of REP is still highly speculative relative to OI this will almost certainly not become a problem.

@nuevoalex
nuevoalex / error.js
Created October 24, 2018 21:14
Error connecting to Rinkeby node
[ethrpc] http-transport unexpected status code IncomingMessage {
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: null,
pipesCount: 0,
flowing: true,