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

Failed to read smart contracts #7

Open
notooth1 opened this issue Mar 16, 2021 · 0 comments
Open

Failed to read smart contracts #7

notooth1 opened this issue Mar 16, 2021 · 0 comments

Comments

@notooth1
Copy link

I failed to read smart contracts with this code. Can anyone help?

const abi = [{"constant":true,"inputs":[],"name":"mintingFinished",...}]
const address = '0xd26114cd6EE289AccF82350c8d8487fedB8A0C07'

const contract = new web3.eth.Contract(abi, address)

contract.methods.totalSupply().call((err, result) => { console.log(result) })
contract.methods.name().call((err, result) => { console.log(result) })
contract.methods.symbol().call((err, result) => { console.log(result) })
contract.methods.balanceOf('0xd26114cd6EE289AccF82350c8d8487fedB8A0C07').call((err, result) => { console.log(result) })

The output:

undefined
undefined
undefined
undefined
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

1 participant