Skip to content
Permalink
Browse files

Set presale address without locking

  • Loading branch information...
gitigs committed Nov 7, 2018
1 parent a838585 commit 17a1e1ae336a92e3d4d7686aa1cb26aaea3f1f82
Showing with 16 additions and 6 deletions.
  1. +2 −2 contracts/ProPool.sol
  2. +14 −4 contracts/library/ProPoolLib.sol
@@ -100,8 +100,8 @@ contract ProPool is IERC223Receiver {
/**
* @dev Redirect to pool library.
*/
function lockPresaleAddress(address presaleAddress) external {
pool.lockPresaleAddress(presaleAddress);
function lockPresaleAddress(address presaleAddress, bool lock) external {
pool.lockPresaleAddress(presaleAddress, lock);
}

/**
@@ -114,13 +114,16 @@ library ProPoolLib {
// Can be set only once by pool admin and can't be changed later.
address presaleAddress;

// Presale address can be locked.
bool lockPresale;

// FeeService contract interface.
IFeeService feeService;

// When paying to the presale "Fee-to-Token" mode can be chosen by admin.
// In this mode, the pool creator commission will be sent to the presale
// as a part of creator contribution.
address feeToTokenAddress;
address feeToTokenAddress;
bool feeToTokenMode;

// Pool administrators array.
@@ -196,7 +199,7 @@ library ProPoolLib {
public
{

// Lock presale address.
// Set presale address.
if(presaleAddress != address(0)) {
require(presaleAddress != address(this));
pool.presaleAddress = presaleAddress;
@@ -291,17 +294,24 @@ library ProPoolLib {
/**
* @dev Lock presale address.
*/
function lockPresaleAddress(Pool storage pool, address presaleAddress)
function lockPresaleAddress(Pool storage pool, address presaleAddress, bool lock)
public
onlyAdmin(pool)
onlyInState(pool, State.Open)
{
require(presaleAddress != address(0));
require(presaleAddress != address(this));
require(pool.presaleAddress == address(0));
require(!pool.lockPresale);

// Set (lock) presale address.
// Set presale address.
pool.presaleAddress = presaleAddress;

// Lock presale address.
if(lock) {
pool.lockPresale = true;
}

emit PresaleAddressLocked(presaleAddress);
}

0 comments on commit 17a1e1a

Please sign in to comment.
You can’t perform that action at this time.