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

Missing From Videos #19

Open
mmcc1 opened this issue Feb 13, 2019 · 2 comments
Open

Missing From Videos #19

mmcc1 opened this issue Feb 13, 2019 · 2 comments

Comments

@mmcc1
Copy link

mmcc1 commented Feb 13, 2019

  1. How to get an instance which will permit the call of endSale()?
  2. How to get the Ether from the sale contract?
@mmcc1
Copy link
Author

mmcc1 commented Feb 13, 2019

I took the ABI from the token sale json and the network address and got an instance of the token sale contract. From there I was able to call endSale().

But I just get an error. The account I am using on Geth is the admin account.

var TokenContract = web3.eth.contract(abi)
var tokenInstance = TokenContract.at('address')

> tokenInstance.endSale()
Error: invalid address
    at web3.js:3930:15
    at web3.js:3756:20
    at web3.js:5025:28
    at map (<native code>)
    at web3.js:5024:12
    at web3.js:5050:18
    at web3.js:5075:23
    at web3.js:4137:16
    at apply (<native code>)
    at web3.js:4223:16

@mmcc1
Copy link
Author

mmcc1 commented Feb 13, 2019

The solution to the above error is:

web3.eth.defaultAccount = web3.eth.accounts[0]

Make sure to check the repo for code to transfer the balance in Ether.

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