index.html:114 Uncaught TypeError:无法读取未定义的属性“地址”

时间:2018-03-26 21:19:05

标签: ethereum web3js web3

我正在使用以太坊区块链,我在合同中写了合同,现在我在应用程序的前端部分。我复制了'WEB3DEPLOY'的代码......

        var dapp = dappContract.new(
      _acconto,
      _saldo,
      _technician,
      _Time, {
        from: web3.eth.accounts[0],
        data: '0x60606040526000600360146101000a81548160ff0219169083151502179055506040516080806103bd83398101604052808051906020019091908051906020019091908051906020019091908051906020019091905050670de0b6b3a76400008402600081905550670de0b6b3a7640000830260018190555033600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550804201600481905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6000549081150290604051600060405180830381858888f19350505050151561016757600080fd5b505050506102438061017a6000396000f30060606040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806377d9a51c146100515780639f9fb4341461005b575b600080fd5b610059610070565b005b341561006657600080fd5b61006e610193565b005b60011515600360149054906101000a900460ff161515141561010957600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6001549081150290604051600060405180830381858888f1935050505015156100f057600080fd5b3073ffffffffffffffffffffffffffffffffffffffff16ff5b6004544210151561019157600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6001549081150290604051600060405180830381858888f19350505050151561017857600080fd5b3073ffffffffffffffffffffffffffffffffffffffff16ff5b565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156101f957600115156101f457fe5b610215565b6001600360146101000a81548160ff0219169083151502179055505b5600a165627a7a7230582044b5877b0a27d3c5534623fdd3e1648cd05672adcf184453e6ba959e768787930029',
        gas: '4700000'
      },
      function(e, contract) {
        console.log(e, contract);
        if (typeof contract.address !== 'undefined') { //ERROR AT THIS LINE
          console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash);
          CAddress = contract.address;
        }
      }) 

当我运行应用程序时,它给出了错误:

Uncaught TypeError: Cannot read property 'address' of undefined

控制台错误输出:

Error: VM Exception while processing transaction: revert
at Object.InvalidResponse (web3.min.js:1)
at web3.min.js:1
at XMLHttpRequest.r.onreadystatechange (web3.min.js:1) undefined

我不知道如何解决问题,抱歉英语不好。

0 个答案:

没有答案