0

Looked at multiple answer for this question but they seem to be out of date.

I committed a contract to the testnet chain, closed my geth console and upon starting the console again would like to redeploy contract. I know that I have to load the .abi file in and then instantiate a new local contract, but I keep getting an error. Below is code:

loadScript(Token.abi); \\ script assigning abi string to variable 'Token'
var myContract = eth.contract(Token); \\ works fine
var myContractInstance = myContract.at('0x808eca33fef859f9aa54c24780962b0519e274b8') \\ here the error is returned

The error given is

TypeError: 'filter is not a function'

I don't see the .at() function anywhere in the documentation so I assume it is deprecated? Any ideas?

EDIT:

I did find the .at() function on the api wiki, but for some reason it does not seem to work.

hroussille
  • 7,661
  • 2
  • 6
  • 29
jojeyh
  • 769
  • 3
  • 8
  • You have to do something like eth.contract(JSON.parse(abiDefinition)). See https://ethereum.stackexchange.com/questions/16798/web3-uncaught-typeerror-contract-abi-filter-is-not-a-function for more details. – Ismael Sep 29 '17 at 05:01
  • That is essentially what is in the script Token.abi, I modified that file to include javacsript commands to assign the array. I can create a contract using eth.contract() just fine, but when using eth.contract().at() I run into this error @Ismael – jojeyh Sep 30 '17 at 02:00
  • But from your question you were doing eth.contract(Token) instead of eth.contract(Token.abi). Just the error doesn't trigger immediately, only when the it is used in myContract.at('xxxx'). – Ismael Sep 30 '17 at 03:17

0 Answers0