pragma solidity ^0.4.11;
import "zeppelin-solidity/contracts/crowdsale/CappedCrowdsale.sol";
import "zeppelin-solidity/contracts/crowdsale/Crowdsale.sol";
import "zeppelin-solidity/contracts/crowdsale/FinalizableCrowdsale.sol";
import "./WhitelistedCrowdsale.sol";
import "./VGRContinuousSale.sol";
import "./VGRToken.sol";
contract VGRCrowdsale is
WhitelistedCrowdsale,
CappedCrowdsale,
FinalizableCrowdsale
{
uint256 public constant TOTAL_SHARE = 100;
uint256 public constant CROWDSALE_SHARE = 40;
uint256 public constant FOUNDATION_SHARE = 60;
// price at which whitelisted buyers will be able to buy tokens
uint256 public preferentialRate;
// customize the rate for each whitelisted buyer
mapping(address => uint256) public buyerRate;
// initial rate at which tokens are offered
uint256 public initialRate;
// end rate at which tokens are offered
uint256 public endRate;
// continuous crowdsale contract
VGRContinuousSale public continuousSale;
event WalletChange(address wallet);
event PreferentialRateChange(address indexed buyer, uint256 rate);
event InitialRateChange(uint256 rate);
event EndRateChange(uint256 rate);
function VGRCrowdsale(
uint256 _startBlock,
uint256 _endBlock,
uint256 _initialRate,
uint256 _endRate,
uint256 _preferentialRate,
address _wallet
)
CappedCrowdsale(86206 ether)
WhitelistedCrowdsale()
FinalizableCrowdsale()
Crowdsale(_startBlock, _endBlock, _initialRate, _wallet)
{
require(_initialRate > 0);
require(_endRate > 0);
require(_preferentialRate > 0);
initialRate = _initialRate;
endRate = _endRate;
preferentialRate = _preferentialRate;
continuousSale = createContinuousSaleContract();
VGRToken(token).pause();
}
const VGRCrowdsale = artifacts.require("VGRCrowdsale");
module.exports = function (deployer) {
deployer.deploy(VGRCrowdsale);
};
#support #smart-contracts
Team_X
August 28, 2022, 8:25pm
2
Invalid number of parameters for "undefined". Got 0 expected 6.
Somewhere you need 6 arguments and you entered 0.
Hey @ac12644
your VGRCCrowdsale contract have 6 arguments in the constructor:
uint256 _startBlock,
uint256 _endBlock,
uint256 _initialRate,
uint256 _endRate,
uint256 _preferentialRate,
address _wallet
but in the script you didn't pass anything:
deployer.deploy(VGRCrowdsale)
I don't know if your aim was to set VGRCrowdsale
function as constructor or no (it has same name of the contract)
If the answer is NO then I suggest to change the function name
Otherwise if you want to use it as constructor you must pass those 6 arguments
2 Likes