Made the Crowdsale's constructor public again. (#1564)

* Made the Crowdsale's constructor public again.

* Added changelog entry.

* Made all but Finalizable public.
This commit is contained in:
Nicolás Venturo
2018-12-18 16:19:48 -03:00
committed by GitHub
parent d17ae0b806
commit 54ceedbb1f
10 changed files with 7 additions and 12 deletions

View File

@ -9,6 +9,7 @@
* `ERC20`: `transferFrom` and `_burnFrom ` now emit `Approval` events, to represent the token's state comprehensively through events. ([#1524](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1524)) * `ERC20`: `transferFrom` and `_burnFrom ` now emit `Approval` events, to represent the token's state comprehensively through events. ([#1524](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1524))
* `ERC721`: added `_burn(uint256 tokenId)`, replacing the similar deprecated function (see below). ([#1550](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1550)) * `ERC721`: added `_burn(uint256 tokenId)`, replacing the similar deprecated function (see below). ([#1550](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1550))
* `ERC721`: added `_tokensOfOwner(address owner)`, allowing to internally retrieve the array of an account's owned tokens. ([#1522](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1522)) * `ERC721`: added `_tokensOfOwner(address owner)`, allowing to internally retrieve the array of an account's owned tokens. ([#1522](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1522))
* Crowdsales: all constructors are now `public`, meaning it is not necessary to extend these contracts in order to deploy them. The exception is `FinalizableCrowdsale`, since it is meaningless unless extended. ([#1564](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1564))
* `SafeMath`: added overflow-safe operations for signed integers (`int256`). ([#1559](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1559)) * `SafeMath`: added overflow-safe operations for signed integers (`int256`). ([#1559](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1559))
### Improvements: ### Improvements:

View File

@ -53,7 +53,7 @@ contract Crowdsale is ReentrancyGuard {
* @param wallet Address where collected funds will be forwarded to * @param wallet Address where collected funds will be forwarded to
* @param token Address of the token being sold * @param token Address of the token being sold
*/ */
constructor (uint256 rate, address wallet, IERC20 token) internal { constructor (uint256 rate, address wallet, IERC20 token) public {
require(rate > 0); require(rate > 0);
require(wallet != address(0)); require(wallet != address(0));
require(token != address(0)); require(token != address(0));

View File

@ -12,8 +12,6 @@ contract PostDeliveryCrowdsale is TimedCrowdsale {
mapping(address => uint256) private _balances; mapping(address => uint256) private _balances;
constructor () internal {}
/** /**
* @dev Withdraw tokens only after crowdsale ends. * @dev Withdraw tokens only after crowdsale ends.
* @param beneficiary Whose tokens will be withdrawn. * @param beneficiary Whose tokens will be withdrawn.

View File

@ -27,7 +27,7 @@ contract RefundableCrowdsale is FinalizableCrowdsale {
* @dev Constructor, creates RefundEscrow. * @dev Constructor, creates RefundEscrow.
* @param goal Funding goal * @param goal Funding goal
*/ */
constructor (uint256 goal) internal { constructor (uint256 goal) public {
require(goal > 0); require(goal > 0);
_escrow = new RefundEscrow(wallet()); _escrow = new RefundEscrow(wallet());
_goal = goal; _goal = goal;

View File

@ -20,7 +20,7 @@ contract AllowanceCrowdsale is Crowdsale {
* @dev Constructor, takes token wallet address. * @dev Constructor, takes token wallet address.
* @param tokenWallet Address holding the tokens, which has approved allowance to the crowdsale * @param tokenWallet Address holding the tokens, which has approved allowance to the crowdsale
*/ */
constructor (address tokenWallet) internal { constructor (address tokenWallet) public {
require(tokenWallet != address(0)); require(tokenWallet != address(0));
_tokenWallet = tokenWallet; _tokenWallet = tokenWallet;
} }

View File

@ -9,8 +9,6 @@ import "../../token/ERC20/ERC20Mintable.sol";
* Token ownership should be transferred to MintedCrowdsale for minting. * Token ownership should be transferred to MintedCrowdsale for minting.
*/ */
contract MintedCrowdsale is Crowdsale { contract MintedCrowdsale is Crowdsale {
constructor () internal {}
/** /**
* @dev Overrides delivery by minting tokens upon purchase. * @dev Overrides delivery by minting tokens upon purchase.
* @param beneficiary Token purchaser * @param beneficiary Token purchaser

View File

@ -20,7 +20,7 @@ contract IncreasingPriceCrowdsale is TimedCrowdsale {
* @param initialRate Number of tokens a buyer gets per wei at the start of the crowdsale * @param initialRate Number of tokens a buyer gets per wei at the start of the crowdsale
* @param finalRate Number of tokens a buyer gets per wei at the end of the crowdsale * @param finalRate Number of tokens a buyer gets per wei at the end of the crowdsale
*/ */
constructor (uint256 initialRate, uint256 finalRate) internal { constructor (uint256 initialRate, uint256 finalRate) public {
require(finalRate > 0); require(finalRate > 0);
require(initialRate > finalRate); require(initialRate > finalRate);
_initialRate = initialRate; _initialRate = initialRate;

View File

@ -16,7 +16,7 @@ contract CappedCrowdsale is Crowdsale {
* @dev Constructor, takes maximum amount of wei accepted in the crowdsale. * @dev Constructor, takes maximum amount of wei accepted in the crowdsale.
* @param cap Max amount of wei to be contributed * @param cap Max amount of wei to be contributed
*/ */
constructor (uint256 cap) internal { constructor (uint256 cap) public {
require(cap > 0); require(cap > 0);
_cap = cap; _cap = cap;
} }

View File

@ -14,8 +14,6 @@ contract IndividuallyCappedCrowdsale is Crowdsale, CapperRole {
mapping(address => uint256) private _contributions; mapping(address => uint256) private _contributions;
mapping(address => uint256) private _caps; mapping(address => uint256) private _caps;
constructor () internal {}
/** /**
* @dev Sets a specific beneficiary's maximum contribution. * @dev Sets a specific beneficiary's maximum contribution.
* @param beneficiary Address to be capped * @param beneficiary Address to be capped

View File

@ -26,7 +26,7 @@ contract TimedCrowdsale is Crowdsale {
* @param openingTime Crowdsale opening time * @param openingTime Crowdsale opening time
* @param closingTime Crowdsale closing time * @param closingTime Crowdsale closing time
*/ */
constructor (uint256 openingTime, uint256 closingTime) internal { constructor (uint256 openingTime, uint256 closingTime) public {
// solium-disable-next-line security/no-block-members // solium-disable-next-line security/no-block-members
require(openingTime >= block.timestamp); require(openingTime >= block.timestamp);
require(closingTime > openingTime); require(closingTime > openingTime);