when i am doing truffle migrate.i am able to deploy my crowdsale contract but my token contract is getting deployed but not the crowdsale contract.
var Sportist = artifacts.require("./Sportist.sol");
var SportistCrowdsale = artifacts.require("./SportistCrowdsale.sol");
module.exports = async function (deployer) {
let rate = 1;
let wallet = "0x300c7b7198a772C2154e4f2a47C0d89407a95A8A";
let token;
let openingTime = Math.floor((new Date()).getTime()/1000);
let closingTime = openingTime + 1 * 60 * 60 * 24;
let cap = 500000;
let goal = 50000;
let tokenWallet = "0x300c7b7198a772C2154e4f2a47C0d89407a95A8A";
let a = await deployer.deploy(Sportist, "Sportist", "S", 6, 2000000000)
console.log("asdasdasdasdasdasdasdasdasdasd");
token = await Sportist.deployed().then(instance=>instance.address)
await deployer.deploy(SportistCrowdsale,
rate, wallet, token,
openingTime, closingTime,
cap,
goal,
tokenWallet)
const crowdsale = await DappTokenCrowdsale.deployed();
console.log("after deployement ");
};
in the console it is showing that
Using network 'development'.
Running migration: 2_deploy.js
Replacing Sportist...
... 0x211c7f7e0678bacec29a7d8032ae8949faca2cc381586b8b541f5faf3804c1f9
Sportist: 0x2fb7fa517002ca3a7af45deea0479f287d5089fb
Saving successful migration to network...
asdasdasdasdasdasdasdasdasdasd
... 0x760538642ffd049748b5bf3ff5624b0065e6b0e3bbbb1aaf99ad341de2bc99f1
Deploying SportistCrowdsale...
Saving artifacts...
and the crowdsale contract is
pragma solidity ^0.4.24;
import "./crowdsale/distribution/RefundableCrowdsale.sol";
import "./crowdsale/distribution/PostDeliveryCrowdsale.sol";
import "./crowdsale/validation/CappedCrowdsale.sol";
import "./crowdsale/emission/AllowanceCrowdsale.sol";
import "./crowdsale/emission/StagedCrowsale.sol";
contract SportistCrowdsale is RefundableCrowdsale, CappedCrowdsale, PostDeliveryCrowdsale, AllowanceCrowdsale, StagedCrowsale {
constructor(
uint256 rate, address wallet, IERC20 token,
uint256 openingTime, uint256 closingTime,
uint cap,
uint256 goal,
address tokenWallet)
Crowdsale(rate, wallet, token)
TimedCrowdsale(openingTime, closingTime)
CappedCrowdsale(cap)
RefundableCrowdsale(goal)
AllowanceCrowdsale(tokenWallet)
StagedCrowsale()
public {}
function() external payable {
buyTokens(msg.sender);
}
}