27

I have tons of experimental contracts I created as part of doing tutorials which I no longer need. I know I can kill the contract (from https://www.ethereum.org/greeter tutorial) but that still leaves the contracts grayed out.

2 Answers 2

25

Thats not so easy, if they are created on the testnet we gray them out. So you can't click on it and then on the trash can next to the name, on the contract page.

You would need to open the console (CMD/CTRL + ALT + i) and type: CustomContracts.find().fetch()

Then look at the contract you want to remove and copy its _id. Then type: CustomContracts.remove('the_id_you_copied')

6
  • You can do the same with Tokens or CustomContracts Apr 5, 2016 at 22:47
  • This is also the answer for ethereum.stackexchange.com/q/2103/42 ?
    – eth
    Apr 6, 2016 at 2:26
  • 4
    I get VM1547:2 Uncaught ReferenceError: Contracts is not defined(…) in my console
    – Makoto
    Apr 9, 2016 at 20:46
  • When I click on the trash can, I have to confirm by giving the name of the contract. I do that, press Ok, the dialog goes away, but the contract remains. Trying the console commands fails as shown by @Makoto. Apr 10, 2016 at 9:15
  • I fix the issue in the next version, you then just need to type "delete" Apr 10, 2016 at 11:55
9

Or you can remove them all:

CustomContracts.find().fetch().map(
   function(m) { CustomContracts.remove(m._id);}
)

If you get an error saying "CustomContracts is not defined", be sure to open developer tools from the Contracts page via right clicking and selecting "Open Developer Tools," then navigating to the console.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.