adrianmcli / truffle-react

⚛️ A boilerplate Truffle Box project with Create React App for rapid Ethereum Dapp development
46 stars 5 forks source link

"Error: Attempting to run transaction which calls a contract function, but recipient address <Contract Address> is not a contract address" #12

Open 0xCourtney opened 5 years ago

0xCourtney commented 5 years ago

This message appears after doing a fresh migration, because the contracts file is both in the builds directory and the src you will need to delete the contracts folder in the src directory and copy it from the build directory each time a new build folder is created...

adrianmcli commented 5 years ago

The way the box works is that a symlink is created between the src folder and the build folder for the contracts directory. This is done because Create-React-App does not allow you to require things outside of src. As long as there is a proper symlink, everything will work fine.

However, if you just paste it in, it's likely that your JSON artifacts will become out of date. And that's when you will have trouble finding the addresses for where the contracts are deployed. This is why you say you have to copy it over every time.

It sounds like you are having issues with the symlink. Do not delete it, run npm run link-contracts to re-instate it and it should work.

SvenMeyer commented 5 years ago

@ScottWorks check my posting on a related issue for a possible solution: https://github.com/adrianmcli/truffle-react/issues/2#issuecomment-416035354