OneDaijo / daijo-contracts

Apache License 2.0
6 stars 2 forks source link

changed all references of crowdsale to token sale #49

Closed nickdeng4 closed 6 years ago

thiefinparis commented 6 years ago
Searching 29 files for "crowdsale"

contracts/permissions/Controllable.sol:
    7  /** @title Controllable
    8    * @author WorldRapidFinance <info@worldrapidfinance.com>
    9:   * @dev Base class that provides crowdsale control functions to interact with QINCrowdsale.sol
   10  */
   11  contract Controllable is Ownable {
   ..
   19      mapping (address => bool) registeredUserWhitelist;
   20  
   21:     // Requires the crowdsale to be not halted (previously breakInEmergency)
   22      modifier onlyIfActive {
   23          if (halted) {
   ..
   26          _;
   27      }
   28:     // Requires the crowdsale to be halted (previously onlyInEmergency)
   29      modifier onlyIfHalted {
   30          if (!halted) {
   ..
   39      }
   40  
   41:     // Halt the crowdsale in case of an emergency
   42:     function haltCrowdsale() external onlyOwner {
   43          halted = true;
   44      }
   45  
   46:     // Unhalt the crowdsale
   47:     function unhaltCrowdsale() external onlyOwner onlyIfHalted {
   48          halted = false;
   49      }
   50  
   51:     // Sets manualEnd to true, making fxn hasEnded() return true, setting the crowdsale state to SaleComplete
   52:     // This function is an option to prematurely end a halted crowdsale
   53:     function endCrowdsale() external onlyOwner onlyIfHalted {
   54          manualEnd = true;
   55      }

contracts/tknsale/QINTokenSale.sol:
    8  
    9  
   10: /** @title QIN Token Crowdsale Contract
   11   *  @author WorldRapidFinance <info@worldrapidfinance.com>
   12   */
   ..
   14      using SafeMath for uint;
   15  
   16:     /* QIN Token Crowdsale */
   17  
   18      // The token being sold
   ..
  103          require(!hasBeenSupplied);
  104  
  105:         // Crowdsale can only be paid by the owner of the tokenSale.
  106          require(_from == owner);
  107  
  ...
  193      // @return true if the transaction can buy tokens
  194      function validPurchase() internal constant returns (bool) {
  195:         bool duringCrowdsale = (now >= startTime) && (now <= endTime);
  196          bool nonZeroPurchase = msg.value != 0;
  197:         return duringCrowdsale && nonZeroPurchase && !halted && tokenSaleTokensRemaining != 0;
  198      }
  199  
  200      // @return true if tokenSale event has ended
  201      function hasEnded() public constant returns (bool) {
  202:         return now > endTime || crowdsaleTokensRemaining == 0 || manualEnd;
  203      }
  204  

contracts/token/QINFrozen.sol:
   48          require(!frozen);
   49  
   50:         // Crowdsale can only be paid by the owner of QINFrozen.
   51          require(_from == owner);
   52  

test/TestQINToken.js:
    3  // contract('QINToken', function(accounts) {
    4  //   var qinToken;
    5: //   var crowdsale;
    6  
    7  //   var Web3 = require('web3');
    .
   11  //   var user = web3.eth.accounts[1];
   12  
   13: //   it("integration test for crowdsale: create QINToken", function() {
   14  //     return QINToken.deployed().then(function(instance) {
   15  //       qinToken = instance;
   ..
   20  //       // TODO(mrice): the block number is coming back undefined.  This needs to be investigated further.
   21  //       var current_time = new Date().getTime() / 1000;
   22: //       qinToken.startCrowdsale(current_time + 5, current_time + 1000, 3, 250, accounts[0], 1597721000);
   23  //     }).then(function() {
   24  //       return qinToken.balanceOf(accounts[0]);
   25  //     }).then(function(balance) {
   26: //       assert.equal(balance.valueOf(), 0, "the correct balance wasn't in the first after crowdsale start");
   27  //     }).catch(function(err) {
   28  //       assert.equal("err", "no error", "there was an error thrown" + err);
   29  //     // }).then(function() {
   30: //     //   return web3.eth.sendTransaction({from: user, to: crowdsale, value: web3.toWei(1, 'ether'), gasLimit: 21000, gasPrice: 1000});
   31  //     // }).then(function() {
   32  //     //   return qinToken.balanceOf.call(user);

test/TestQINToken.sol:
   19          uint expected = qin.frozenSupply() + qin.tokenSaleSupply();
   20  
   21:         Assert.equal(qin.balanceOf(this), expected, "Owner should have fozenSupply + crowdsaleSupply initially.");
   22      }
   23  

24 matches across 5 files
thiefinparis commented 6 years ago

Sorry, it didn't keep the highlighting of the instances, but they're definitely all in those files/blocks

thiefinparis commented 6 years ago

Also, you probably already saw this, but the compilation is failing:

/var/lib/jenkins/workspace/worldrapidfinance_wrf_PR-49-IBBCBUWJ4L6KTLRBS6F7FP5V6I3O6MYP4S6RKVGDR3BQ6V5ORXBQ/contracts/tknsale/QINTokenSale.sol:202:33: DeclarationError: Undeclared identifier.
        return now > endTime || crowdsaleTokensRemaining == 0 || manualEnd;