DRI-network / RICO

The Responsible Initial Coin Offering Framework
GNU General Public License v3.0
92 stars 19 forks source link

Replace Withdrawal round and Token round RICO to PoD #20

Closed syrohei closed 6 years ago

syrohei commented 6 years ago
function addTokenRound(uint _index) public onlyOwner() returns(bool) {

    require(status == Status.TokenCreated);

    PoD pod = PoD(pods[_index]);

    if (pod.podType() == 110)   //TOB pod
      tobLimitWei = tobLimitWei.add(pod.proofOfDonationCapOfWei());

    pod.init();

    nowSupply = nowSupply.add(pod.proofOfDonationCapOfToken());

    require(nowSupply <= totalSupply);

    AddTokenRound(address(pod));

    return true;
  }
 function addWithdrawalRound(uint256 _distributeWei, uint256 _execTime, address _to, bool _isMM) public onlyOwner() returns(bool) {

    require(status == Status.TokenCreated);

    require(_execTime >= block.timestamp);  

    require(wLimitWei[_to][_distributeWei] == 0);  

    if (_isMM)
      require(tobLimitWei >= nowReserveWei.add(_distributeWei));

    wLimitWei[_to][_distributeWei] = _execTime;

    nowReserveWei = nowReserveWei.add(_distributeWei);

    AddWithdrawalRound(_distributeWei, _execTime, _to, _isMM, nowReserveWei);

    return true;
  }

both round's logic to be strictly. so to implement flexible, architecture transition to PoD.