text: /* Copyright (C) 2016 Augustus York Rushton Pash - All Rights Reserved
   * You may use, distribute and modify this code under the
   * terms of the license, which was distrubted with this code and located
   * at: https://github.com/augustuspash/CentralDankDashboard
   *
   * You should have received a copy of the license with
   * this file. If not, please visit: https://github.com/augustuspash/CentralDankDashboard
   */
  
  
  // contract abi
  var abiDMX = [ { "constant": true, "inputs": [ { "name": "_address", "type": "address" }, { "name": "_key", "type": "string" } ], "name": "getPersonalRecordListingIndex", "outputs": [ { "name": "index", "type": "uint256" } ], "payable": false, "type": "function" }, { "constant": true, "inputs": [ { "name": "_meme", "type": "string" } ], "name": "listingLength", "outputs": [ { "name": "length", "type": "uint256" } ], "payable": false, "type": "function" }, { "constant": true, "inputs": [], "name": "exchangeFee", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "type": "function" }, { "constant": true, "inputs": [ { "name": "_meme", "type": "string" } ], "name": "getDirectPrice", "outputs": [ { "name": "price", "type": "uint256" } ], "payable": false, "type": "function" }, { "constant": false, "inputs": [ { "name": "_meme", "type": "string" }, { "name": "_price", "type": "uint256" }, { "name": "_amount", "type": "uint256" }, { "name": "_key", "type": "string" } ], "name": "endListing", "outputs": [ { "name": "success", "type": "bool" } ], "payable": false, "type": "function" }, { "constant": false, "inputs": [ { "name": "_meme", "type": "string" }, { "name": "_amount", "type": "uint256" } ], "name": "buyFromExchange", "outputs": [ { "name": "success", "type": "bool" } ], "payable": false, "type": "function" }, { "constant": false, "inputs": [ { "name": "_meme", "type": "string" }, { "name": "_price", "type": "uint256" }, { "name": "_amount", "type": "uint256" }, { "name": "_key", "type": "string" } ], "name": "placeListing", "outputs": [ { "name": "success", "type": "bool" } ], "payable": false, "type": "function" }, { "constant": false, "inputs": [ { "name": "_meme", "type": "string" }, { "name": "_person", "type": "address" }, { "name": "_price", "type": "uint256" }, { "name": "_amount", "type": "uint256" }, { "name": "_key", "type": "string" } ], "name": "buy", "outputs": [ { "name": "success", "type": "bool" } ], "payable": false, "type": "function" }, { "constant": false, "inputs": [ { "name": "_to", "type": "address" }, { "name": "_value", "type": "uint256" } ], "name": "transferDankness", "outputs": [], "payable": false, "type": "function" }, { "constant": true, "inputs": [ { "name": "_address", "type": "address" } ], "name": "personalRecordLength", "outputs": [ { "name": "length", "type": "uint256" } ], "payable": false, "type": "function" }, { "constant": false, "inputs": [], "name": "destroy", "outputs": [], "payable": false, "type": "function" }, { "constant": false, "inputs": [ { "name": "fee", "type": "uint256" } ], "name": "changeExchangeFee", "outputs": [], "payable": false, "type": "function" }, { "constant": true, "inputs": [ { "name": "_meme", "type": "string" } ], "name": "getCountPrice", "outputs": [ { "name": "price", "type": "uint256" } ], "payable": false, "type": "function" }, { "constant": false, "inputs": [ { "name": "_meme", "type": "string" }, { "name": "_person", "type": "address" }, { "name": "_price", "type": "uint256" }, { "name": "_amount", "type": "uint256" }, { "name": "_key", "type": "string" } ], "name": "destroyListing", "outputs": [ { "name": "success", "type": "bool" } ], "payable": false, "type": "function" }, { "constant": false, "inputs": [ { "name": "_newFunds", "type": "address" } ], "name": "changeFunds", "outputs": [], "payable": false, "type": "function" }, { "constant": false, "inputs": [ { "name": "_newOwner", "type": "address" } ], "name": "changeOwner", "outputs": [], "payable": false, "type": "function" }, { "constant": true, "inputs": [ { "name": "_meme", "type": "string" }, { "name": "_person", "type": "address" }, { "name": "_key", "type": "string" } ], "name": "getListing", "outputs": [ { "name": "key", "type": "string" }, { "name": "person", "type": "address" }, { "name": "price", "type": "uint256" }, { "name": "amount", "type": "uint256" } ], "payable": false, "type": "function" }, { "constant": true, "inputs": [ { "name": "_address", "type": "address" }, { "name": "_index", "type": "uint256" } ], "name": "getPersonalRecordKey", "outputs": [ { "name": "key", "type": "string" } ], "payable": false, "type": "function" }, { "constant": false, "inputs": [ { "name": "_meme", "type": "string" }, { "name": "_to", "type": "address" }, { "name": "_value", "type": "uint256" } ], "name": "transferMeme", "outputs": [], "payable": false, "type": "function" }, { "constant": true, "inputs": [ { "name": "_meme", "type": "string" }, { "name": "_index", "type": "uint256" } ], "name": "getListing", "outputs": [ { "name": "key", "type": "string" }, { "name": "person", "type": "address" }, { "name": "price", "type": "uint256" }, { "name": "amount", "type": "uint256" } ], "payable": false, "type": "function" }, { "constant": true, "inputs": [ { "name": "_address", "type": "address" }, { "name": "_index", "type": "uint256" } ], "name": "getPersonalRecordListingIndex", "outputs": [ { "name": "index", "type": "uint256" } ], "payable": false, "type": "function" }, { "inputs": [ { "name": "_dankness", "type": "address", "index": 0, "typeShort": "address", "bits": "", "displayName": "&thinsp;<span class=\"punctuation\">_</span>&thinsp;dankness", "template": "elements_input_address", "value": "0x0e637B6357EC372084b6D89A2F15C6FA5ad79885" }, { "name": "_memes", "type": "address", "index": 1, "typeShort": "address", "bits": "", "displayName": "&thinsp;<span class=\"punctuation\">_</span>&thinsp;memes", "template": "elements_input_address", "value": "0x7170A31bd1de5d9aFcAb42423b5573b6B0e60462" }, { "name": "_fundManager", "type": "address", "index": 2, "typeShort": "address", "bits": "", "displayName": "&thinsp;<span class=\"punctuation\">_</span>&thinsp;fund Manager", "template": "elements_input_address", "value": "0x75e5EF756c5e45767a415A8bd73Df67108bF5e2E" }, { "name": "_owner", "type": "address", "index": 3, "typeShort": "address", "bits": "", "displayName": "&thinsp;<span class=\"punctuation\">_</span>&thinsp;owner", "template": "elements_input_address", "value": "0x75e5EF756c5e45767a415A8bd73Df67108bF5e2E" } ], "type": "constructor" } ];
  
  var DMXContract;
  var DMX;
  var DMXAddress = "0xE27cdFDF4e10F3351A5fB5518a4Ef7B848d109FA";
  
  function loadDMX() {
      // creation of contract object
      DMXContract = web3.eth.contract(abiDMX);
  
      // initiate contract for an address
      DMX = DMXContract.at(DMXAddress);
  }