November 2018
Intermediate to advanced
528 pages
13h 21m
English
In this second step, we need to write a migration file to let Truffle know how to deploy your contract to the blockchain. Go to the migrations/ folder and create a new file called 3_initial_migration.js. Notice the incremented numerical suffix:
var Ctontine = artifacts.require("Ctontine");var Cplayer = artifacts.require("Cplayer");module.exports = function(deployer) { deployer.deploy(Cplayer).then(function() { return deployer.deploy(Ctontine, Cplayer.address); }).then(function() { })};In the migration file, the first thing we need to do is get the reference to our contract in JavaScript. This migration script will first deploy the Cplayer contract, then it will pass its address to the constructor of Ctontine to deploy ...
Read now
Unlock full access