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?


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

  • You have to do something like eth.contract(JSON.parse(abiDefinition)). See ethereum.stackexchange.com/questions/16798/… for more details.
    – Ismael
    Sep 29, 2017 at 5: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, 2017 at 2: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, 2017 at 3:17


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.