0

I'm trying to use Truffle to deploy/test a cluster of interrelated contracts that call each other.

When I run "truffle migrate" all of the contracts get deployed successfully and the transactions show up in Ganache, but Truffle doesn't seem to have any conception of some of them when I use ".deployed()" in the console or in other migrations; however, the first 2 contracts do show up.

EDIT: The problematic contracts are not all derived from the same base contract; I just tried it with an empty contract (just an empty constructor) and the same thing happened to it.

1

Few things you could check on

  1. Have one file per contract.
  2. Make sure you contract name and .sol file name are the same for problematic contracts ( contract HelloWorld, in file HelloWorld.sol).
  3. Make sure you have import relevant dependency files in each contract file
  4. Deleting build folder (which get created when compile) also resolve some inconsistency problems occur specially during the testing phase.
  • 1. I've ensured this in all my code; I am using a fork of someone else's code for one of the two contracts that are recognized by Truffle; one file in there has two contracts in a file. 2. I've checked this. 3. The contracts compile and deploy fine in Remix, as well as in Truffle; it's just that Truffle doesn't keep their addresses and thinks they aren't deployed. 4. I've tried doing this. – John Adams Jan 21 '18 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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