Open mmcc1 opened 5 years ago
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
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.
How to get an instance which will permit the call of endSale()?