Where are Crowdsale contracts in OpenZeppelin Contracts 3.0?

Hello. Is the situation with the crowdsale related contracts the same (Where is ERC20Mintable.sol in OpenZeppelin Contracts 3.0?)? Seems it was removed in this commit.

I don’t want to push you, but maybe you could provide any rough estimate when do you plan to add it back?

Thanks for your help and the great job you’re doing.

2 Likes

Hi @Revinand,

Welcome to the community :wave:.

Crowdsales have been removed from the OpenZeppelin Contracts v3.0 beta release and there are no plans to migrate them to Solidity 0.6. If you need a crowdsale you can use OpenZeppelin Contracts 2.5:

Crowdsales were removed: we’ll continue to provide support for security issues on the v2.5 release, but will not bring them over to v3.0.

Note: You should only use code published in an official release of OpenZeppelin Contracts. When importing via GitHub on Remix you can specify the release tag, (otherwise you will get the latest code in the master branch).

1 Like

Got it. Thanks for a quick reply

1 Like

Hi @Revinand,

Are you working on a Crowdsale?
Are you importing OpenZeppelin Contracts via npm or via GitHub?

1 Like

Hello @abcoathup,

Yes, I am. It’s a small crowdsale, so I need a very basic functionality, but I want to follow the best practices. That’s why I chose OpenZeppelin and asked why did you remove these contracts from the new version. If you say that v2.5 is ok, then it’s fine for me.

For now I’m using truffle as testing environment (didn’t have much time to try yours) and importing contracts via npm.

Also I noticed that you have Network JS project and going to try it in my React app.

2 Likes

Hi @Revinand,

Crowdsales are in OpenZeppelin Contracts 2.5. Feel free to ask any questions that you need.

Any solution should be appropriately tested and audited. You should also obtain appropriate regulatory advice.

Crowdsales weren’t included in the migration to Solidity 0.6 (OpenZeppelin Contracts 3.0) based on need/demand.
Out of interest, what is your token being used for?

As an FYI: OpenZeppelin CLI 2.8: Release Candidate includes regular (non-upgradeable) deploys.

So you could test with OpenZeppelin Test Environment and deploy with OpenZeppelin CLI.

1 Like

Hello @abcoathup, since crowdsales will be removed with v3.0 What is the recommended pattern as a replacement for them? In my solution I will be deploying N number of token contracts (ERC777).

The buyer of a token must send ether and the ether gets transferred to the issuer of those tokens (just like in buyTokens in Crowdsale). The tokens will be capped and are all minted at once.

May I make a suggestion. Please add the fact that crowdsales are deprecated in the docs. I started using them trusting the documentation and now I have invested too much time in them.

Thanks!

Moises

5 Likes

A post was split to a new topic: Is it safe to use Crowdsales (OpenZeppelin Contracts 2.x) together with the upgradable version of ERC20?

Do you mean this page? https://docs.openzeppelin.com/contracts/2.x/crowdsales

We could add a notice saying that they are no longer present in 3.x.

2 Likes

Kind of a follow-up question on this. So, my ERC-20 token is built using OpenZeppelin v3, and for crowd sale, I will need v2.5. So, is it okay to create these contracts in two different projects? Coz most ppl I know who were writing crowd sales wrote both their token and their crowd sale contract in the same project (the project is a truffle project and Openzeppelin is installed via npm).

2 Likes

Hi @PradhumnaPancholi,

I think having a project for a Crowdsale extending from OpenZeppelin Contracts 2.x and a separate project for an ERC20 token extending from OpenZeppelin Contracts 3.x is an acceptable approach.

The crowdsale has a limited life, whilst the token is meant to have a long life.

For any post on tokens I suggest looking at: Points to consider when creating a fungible token (ERC20, ERC777)

2 Likes

Hi,

I know this is very old conversation but I want to use the crowdsale contract so my only option would be version 2.5 which is extremely old by now.
Is it still safe to use it now in 2021 or should I opt to custom or other solution?

Thank you for advance.

Older versions are safe to use. You may want to take a look at the changelog to see if anything newer since then looks important to your project.

Thank you very much. I have already started building the crowd sale using v2.5 and I intend to build the contract also using 2.5 so I don’t have to maintain two truffle projects one for the token and one for the ico.
There doesn’t seem to be important changes that would affect my project directly in newer versions.

Actually there seems to be a way to use two config files so I will give that a shot to use OpenZeppelin v4 with the token but 2.5 for the ICO.

1 Like