How to finalize Crowdsale in Remix IDE?

Hello,
I finally tested crowdsale contract.

But after the end of the contract, the funds were not sent to the user’s wallet.
How do I end this contract for the funds to be sent?

My contract:

pragma solidity ^0.5.0;

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.5.0/contracts/crowdsale/Crowdsale.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.5.0/contracts/crowdsale/validation/TimedCrowdsale.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.5.0/contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol";


contract MyCrowdsale is Crowdsale, TimedCrowdsale, PostDeliveryCrowdsale {

constructor(
    uint256 rate,        // rate, in bits
    address payable wallet,  // wallet to send Ether
    IERC20 token,            // the token
    uint256 openingTime,    // opening time in unix epoch seconds
    uint256 closingTime    // closing time in unix epoch seconds
)
    PostDeliveryCrowdsale()
    TimedCrowdsale(openingTime, closingTime)
    Crowdsale(rate, wallet, token)
    public
{
    // nice! this Crowdsale will keep all of the tokens until the end of the crowdsale
    // and then users can `withdrawTokens()` to get the tokens they're owed
}
}

When you check the failed transaction at the etherscan, you can get the following error message:

So, I think you should set the correct values for openingTime and closingTime. Maybe you can restart the crowsale, I am not sure, I have not read the contract you wrote yet, so you should look the contract for more details.

1 Like