unexpected or undocumented truffle develop console objects persistence after restart
See original GitHub issueIssue
Deploying TestContract on truffle develop console worked and await TestContract.at(TestContract.address) worked.
Then after truffle develop console restart running: await TestContract.at(TestContract.address) again returns Error: Cannot create instance of TestContract; no code at address 0x....
I searched online if truffle develop console does not persist something but could not find information on that and also the deployed contracts ARE persisted.
await TestContract.deployed() DOES work after restart.
Also: .getPastEvents() of the contract returns events before truffle develop console restart and does not return events (empty array) after truffle develop console restart.
Is this a bug? Or is there a missing documentation about what the console persists across restarts?
Environment
Windows 10 Truffle v5.0.12 (core: 5.0.12) Solidity - 0.5.2 (solc-js) Node v10.8.0 Web3.js v1.0.0-beta.37
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)

Top Related StackOverflow Question
Interesting idea! I think the current plan is for
truffle developto be a “throw-away” chain that gets destroyed and refreshed on each restart, leaving it up to the user to migrate. However, I see how the current behavior ofcontract.deployed()is a bit confusing.After looking into this a bit more, there may be a way to either have a
truffle developmigration not save to the actual json artifacts (so after restartingtruffle develop, the artifacts will be detected, but thedevelopnetwork will not be found), or possibly havetruffle developremove thenetworksit added during the repl session when.exiting out. Will need to look into this more thoroughly.So it looks like if we wanted to move forward on this, we would need to have a requirements gathering session to figure out what kind of behavior we actually want. Leaving this here until we can triage things.