Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back WhitelistedCrowdsale #1525

Merged
merged 15 commits into from
Dec 12, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import "../../access/roles/WhitelistedRole.sol";


/**
* @title WhitelistedCrowdsale
* @title WhitelistCrowdsale
* @dev Crowdsale in which only whitelisted users can contribute.
*/
contract WhitelistedCrowdsale is WhitelistedRole, Crowdsale {
contract WhitelistCrowdsale is WhitelistedRole, Crowdsale {
frangio marked this conversation as resolved.
Show resolved Hide resolved
/**
* @dev Extend parent behavior requiring beneficiary to be whitelisted. Note that no
* restriction is imposed on the account sending the transaction.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pragma solidity ^0.4.24;

import "../token/ERC20/IERC20.sol";
import "../crowdsale/validation/WhitelistedCrowdsale.sol";
import "../crowdsale/validation/WhitelistCrowdsale.sol";
import "../crowdsale/Crowdsale.sol";


contract WhitelistedCrowdsaleImpl is Crowdsale, WhitelistedCrowdsale {
contract WhitelistCrowdsaleImpl is Crowdsale, WhitelistCrowdsale {
constructor (uint256 _rate, address _wallet, IERC20 _token) Crowdsale(_rate, _wallet, _token) public {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ const BigNumber = web3.BigNumber;
require('chai')
.should();

const WhitelistedCrowdsale = artifacts.require('WhitelistedCrowdsaleImpl');
const WhitelistCrowdsale = artifacts.require('WhitelistCrowdsaleImpl');
const SimpleToken = artifacts.require('SimpleToken');

contract('WhitelistedCrowdsale', function ([_, wallet, whitelister, whitelisted, otherWhitelisted, anyone]) {
contract('WhitelistCrowdsale', function ([_, wallet, whitelister, whitelisted, otherWhitelisted, anyone]) {
const rate = 1;
const value = ether(42);
const tokenSupply = new BigNumber('1e22');

beforeEach(async function () {
this.token = await SimpleToken.new({ from: whitelister });
this.crowdsale = await WhitelistedCrowdsale.new(rate, wallet, this.token.address, { from: whitelister });
this.crowdsale = await WhitelistCrowdsale.new(rate, wallet, this.token.address, { from: whitelister });
await this.token.transfer(this.crowdsale.address, tokenSupply, { from: whitelister });
});

Expand Down