CappedCrowdsale无法在ICO

时间:2018-05-15 11:11:24

标签: ethereum solidity smartcontracts truffle

我的ICO有问题。我在这里使用教程做了我的例子:https://blog.zeppelin.solutions/how-to-create-token-and-initial-coin-offering-contracts-using-truffle-openzeppelin-1b7a5dae99b6

一切正常,直到我将CappedCrowdsale添加到我的预售合约中。一切都在编译和迁移,但是当我想购买一些令牌时,我会一直得到恢复。我试着戴上更大的帽子,小帽子,但仍然一样。


pragma solidity ^0.4.21;

import "./MySuperCoin.sol";

import "../node_modules/openzeppelin-solidity/contracts/crowdsale/emission/MintedCrowdsale.sol";
import "../node_modules/openzeppelin-solidity/contracts/crowdsale/validation/TimedCrowdsale.sol";
import "../node_modules/openzeppelin-solidity/contracts/crowdsale/validation/CappedCrowdsale.sol";

contract MySuperCoinPresaleOne is MintedCrowdsale, TimedCrowdsale, CappedCrowdsale {

    constructor(
        uint256 _openingTime,
        uint256 _closingTime,
        uint256 _rate,
        address _wallet,
        uint256 _cap,
        MintableToken _token
    )
    Crowdsale(_rate, _wallet, _token) 
    CappedCrowdsale(_cap)
    TimedCrowdsale(_openingTime, _closingTime)
    public {

    }
}


const MySuperCoinPresaleOne = artifacts.require('./MySuperCoinPresaleOne.sol');

const MySuperCoin = artifacts.require('./MySuperCoin.sol');

module.exports = function(deployer, network, accounts) { const openingTimeOne = web3.eth.getBlock('latest').timestamp + 2; // two secs in the future const closingTimeOne = openingTimeOne + 60*60 * 5; // 5 mins days const capOne = new web3.BigNumber(2000); const rateOne = new web3.BigNumber(100);

const walletOne = accounts[1];

return deployer
    .then(() => {
        return deployer.deploy(MySuperCoin);
    })
    .then(() => {
        return deployer.deploy(
            MySuperCoinPresaleOne,
            openingTimeOne,
            closingTimeOne,
            rateOne,
            walletOne,
            capOne,
            MySuperCoin.address
        );
    });

};

感谢您的帮助。

0 个答案:

没有答案