Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web3.eth.contract is not a function #985

Closed
jesuprakash opened this issue Aug 16, 2017 · 5 comments
Closed

web3.eth.contract is not a function #985

jesuprakash opened this issue Aug 16, 2017 · 5 comments

Comments

@jesuprakash
Copy link

Getting this when I am using 1.0.0-beta.18

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

@onbjerg
Copy link
Contributor

onbjerg commented Aug 16, 2017

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
Copy link

mbrooks commented Aug 20, 2017

If the API changed, then why are the tests still using it in tests?

https://github.com/ethereum/web3.js/blob/62dd77c7f43522eb568a001cf4c4df726f8efa69/test/web3.eth.contract.js#L29

@onbjerg
Copy link
Contributor

onbjerg commented Aug 22, 2017

@mbrooks You're on the wrong branch 😊

@SidhMj
Copy link

SidhMj commented Aug 25, 2017

Its "C" now instead of "c"

@lakshmankashyap
Copy link

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

not work unlock account here any solutions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants