Web3.js: web3.eth.contract is not a function

Created on 16 Aug 2017  路  5Comments  路  Source: ChainSafe/web3.js

Getting this when I am using 1.0.0-beta.18

during
var contract = web3.eth.contract(ABI).at(contractAddress);

Most helpful comment

The API changed. This would work:

var contract = new web3.eth.Contract(abi, contractAddress)

Refer to the docs: http://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#new-contract

All 5 comments

The API changed. This would work:

var contract = new web3.eth.Contract(abi, contractAddress)

Refer to the docs: http://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#new-contract

@mbrooks You're on the wrong branch 馃槉

Its "C" now instead of "c"

but how can call contract method in web3 beta version always show error unknown account

not work unlock account here any solutions

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TinyWJL picture TinyWJL  路  3Comments

oktapodia picture oktapodia  路  3Comments

joeriexelmans picture joeriexelmans  路  3Comments

xpepermint picture xpepermint  路  3Comments

nivida picture nivida  路  3Comments