title: Unable to access my contract function with web3.eth.contract
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>//Contract build .json to js obj
  import { abi } from './contract.js'
  
  //Init web3
  import { getWeb3 } from  './getWeb3'
  
  // Import are working fine.
  
  export const getTokenContract = () =&gt; (
    new Promise((resolve, reject) =&gt; {
      getWeb3.then(web3 =&gt; { //Get web3
        var contract = web3.eth.contract(abi) //Instance contract with json abi
        var instance = contract.at("0x918daf9d0bd5c927ca8f1c5776e7c0c200be0fc23994dbe34dd9c9669c6a900d") //Get adress of the contract
        console.log(contract)
        resolve(instance)
      })
    })
  )</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.1/react.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.1/react-dom.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I try to access my smart contract functions inside the instance. While I console.log, the function present in the abi are correctly display.</p>
  
  <p>No functions is avalaible from the adress.
  For exemple:</p>
  
  <p>instance.getFidelity...</p>
  
  <p>getFidelity isn't defined so crash.</p>
  
  <ul>
  <li>testrpc launched.</li>
  <li>truffle compile</li>
  <li>truffle migrate (success deployed at 0x918...)</li>
  </ul>
  
  <p>Abi json:
  <div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// Token Interface
  export const Token = [
    {
      "contractName": "MetaCoin",
      "abi": [
        {
          "constant": false,
          "inputs": [
            {
              "name": "addr",
              "type": "address"
            }
          ],
          "name": "getFidelity",
          "outputs": [
            {
              "name": "",
              "type": "uint256"
            }
          ],
          "payable": false,
          "type": "function"
        },
        {
          "constant": true,
          "inputs": [],
          "name": "owner",
          "outputs": [
            {
              "name": "",
              "type": "address"
            }
          ],
          "payable": false,
          "type": "function"
        },
        {
          "constant": false,
          "inputs": [
            {
              "name": "receiver",
              "type": "address"
            },
            {
              "name": "amount",
              "type": "uint256"
            }
          ],
          "name": "sendCoin",
          "outputs": [
            {
              "name": "sufficient",
              "type": "bool"
            }
          ],
          "payable": false,
          "type": "function"
        },
        {
          "constant": false,
          "inputs": [],
          "name": "redeemFidelity",
          "outputs": [
            {
              "name": "sufficient",
              "type": "bool"
            }
          ],
          "payable": false,
          "type": "function"
        },
        {
          "constant": false,
          "inputs": [
            {
              "name": "newOwner",
              "type": "address"
            }
          ],
          "name": "transferOwnership",
          "outputs": [],
          "payable": false,
          "type": "function"
        },
        {
          "constant": false,
          "inputs": [
            {
              "name": "addr",
              "type": "address"
            }
          ],
          "name": "getBalance",
          "outputs": [
            {
              "name": "",
              "type": "uint256"
            }
          ],
          "payable": false,
          "type": "function"
        },
        {
          "inputs": [],
          "payable": false,
          "type": "constructor"
        },
        {
          "anonymous": false,
          "inputs": [
            {
              "indexed": true,
              "name": "_from",
              "type": "address"
            },
            {
              "indexed": true,
              "name": "_to",
              "type": "address"
            },
            {
              "indexed": false,
              "name": "_value",
              "type": "uint256"
            }
          ],
          "name": "Transfer",
          "type": "event"
        },
        {
          "anonymous": false,
          "inputs": [
            {
              "indexed": true,
              "name": "_from",
              "type": "address"
            }
          ],
          "name": "Fidelity",
          "type": "event"
        },
        {
          "anonymous": false,
          "inputs": [
            {
              "indexed": true,
              "name": "previousOwner",
              "type": "address"
            },
            {
              "indexed": true,
              "name": "newOwner",
              "type": "address"
            }
          ],
          "name": "OwnershipTransferred",
          "type": "event"
        }
      ]
      }
  
    ];</code></pre>
  </div>
  </div>
  </p>
  
  <p>ERC20 Smart Contract</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>pragma solidity ^0.4.4;
  
  import "./Ownable.sol";
  
  contract MetaCoin is Ownable {
  
   mapping (address =&gt; uint) balances;
    mapping (address =&gt; uint) fidelity;
  
   event Transfer(address indexed _from, address indexed _to, uint256 _value);
   event Fidelity(address indexed _from);
  
   function MetaCoin() {
    balances[tx.origin] = 10000;
      fidelity[tx.origin] = 100;
   }
  
   function sendCoin(address receiver, uint amount) returns(bool sufficient) {
    if (balances[msg.sender] &lt; amount) return false;
    balances[msg.sender] -= amount;
    balances[receiver] += amount;
      if (receiver == owner &amp;&amp; amount &gt; 10) {
        fidelity[msg.sender] += 1;
      }
      Transfer(msg.sender, receiver, amount);
    return true;
   }
  
   function redeemFidelity() returns (bool sufficient) {
    if (fidelity[msg.sender] &lt; 10) return false;
    fidelity[msg.sender] -= 10;
    Fidelity(msg.sender);
    return true;
   }
  
   function getBalance(address addr) returns(uint) {
    return balances[addr];
   }
  
    function getFidelity(address addr) returns(uint) {
    return fidelity[addr];
   }
  
  }</code></pre>
  </div>
  </div>
  </p>