Fehler „Ungültige Adresse“ beim Aufruf der Funktion setFoo()

mein Remix

pragma solidity ^0.4.24;

contract Foo {
    bytes32 foo;

    function setFoo(bytes32 _foo) public {
        foo = _foo;
    }

    function getFoo() public constant returns (bytes32) {
        return foo;
    }
}

mein Skript

var web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));
web3.eth.defaultAccounbt = web3.eth.accounts[0];

var fooContract = web3.eth.contract([{
    "constant": true,
    "inputs": [],
    "name": "getFoo",
    "outputs": [{
      "name": "",
      "type": "bytes32"
    }],
    "payable": false,
    "stateMutability": "view",
    "type": "function"
  },
  {
    "constant": false,
    "inputs": [{
      "name": "_foo",
      "type": "bytes32"
    }],
    "name": "setFoo",
    "outputs": [],
    "payable": false,
    "stateMutability": "nonpayable",
    "type": "function"
  }
]);

var foo = fooContract.at('0xe884fb988c3242bcd16a0e187b10e6261733477e');

meine Chromkonsole

foo.setFoo("hello world");

Antworten (1)

Das Problem ist wahrscheinlich nur dieser Tippfehler:

web3.eth.defaultAccounbt = web3.eth.accounts[0];

(ein verirrtes "b" in Account b t)