# How to finalize Crowdsale in Remix IDE?

**URL:** <https://forum.openzeppelin.com/t/how-to-finalize-crowdsale-in-remix-ide/6162>\
**Category:** Contracts\
**Created:** [March 9, 2021, 1:29pm UTC](https://forum.openzeppelin.com/t/how-to-finalize-crowdsale-in-remix-ide/6162 "2021-03-09T13:29:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomy\_R](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/tomy_r/32/4448_2.png) [@Tomy\_R](https://forum.openzeppelin.com/u/Tomy_R)\
**Post date:** [March 9, 2021, 1:29pm UTC](https://forum.openzeppelin.com/t/how-to-finalize-crowdsale-in-remix-ide/6162/1 "2021-03-09T13:29:03Z")

</div>

Hello,  
I finally tested crowdsale contract.

> **[Contract Address 0xdb4eb793b302531c92c7a7d43cd351e14d6fb343 | Etherscan](https://ropsten.etherscan.io/address/0xdb4eb793b302531c92c7a7d43cd351e14d6fb343)**
>
> The Contract Address 0xdb4eb793b302531c92c7a7d43cd351e14d6fb343 page allows users to view the source code, transactions, balances, and analytics for the contract address. Users can also interact and make transactions to the contract directly on...

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
}
}
```

---

<div class="post-metadata">

**Author:** ![Skyge](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/skyge/32/343_2.png) [@Skyge](https://forum.openzeppelin.com/u/Skyge)\
**Post date:** [March 9, 2021, 3:34pm UTC](https://forum.openzeppelin.com/t/how-to-finalize-crowdsale-in-remix-ide/6162/2 "2021-03-09T15:34:59Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex022/uploads/zeppelin/original/2X/0/02e87f9dd63e186850747b493478b910e9e0604a.png)

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.
