Skip to content

Commit

Permalink
Made the Crowdsale's constructor public again. (#1564)
Browse files Browse the repository at this point in the history
* Made the Crowdsale's constructor public again.

* Added changelog entry.

* Made all but Finalizable public.
  • Loading branch information
nventuro authored Dec 18, 2018
1 parent d17ae0b commit 54ceedb
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
* `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))
* 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))

### Improvements:
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/Crowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ contract Crowdsale is ReentrancyGuard {
* @param wallet Address where collected funds will be forwarded to
* @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(wallet != address(0));
require(token != address(0));
Expand Down
2 changes: 0 additions & 2 deletions contracts/crowdsale/distribution/PostDeliveryCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ contract PostDeliveryCrowdsale is TimedCrowdsale {

mapping(address => uint256) private _balances;

constructor () internal {}

/**
* @dev Withdraw tokens only after crowdsale ends.
* @param beneficiary Whose tokens will be withdrawn.
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/distribution/RefundableCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ contract RefundableCrowdsale is FinalizableCrowdsale {
* @dev Constructor, creates RefundEscrow.
* @param goal Funding goal
*/
constructor (uint256 goal) internal {
constructor (uint256 goal) public {
require(goal > 0);
_escrow = new RefundEscrow(wallet());
_goal = goal;
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/emission/AllowanceCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ contract AllowanceCrowdsale is Crowdsale {
* @dev Constructor, takes token wallet address.
* @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));
_tokenWallet = tokenWallet;
}
Expand Down
2 changes: 0 additions & 2 deletions contracts/crowdsale/emission/MintedCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import "../../token/ERC20/ERC20Mintable.sol";
* Token ownership should be transferred to MintedCrowdsale for minting.
*/
contract MintedCrowdsale is Crowdsale {
constructor () internal {}

/**
* @dev Overrides delivery by minting tokens upon purchase.
* @param beneficiary Token purchaser
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/price/IncreasingPriceCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 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(initialRate > finalRate);
_initialRate = initialRate;
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/validation/CappedCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ contract CappedCrowdsale is Crowdsale {
* @dev Constructor, takes maximum amount of wei accepted in the crowdsale.
* @param cap Max amount of wei to be contributed
*/
constructor (uint256 cap) internal {
constructor (uint256 cap) public {
require(cap > 0);
_cap = cap;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ contract IndividuallyCappedCrowdsale is Crowdsale, CapperRole {
mapping(address => uint256) private _contributions;
mapping(address => uint256) private _caps;

constructor () internal {}

/**
* @dev Sets a specific beneficiary's maximum contribution.
* @param beneficiary Address to be capped
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/validation/TimedCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ contract TimedCrowdsale is Crowdsale {
* @param openingTime Crowdsale opening 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
require(openingTime >= block.timestamp);
require(closingTime > openingTime);
Expand Down

0 comments on commit 54ceedb

Please sign in to comment.