Contract Overview
Balance: 0 Ether
Ether Value: $0
Transactions: 44 txns
Token Tracker: Sword Coin (SWDC)
Misc:
Address Watch: Add To Watch List
Contract Creator: 0x284489f27de63e9767e31a81078514d1357b24ceat txn 0x84ac8c9f36bfa68c3dac58dc0650a589fd8aed68edf66b61f70fecc664b4bac9
Token Balance:
 Latest 25 transactions from a total of 44 transactions

TxHash Age From To Value [TxFee]
0xfd3f88e34e8d78bae45802553e2ae2475480a6351e206cfc27ae9c353816dca527 days 12 hrs ago0x598f24a96a65633e971bf85050b0f64c2f70994f  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.000183875328
0x326a94745acfbbd45a22778dc425ed7de4eb25c8058e710a78e0dbdef66d300a27 days 12 hrs ago0x598f24a96a65633e971bf85050b0f64c2f70994f  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.000209589
0xabece1ec5ad42e86ea78cc005fe71618a5d61d11185bb06ced1a197e04d12b0c27 days 12 hrs ago0xcb72639cc12e9ba1f8cbf9968000f8a9323313e9  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.0001326024
0x6d9c3ef06ff1ae7c8987f942c5bc6435e00cc851b4bf22084e07c8c96f880fca27 days 12 hrs ago0xcb72639cc12e9ba1f8cbf9968000f8a9323313e9  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.0001866024
0x2c8b83be6a718b86223cccc32111dd014a9be1e3a02c000a2a2e360ed9ba5b1027 days 12 hrs ago0xec01d5a6b2b4ff4fbc0cb45d5381042a892a9e98  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.000110118
0xcb192e308272d554ec6c67a02f0adcb59eb236650145295824344efadc2ebc1238 days 11 hrs ago0xea1ac26e12949670fe42646dda3a3250b6c13e7a  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.0002532714
0xf343ce4c971ed58b12f9236ca18b56f97eb80ab1b2c7307262ad46103d419b2344 days 8 hrs ago0xcb72639cc12e9ba1f8cbf9968000f8a9323313e9  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.000240498781
0xcc55ba59d2d51d662287ac51557b18b7775df43a1c9dfe2c2a23496d4e55a3ea46 days 7 hrs ago0xcb72639cc12e9ba1f8cbf9968000f8a9323313e9  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.0004756952
0xef5d56232abbef66c5358d4c9fb5710f67076e9786f744d16ad8e4d42d07434050 days 7 hrs ago0xa79a40709bde9857f945763ee57d197cc34c2c1b  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.0001758816
0xf9c62bfc98a7fb2823e96044063baad630b22a6fb3587dca79cafcf968e9fcab50 days 8 hrs ago0x01d43980a8b9cb945afbb692725cb370568e03e1  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.0002481888
0xa25ffc14d9bcc0c08139fcd019e480aced2ce62a479773275467f61a917d441851 days 8 hrs ago0xea940816e88d0eef83ae007ef0d67f8e1241fc0c  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.0001324066
0x10ad46aa64a849a33f94ace36da01074a999a31d81116c27a0bfb6a3a1c598cd51 days 9 hrs ago0xea940816e88d0eef83ae007ef0d67f8e1241fc0c  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.0002239066
0x4b4c272110598d9a6aef7e47a88c7f8099c58808e3acaee761048b7f1c12c7a651 days 9 hrs ago0xea940816e88d0eef83ae007ef0d67f8e1241fc0c  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.0002235162
0x3399b0f5f3505d00fe8585c4a0229d6834e213d78e4e5db1de13968b2ac057a051 days 9 hrs ago0x01d43980a8b9cb945afbb692725cb370568e03e1  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.00036226863
0x3c3accb878678f2ec6975fad0b09a987d7de0c8f6da9c7750fc3e78dc8e14c2353 days 12 hrs ago0xcb72639cc12e9ba1f8cbf9968000f8a9323313e9  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.0001240944
0xfae8a4fea69ad83d645cc004fd463df913ee2b10d07bc000748c29b14a6eee0855 days 9 hrs ago0xcb72639cc12e9ba1f8cbf9968000f8a9323313e9  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.0003567714
0xb0f56e707fc4afceb812397b9c2e54153631f38175a04513e84746f3e8b9bb2255 days 12 hrs ago0x01d43980a8b9cb945afbb692725cb370568e03e1  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.000635647711
0x32a75c3860bc7c4a7670db5a7dee5fff68c578773c218539df9d9d47cdbc8b4157 days 3 hrs ago0x01d43980a8b9cb945afbb692725cb370568e03e1  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.00005716152
0x19907a1661168bfd3c822725341fc6b007d1a5a498c2365c20bfbfbd7a5c9c8957 days 3 hrs ago0xcb72639cc12e9ba1f8cbf9968000f8a9323313e9  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.000068872392
0xb92313c9e3882dbd0a2e26d305ffbc3ff93d3f77e48b8ff49846ef3493df77dd57 days 4 hrs ago0xcb72639cc12e9ba1f8cbf9968000f8a9323313e9  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.00009927552
0x64c0fa6590dd2af34b90ab275e7f84e12ccdd9a25d3ff70a985c6241836ec47d57 days 4 hrs ago0xcb72639cc12e9ba1f8cbf9968000f8a9323313e9  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.00007047552
0xabbd43bb51da66c359131c8938b6e20aa5a99081d265466cb3f66499c7f0434b57 days 4 hrs ago0xcb72639cc12e9ba1f8cbf9968000f8a9323313e9  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.0001240944
0x7e7a288d070c90a89747eef6a143a71d629f9b40e48e4df6c288f6e255d9f81357 days 8 hrs ago0x01d43980a8b9cb945afbb692725cb370568e03e1  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.00009927552
0xf11362361ae83f4c1c0db07d837a8c8774295fcb6a1ca8907b0209b1b37f1b8d57 days 10 hrs ago0x5b9411da20a74f5597807ea32ce2e3b410699891  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.000151494
0x21da247593a722b9eaaffd4d0e9fbeb45d8861dc5e02b5de3ef5032438539a1b57 days 10 hrs ago0xcb72639cc12e9ba1f8cbf9968000f8a9323313e9  IN   0x4619df2ca5795834edda178610b6adb46acf47a90 Ether0.000353055031
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: SwordToken
Compiler Text: v0.4.24-nightly.2018.4.27+commit.1604a996
Optimization Enabled: No
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.19;

contract Ownable {
  address public owner;
  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
  constructor() public { owner = msg.sender;  }
 
  modifier onlyOwner() {     
      address sender =  msg.sender;
      address _owner = owner;
      require(msg.sender == _owner);    
      _;  
  }
  
  function transferOwnership(address newOwner) onlyOwner public { 
    require(newOwner != address(0));
    emit OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }
}

library SafeMath {
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract ERC20Basic {
  uint256 public totalSupply;
  function balanceOf(address who) public constant returns (uint256);
  function transfer(address to, uint256 value) public returns (bool);
  event Transfer(address indexed from, address indexed to, uint256 value);
}

/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
contract ERC20 is ERC20Basic {
  function allowance(address owner, address spender) public constant returns (uint256);
  function transferFrom(address from, address to, uint256 value) public returns (bool);
  function approve(address spender, uint256 value) public returns (bool);
  event Approval(address indexed owner, address indexed spender, uint256 value);
}

contract BasicToken is ERC20Basic {
  using SafeMath for uint256;
  mapping(address => uint256) balances;

  /**
  * @dev transfer token for a specified address
  * @param _to The address to transfer to.
  * @param _value The amount to be transferred.
  */
  function transfer(address _to, uint256 _value) public returns (bool) {
    require(_to != address(0));

    // SafeMath.sub will throw if there is not enough balance.
    balances[msg.sender] = balances[msg.sender].sub(_value);
    balances[_to] = balances[_to].add(_value);
    emit Transfer(msg.sender, _to, _value);
    return true;
  }
  
  /**
  * @dev Gets the balance of the specified address.
  * @param _owner The address to query the the balance of.
  * @return An uint256 representing the amount owned by the passed address.
  */
  function balanceOf(address _owner) public constant returns (uint256 balance) {
    return balances[_owner];
  }

}

/**
 * @title Standard ERC20 token
 *
 * @dev Implementation of the basic standard token.
 * @dev https://github.com/ethereum/EIPs/issues/20
 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
 */
contract StandardToken is ERC20, BasicToken {

  mapping (address => mapping (address => uint256)) allowed;

  /**
   * @dev Transfer tokens from one address to another
   * @param _from address The address which you want to send tokens from
   * @param _to address The address which you want to transfer to
   * @param _value uint256 the amount of tokens to be transferred
   */
  function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
    require(_to != address(0));
    uint256 _allowance = allowed[_from][msg.sender];
    balances[_from] = balances[_from].sub(_value);
    balances[_to] = balances[_to].add(_value);
    allowed[_from][msg.sender] = _allowance.sub(_value);
    emit Transfer(_from, _to, _value);
    return true;
  }

  /**
   * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
   *
   * Beware that changing an allowance with this method brings the risk that someone may use both the old
   * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
   * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
   * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
   * @param _spender The address which will spend the funds.
   * @param _value The amount of tokens to be spent.
   */
  function approve(address _spender, uint256 _value) public returns (bool) {
    allowed[msg.sender][_spender] = _value;
    emit Approval(msg.sender, _spender, _value);
    return true;
  }

  /**
   * @dev Function to check the amount of tokens that an owner allowed to a spender.
   * @param _owner address The address which owns the funds.
   * @param _spender address The address which will spend the funds.
   * @return A uint256 specifying the amount of tokens still available for the spender.
   */
  function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
    return allowed[_owner][_spender];
  }

  /**
   * approve should be called when allowed[_spender] == 0. To increment
   * allowed value is better to use this function to avoid 2 calls (and wait until
   * the first transaction is mined)
   * From MonolithDAO Token.sol
   */
  function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
    allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }

  function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
    uint oldValue = allowed[msg.sender][_spender];
    if (_subtractedValue > oldValue) {
      allowed[msg.sender][_spender] = 0;
    } else {
      allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
    }
    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }

}

contract MintableToken is StandardToken, Ownable {
  event Mint(address indexed to, uint256 amount);
  event MintFinished();

  bool public mintingFinished = false;

  modifier canMint() {
    require(!mintingFinished);
    _;
  }

  /**
   * @dev Function to mint tokens
   * @param _to The address that will receive the minted tokens.
   * @param _amount The amount of tokens to mint.
   * @return A boolean that indicates if the operation was successful.
   */
  function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
    totalSupply = totalSupply.add(_amount);
    balances[_to] = balances[_to].add(_amount);
    emit Mint(_to, _amount);
    emit Transfer(0x0, _to, _amount);
    return true;
  }
  
  /**
   * @dev Function to mint tokens
   * @param _to The address that will receive the minted tokens.
   * @param _amount The amount of tokens to mint.
   * @return A boolean that indicates if the operation was successful.
   */
  function mintFinalize(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
    totalSupply = totalSupply.add(_amount);
    balances[_to] = balances[_to].add(_amount);
    emit Mint(_to, _amount);
    emit Transfer(0x0, _to, _amount);
    return true;
  }

  /**
   * @dev Function to stop minting new tokens.
   * @return True if the operation was successful.
   */
  function finishMinting() onlyOwner public returns (bool) {
    mintingFinished = true;
    emit MintFinished();
    return true;
  }
}

/**
 * @title SwordToken
 * @dev Sword ERC20 Token that can be minted.
 * It is meant to be used in Sword crowdsale contract.
 */
contract SwordToken is MintableToken {

    string public constant name = "Sword Coin"; 
    string public constant symbol = "SWDC";
    uint8 public constant decimals = 18;

    function getTotalSupply() view public returns (uint256) {
        return totalSupply;
    }
    
    function transfer(address _to, uint256 _value) public returns (bool) {
        super.transfer(_to, _value);
    }
    
}

contract KycContractInterface {
    function isAddressVerified(address _address) public view returns (bool);
}

contract KycContract is Ownable {
    
    mapping (address => bool) verifiedAddresses;
    
    function isAddressVerified(address _address) public view returns (bool) {
        return verifiedAddresses[_address];
    }
    
    function addAddress(address _newAddress) public onlyOwner {
        require(!verifiedAddresses[_newAddress]);
        
        verifiedAddresses[_newAddress] = true;
    }
    
    function removeAddress(address _oldAddress) public onlyOwner {
        require(verifiedAddresses[_oldAddress]);
        
        verifiedAddresses[_oldAddress] = false;
    }
    
    function batchAddAddresses(address[] _addresses) public onlyOwner {
        for (uint cnt = 0; cnt < _addresses.length; cnt++) {
            assert(!verifiedAddresses[_addresses[cnt]]);
            verifiedAddresses[_addresses[cnt]] = true;
        }
    }
}


/**
 * @title SwordCrowdsale
 * @dev This is Sword's crowdsale contract.
 */
contract SwordCrowdsale is Ownable {
    using SafeMath for uint256;
    
    // start and end timestamps where investments are allowed (both inclusive)
    uint256 public startTime;
    uint256 public endTime;
    // amount of raised money in wei
    uint256 public weiRaised;
    uint256 public limitDateSale; // end date in units
   
    bool public isSoftCapHit = false;
    bool public isStarted = false;
    bool public isFinalized = false;
   
   struct ContributorData {
        uint256 contributionAmount;
        uint256 tokensIssued;
    }
   
   address[] public tokenSendFailures;
   
    mapping(address => ContributorData) public contributorList;
    mapping(uint => address) contributorIndexes;
    uint nextContributorIndex;

    constructor() public {}
    
   function init(uint256 _totalTokens, uint256 _tokensForCrowdsale, address _wallet, 
        uint256 _etherInUSD, address _tokenAddress, uint256 _softCapInEthers, uint256 _hardCapInEthers, 
        uint _saleDurationInDays, address _kycAddress, uint bonus) onlyOwner public {
        
        setTotalTokens(_totalTokens);
        setTokensForCrowdSale(_tokensForCrowdsale);
        setWallet(_wallet);
        setRate(_etherInUSD);
        setTokenAddress(_tokenAddress);
        setSoftCap(_softCapInEthers);
        setHardCap(_hardCapInEthers);
        setSaleDuration(_saleDurationInDays);
        setKycAddress(_kycAddress);
        setSaleBonus(bonus);
        kyc = KycContract(_kycAddress);
        start(); // starting the crowdsale
   }
   
    /**
    * @dev Must be called to start the crowdsale
    */
    function start() onlyOwner public {
        require(!isStarted);
        require(!hasStarted());
        require(wallet != address(0));
        require(tokenAddress != address(0));
        require(kycAddress != address(0));
        require(rate != 0);
        require(saleDuration != 0);
        require(totalTokens != 0);
        require(tokensForCrowdSale != 0);
        require(softCap != 0);
        require(hardCap != 0);
        
        starting();
        emit SwordStarted();
        
        isStarted = true;
    }
  
  
   uint256 public totalTokens = 0;
   function setTotalTokens(uint256 _totalTokens) onlyOwner public {
       totalTokens = _totalTokens * (10 ** 18); // Total 1 billion tokens, 75 percent will be sold
   }
    
   uint256 public tokensForCrowdSale = 0;
   function setTokensForCrowdSale(uint256 _tokensForCrowdsale) onlyOwner public {
       tokensForCrowdSale = _tokensForCrowdsale * (10 ** 18); // Total 1 billion tokens, 75 percent will be sold 
   }
 
    // address where funds are collected
    address public wallet = 0x0;
    function setWallet(address _wallet) onlyOwner public {
        wallet = _wallet;
    } 

    uint256 public rate = 0;
    function setRate(uint256 _etherInUSD) public onlyOwner{
         rate = (5 * (10**18) / 100) / _etherInUSD;
    }
    
    // The token being sold
    SwordToken public token;
    address tokenAddress = 0x0; 
    function setTokenAddress(address _tokenAddress) public onlyOwner {
        tokenAddress = _tokenAddress; // to check if token address is provided at start
        token = SwordToken(_tokenAddress);
    }

   uint256 public softCap = 0;
   function setSoftCap(uint256 _softCap) onlyOwner public {
       softCap = _softCap * (10 ** 18); 
    }
   
   uint256 public hardCap = 0; 
   function setHardCap(uint256 _hardCap) onlyOwner public {
       hardCap = _hardCap * (10 ** 18); 
   }
  
    // sale period (includes holidays)
    uint public saleDuration = 0; // in days ex: 60.
    function setSaleDuration(uint _saleDurationInDays) onlyOwner public {
        saleDuration = _saleDurationInDays;
		limitDateSale = startTime + (saleDuration * 1 days);
        endTime = limitDateSale;
    }
  
    address kycAddress = 0x0;
    function setKycAddress(address _kycAddress) onlyOwner public {
        kycAddress = _kycAddress;
    }
	
    uint public saleBonus = 0; // ex. 10
    function setSaleBonus(uint bonus) public onlyOwner{
        saleBonus = bonus;
    }
  
   bool public isKYCRequiredToReceiveFunds = true; // whether Kyc is required to receive funds.
    function setKYCRequiredToReceiveFunds(bool IS_KYCRequiredToReceiveFunds) public onlyOwner{
        isKYCRequiredToReceiveFunds = IS_KYCRequiredToReceiveFunds;
    }
    
    bool public isKYCRequiredToSendTokens = true; // whether Kyc is required to send tokens.
      function setKYCRequiredToSendTokens(bool IS_KYCRequiredToSendTokens) public onlyOwner{
        isKYCRequiredToSendTokens = IS_KYCRequiredToSendTokens;
    }
    
    
    // fallback function can be used to buy tokens
    function () public payable {
        buyTokens(msg.sender);
    }
    
   KycContract public kyc;
   function transferKycOwnerShip(address _address) onlyOwner public {
       kyc.transferOwnership(_address);
   }
   
   function transferTokenOwnership(address _address) onlyOwner public {
       token.transferOwnership(_address);
   }
   
    /**
     * release Tokens
     */
    function releaseAllTokens() onlyOwner public {
        for(uint i=0; i < nextContributorIndex; i++) {
            address addressToSendTo = contributorIndexes[i]; // address of user
            releaseTokens(addressToSendTo);
        }
    }
    
    /**
     * release Tokens of an individual address
     */
    function releaseTokens(address _contributerAddress) onlyOwner public {
        if(isKYCRequiredToSendTokens){
             if(KycContractInterface(kycAddress).isAddressVerified(_contributerAddress)){ // if kyc needs to be checked at release time
                release(_contributerAddress);
             }
        } else {
            release(_contributerAddress);
        }
    }
    
    function release(address _contributerAddress) internal {
        if(contributorList[_contributerAddress].tokensIssued > 0) { 
            if(token.mint(_contributerAddress, contributorList[_contributerAddress].tokensIssued)) { // tokens sent successfully
                contributorList[_contributerAddress].tokensIssued = 0;
                contributorList[_contributerAddress].contributionAmount = 0;
            } else { // token sending failed, has to be processed manually
                tokenSendFailures.push(_contributerAddress);
            }
        }
    }
    
    function tokenSendFailuresCount() public view returns (uint) {
        return tokenSendFailures.length;
    }
   
    function buyTokens(address beneficiary) public payable {
        require(beneficiary != address(0));
        require(validPurchase());
        if(isKYCRequiredToReceiveFunds){
            require(KycContractInterface(kycAddress).isAddressVerified(msg.sender));
        }

        uint256 weiAmount = msg.value;

        // calculate token amount to be created
        uint256 tokens = computeTokens(weiAmount);

        require(isWithinTokenAllocLimit(tokens));

        // update state - Add to eth raised
        weiRaised = weiRaised.add(weiAmount);

        if (contributorList[beneficiary].contributionAmount == 0) { // if its a new contributor, add him and increase index
            contributorIndexes[nextContributorIndex] = beneficiary;
            nextContributorIndex += 1;
        }
        contributorList[beneficiary].contributionAmount += weiAmount;
        contributorList[beneficiary].tokensIssued += tokens;

        emit SwordTokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
        handleFunds();
    }
  
      /**
    * event for token purchase logging
    * @param purchaser who paid for the tokens
    * @param beneficiary who got the tokens
    * @param value weis paid for purchase
    * @param amount amount of tokens purchased
    */
    event SwordTokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
  
    function investorCount() constant public returns(uint) {
        return nextContributorIndex;
    }
    
    // @return true if crowdsale event has started
    function hasStarted() public constant returns (bool) {
        return (startTime != 0 && now > startTime);
    }

    // send ether to the fund collection wallet
    function forwardFunds() internal {
        wallet.transfer(msg.value);
    }
    
     // send ether to the fund collection wallet
    function forwardAllRaisedFunds() internal {
        wallet.transfer(weiRaised);
    }

    function isWithinSaleTimeLimit() internal view returns (bool) {
        return now <= limitDateSale;
    }

    function isWithinSaleLimit(uint256 _tokens) internal view returns (bool) {
        return token.getTotalSupply().add(_tokens) <= tokensForCrowdSale;
    }

    function computeTokens(uint256 weiAmount) view internal returns (uint256) {
        uint256 appliedBonus = 0;
        if (isWithinSaleTimeLimit()) {
            appliedBonus = saleBonus;
        } 
        return (weiAmount.div(rate) + (weiAmount.div(rate).mul(appliedBonus).div(100))) * (10 ** 18);
    }
    
    function isWithinTokenAllocLimit(uint256 _tokens) view internal returns (bool) {
        return (isWithinSaleTimeLimit() && isWithinSaleLimit(_tokens));
    }

    function didSoftCapReached() internal returns (bool) {
        if(weiRaised >= softCap){
            isSoftCapHit = true; // setting the flag that soft cap is hit and all funds should be sent directly to wallet from now on.
        } else {
            isSoftCapHit = false;
        }
        return isSoftCapHit;
    }

    // overriding SwordBaseCrowdsale#validPurchase to add extra cap logic
    // @return true if investors can buy at the moment
    function validPurchase() internal constant returns (bool) {
        bool withinCap = weiRaised.add(msg.value) <= hardCap;
        bool withinPeriod = now >= startTime && now <= endTime; 
        bool nonZeroPurchase = msg.value != 0; 
        return (withinPeriod && nonZeroPurchase) && withinCap && isWithinSaleTimeLimit();
    }

    // overriding Crowdsale#hasEnded to add cap logic
    // @return true if crowdsale event has ended
    function hasEnded() public constant returns (bool) {
        bool capReached = weiRaised >= hardCap;
        return (endTime != 0 && now > endTime) || capReached;
    }

  

  event SwordStarted();
  event SwordFinalized();

  /**
   * @dev Must be called after crowdsale ends, to do some extra finalization
   * work. Calls the contract's finalization function.
   */
  function finalize() onlyOwner public {
    require(!isFinalized);
   // require(hasEnded());

    finalization();
    emit SwordFinalized();

    isFinalized = true;
  }

    function starting() internal {
        startTime = now;
        limitDateSale = startTime + (saleDuration * 1 days);
        endTime = limitDateSale;
    }

    function finalization() internal {
        uint256 remainingTokens = totalTokens.sub(token.getTotalSupply());
        token.mintFinalize(wallet, remainingTokens);
        forwardAllRaisedFunds(); 
    }
    
    // overridden
    function handleFunds() internal {
        if(isSoftCapHit){ // if soft cap is reached, start transferring funds immediately to wallet
            forwardFunds();  
        } else {
            if(didSoftCapReached()){    
                forwardAllRaisedFunds();            
            }
        }
    }
    
     modifier afterDeadline() { if (hasEnded() || isFinalized) _; } // a modifier to tell token sale ended 
    
  /**
     * auto refund Tokens
     */
    function refundAllMoney() onlyOwner public {
        for(uint i=0; i < nextContributorIndex; i++) {
            address addressToSendTo = contributorIndexes[i];
            refundMoney(addressToSendTo); 
        }
    }
    
    /**
     * refund Tokens of a single address
     */
    function refundMoney(address _address) onlyOwner public {
        uint amount = contributorList[_address].contributionAmount;
        if (amount > 0 && _address.send(amount)) { // user got money back
            contributorList[_address].contributionAmount =  0;
            contributorList[_address].tokensIssued =  0;
        } 
    }
}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"mintingFinished","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"mint","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_subtractedValue","type":"uint256"}],"name":"decreaseApproval","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"finishMinting","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"mintFinalize","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getTotalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_addedValue","type":"uint256"}],"name":"increaseApproval","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[],"name":"MintFinished","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}]

  Contract Creation Code Switch To Opcodes View
60806040526000600360146101000a81548160ff02191690831515021790555033600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061196b8061006f6000396000f3006080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461010157806306fdde0314610130578063095ea7b3146101c057806318160ddd1461022557806323b872dd14610250578063313ce567146102d557806340c10f1914610306578063661884631461036b57806370a08231146103d05780637d64bcb41461042757806386f8e4ef146104565780638da5cb5b146104bb57806395d89b4114610512578063a9059cbb146105a2578063c4e41b2214610607578063d73dd62314610632578063dd62ed3e14610697578063f2fde38b1461070e575b600080fd5b34801561010d57600080fd5b50610116610751565b604051808215151515815260200191505060405180910390f35b34801561013c57600080fd5b50610145610764565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018557808201518184015260208101905061016a565b50505050905090810190601f1680156101b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cc57600080fd5b5061020b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061079d565b604051808215151515815260200191505060405180910390f35b34801561023157600080fd5b5061023a61088f565b6040518082815260200191505060405180910390f35b34801561025c57600080fd5b506102bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610895565b604051808215151515815260200191505060405180910390f35b3480156102e157600080fd5b506102ea610b81565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031257600080fd5b50610351600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b86565b604051808215151515815260200191505060405180910390f35b34801561037757600080fd5b506103b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d63565b604051808215151515815260200191505060405180910390f35b3480156103dc57600080fd5b50610411600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ff4565b6040518082815260200191505060405180910390f35b34801561043357600080fd5b5061043c61103d565b604051808215151515815260200191505060405180910390f35b34801561046257600080fd5b506104a1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110f4565b604051808215151515815260200191505060405180910390f35b3480156104c757600080fd5b506104d06112d1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561051e57600080fd5b506105276112f7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561056757808201518184015260208101905061054c565b50505050905090810190601f1680156105945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105ae57600080fd5b506105ed600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611330565b604051808215151515815260200191505060405180910390f35b34801561061357600080fd5b5061061c611343565b6040518082815260200191505060405180910390f35b34801561063e57600080fd5b5061067d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061134c565b604051808215151515815260200191505060405180910390f35b3480156106a357600080fd5b506106f8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611548565b6040518082815260200191505060405180910390f35b34801561071a57600080fd5b5061074f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115cf565b005b600360149054906101000a900460ff1681565b6040805190810160405280600a81526020017f53776f726420436f696e0000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156108d457600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506109a583600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461173290919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a3a83600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174b90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a90838261173290919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6000806000339150600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bed57600080fd5b600360149054906101000a900460ff16151515610c0957600080fd5b610c1e8460005461174b90919063ffffffff16565b600081905550610c7684600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174b90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885856040518082815260200191505060405180910390a28473ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019250505092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610e74576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f08565b610e87838261173290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806000339150600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110a457600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a160019250505090565b6000806000339150600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561115b57600080fd5b600360149054906101000a900460ff1615151561117757600080fd5b61118c8460005461174b90919063ffffffff16565b6000819055506111e484600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174b90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885856040518082815260200191505060405180910390a28473ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019250505092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f535744430000000000000000000000000000000000000000000000000000000081525081565b600061133c8383611769565b5092915050565b60008054905090565b60006113dd82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080339150600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561163457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561167057600080fd5b8273ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a382600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b600082821115151561174057fe5b818303905092915050565b600080828401905083811015151561175f57fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156117a657600080fd5b6117f882600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461173290919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061188d82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174b90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a723058200dda774ec4aa56434df62527b8fbc80663ad0df1ddb95f2ee7f2086f22d00a4a0029

   Swarm Source:
bzzr://0dda774ec4aa56434df62527b8fbc80663ad0df1ddb95f2ee7f2086f22d00a4a

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.