(Test and) Deploy Zombie Contracts - cogeorg/teaching GitHub Wiki
You should always (ALWAYS!!!) test your contracts before deploying them. To be an even better developer, you should first write your tests and then implement your functionality (this is called test-driven development). Due to the lack of time, we will not write the CryptoZombie tests as part of the tutorial. But we highly encourage you to practice it by writing tests on your own.
Now that you have successfully written all your CryptoZombie contracts, it is time to test and potentially deploy them. To make it easy for you, we have created a Truffle box including the contracts and a tiny frontend. Truffle boxes are boilerplates that come with all the necessary ingredients to build a DApp. Our box is a derivation from the pet-shop box. If you are an advanced frontend developer, check out the other boxes Truffle provides here. You can even configure your own box.
Unbox the Truffle box like so
$ mkdir CryptoZombies
$ cd CryptoZombies/
$ truffle unbox sabinebertram/tutorial-truffle-box
The contracts have already been added to this box, the 2_deploy_contracts.js
file was added to the migrations/ folder and the truffle-config.js
file has already been pre-configured for you.
We are all set to deploy the contracts. For this tutorial, we will deploy the contracts to Ganache, thus open it. In a shell, navigate to the project folder and run
$ truffle migrate --network ganache
In Ganache, under the tab Transactions, you should find all your deployment transactions as well as the calls to the Migrations contract to update its state.
The compiled contracts can be found in the build/contracts/ directory.