Merge tag 'v2.1.1' of github.com:OpenZeppelin/openzeppelin-solidity

v2.1.1
This commit is contained in:
Francisco Giordano
2019-01-18 15:33:51 -03:00
237 changed files with 8562 additions and 4937 deletions

View File

@ -1,35 +1,26 @@
pragma solidity ^0.4.24;
pragma solidity ^0.5.0;
import "zos-lib/contracts/Initializable.sol";
import "../crowdsale/validation/CappedCrowdsale.sol";
import "../crowdsale/distribution/RefundableCrowdsale.sol";
import "../crowdsale/emission/MintedCrowdsale.sol";
import "../token/ERC20/ERC20Mintable.sol";
import "../token/ERC20/ERC20Detailed.sol";
/**
* @title SampleCrowdsaleToken
* @dev Very simple ERC20 Token that can be minted.
* It is meant to be used in a crowdsale contract.
*/
contract SampleCrowdsaleToken is Initializable, ERC20Mintable {
string public name;
string public symbol;
uint8 public decimals;
contract SampleCrowdsaleToken is Initializable, ERC20Mintable, ERC20Detailed {
function initialize(address sender) public initializer {
ERC20Mintable.initialize(sender);
name = "Sample Crowdsale Token";
symbol = "SCT";
decimals = 18;
ERC20Detailed.initialize("Sample Crowdsale Token", "SCT", 18);
}
uint256[50] private ______gap;
}
/**
* @title SampleCrowdsale
* @dev This is an example of a fully fledged crowdsale.
@ -37,22 +28,19 @@ contract SampleCrowdsaleToken is Initializable, ERC20Mintable {
* In this example we are providing following extensions:
* CappedCrowdsale - sets a max boundary for raised funds
* RefundableCrowdsale - set a min goal to be reached and returns funds if it's not met
* MintedCrowdsale - assumes the token can be minted by the crowdsale, which does so
* when receiving purchases.
*
* After adding multiple features it's good practice to run integration tests
* to ensure that subcontracts works together as intended.
*/
// XXX There doesn't seem to be a way to split this line that keeps solium
// happy. See:
// https://github.com/duaraghav8/Solium/issues/205
// --elopio - 2018-05-10
// solium-disable-next-line max-len
contract SampleCrowdsale is Initializable, Crowdsale, CappedCrowdsale, RefundableCrowdsale, MintedCrowdsale {
function initialize(
uint256 openingTime,
uint256 closingTime,
uint256 rate,
address wallet,
address payable wallet,
uint256 cap,
ERC20Mintable token,
uint256 goal

View File

@ -1,9 +1,8 @@
pragma solidity ^0.4.24;
pragma solidity ^0.5.0;
import "zos-lib/contracts/Initializable.sol";
import "../token/ERC20/ERC20.sol";
import "../token/ERC20/ERC20Detailed.sol";
/**
* @title SimpleToken
@ -11,21 +10,17 @@ import "../token/ERC20/ERC20.sol";
* Note they can later distribute these tokens as they wish using `transfer` and other
* `ERC20` functions.
*/
contract SimpleToken is Initializable, ERC20 {
string public constant name = "SimpleToken";
string public constant symbol = "SIM";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 10000 * (10 ** uint256(decimals));
contract SimpleToken is Initializable, ERC20, ERC20Detailed {
uint8 public constant DECIMALS = 18;
uint256 public constant INITIAL_SUPPLY = 10000 * (10 ** uint256(DECIMALS));
/**
* @dev Constructor that gives sender all of existing tokens.
* @dev Constructor that gives msg.sender all of existing tokens.
*/
function initialize(address sender) public initializer {
_mint(sender, INITIAL_SUPPLY);
ERC20Detailed.initialize("SimpleToken", "SIM", DECIMALS);
_mint(msg.sender, INITIAL_SUPPLY);
}
uint256[50] private ______gap;
}