Sponsored Link:   DocTailor - Legal Self Customisable Smart Contract Platform - Bridging the Gap Between Business & Cryptocurrency Holders - Join Now!
Contract Overview
ETH Balance: 0 Ether
ETH USD Value: $0
No Of Transactions: 41 txns
  Latest 25 txns from a total Of 41 transactions View All

TxHash Age From To Value [TxFee]
0xa2d132d0a3453dd5034c68fcb48698f74e78f07802186149d73caea6c9d2a29422 days 16 hrs ago0x4a6e53c8358fa13a955a2db38b92d12b48b33970  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b50 Ether0.000029484
0xc606c886468cc9345da415ca9b38b046557dc70970d5c659a5a888918c6cb9a852 days 3 hrs ago0x4a6e53c8358fa13a955a2db38b92d12b48b33970  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b50 Ether0.000117936
0x9b57b31187e38828d894b2d43c411dd2fa350a9b6d5b862ad8d2a4ae6708dd4452 days 3 hrs ago0x4a6e53c8358fa13a955a2db38b92d12b48b33970  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b50 Ether0.000183908
0x356ec3af3932726ad469d4489f83f7054771697892a92756e8f726036d3332b967 days 19 hrs ago0x1554abcf6f0189bfe32c7bad69886c751966cae0  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b51 Ether0.00044122
0x1373b8caba2a894f6e7a5048bc4e186ac4538b1b7b9b09f2b7ec9ebf0fd0bbb772 days 23 hrs ago0x9421c0a161a7883e17a478aa3dddc60fee212da5  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b51 Ether0.000044122
0x7abc56796f58cf4fa6414f2a55086792f8fb7e76bee4645ec5a930d69cf8463a73 days 5 mins ago0x9421c0a161a7883e17a478aa3dddc60fee212da5  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b51 Ether0.00044122
0xbf32b96014af04fb5f6ec71abc48b9c040414219903db05f4941cd0b61b5d1a773 days 15 mins ago0x9421c0a161a7883e17a478aa3dddc60fee212da5  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b51 Ether0.00042092
0xde81a6b35ab290739838aad923b373a98657e676a487aab5f560f821d89910d477 days 2 hrs ago0x6aaa7f5189ca775504051a3a14ee354df5b6e72a  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b51 Ether0.0000673472
0xdcc70e8a41433d002a45646b7bd705e848583795aff50fd51b8077bc251b6fd177 days 18 hrs ago0x4a6e53c8358fa13a955a2db38b92d12b48b33970  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b50 Ether0.000184164
0x22d16d2b995b21f052996fd3f62f187a28211322f62e44db03b68fe7fdc119f077 days 18 hrs ago0x4a6e53c8358fa13a955a2db38b92d12b48b33970  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b50 Ether0.000184164
0x37cc2ae5d3b016d7b04de065ce7a957860cf3ac5ae091c29b9d778ec049cb7f482 days 22 hrs ago0x4a42ae74386e277859dc40428314287b19883cf3  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b51 Ether0.000503576
0x5e2e87ddd1130a60a15ff630f2ed12ee7e3f6760cca7a31c150d6d7a368c835b86 days 17 hrs ago0x2a8cbedb3d9d59dc4bace65b5cec60e3fc7c57de  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b51 Ether0.000251788
0xc2729347654b2cf087c4a46c047cef08efdda7a41a1537dabbccb119e565f49086 days 17 hrs ago0x4a6e53c8358fa13a955a2db38b92d12b48b33970  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b50 Ether0.000046041
0xe429d493cd205258babb3cd68e051f657ce28d98c69625411b9bab7d9b4dc30186 days 20 hrs ago0x2a8cbedb3d9d59dc4bace65b5cec60e3fc7c57de  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b51 Ether0.000463012
0x6464b72604ed9c38adf1ee645a721964fe13c4ef72bce05e6ff48af72b34ff7387 days 1 hr ago0xb679400ad4074ea2b9a8e37206d93232195b9cc9  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b51 Ether0.000503576
0x3356a0688a468ffdfd0c4371b08a848fc6e25f2c543d645d8486ec1d2237fd4487 days 3 hrs ago0x73c0ca323623b482bf6978542715425a88193c25  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b530 Ether0.0021046
0x7762a16ebf785ff1ed55de7dbaf17523afb84673e7368ec4a1cdf1b6b968dc3487 days 3 hrs ago0x73c0ca323623b482bf6978542715425a88193c25  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b530 Ether0.000084184
0xa24321d64cd3b8c2fb99e6a295a12b547e05e0a77785397aedad8c8b4788073187 days 3 hrs ago0x6c2ad31d3c6f2d179c43c58ced5eaee74a23b54f  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b51 Ether0.000084184
0x830ed76c13986f9c3afd800fa58877a87723a70237c41c53d1e95fa08c9b9ee587 days 3 hrs ago0x73c0ca323623b482bf6978542715425a88193c25  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b530 Ether0.0021046
0xf55f50ed489ae97ae6614e2798b7f36c217911cbbf00c896058f1193ffff230687 days 3 hrs ago0x73c0ca323623b482bf6978542715425a88193c25  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b530 Ether0.000168368
0x168dc41541f9ccb7bc149ea6ef36d15f8ff66a198167406975af69a9e20627fe87 days 3 hrs ago0x4a6e53c8358fa13a955a2db38b92d12b48b33970  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b51 Ether0.000306036
0x25a60567056cb885bf322017db7977e19bc13df79bad867a45ef86c390de5d2487 days 3 hrs ago0x73c0ca323623b482bf6978542715425a88193c25  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b530 Ether0.00042092
0x19493f13dd5dc5b6355c9d6fa31a55d76a50b1ce4c0c9721f61683418e80618587 days 4 hrs ago0x4a6e53c8358fa13a955a2db38b92d12b48b33970  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b50 Ether0.000046041
0x84294e590aecf8fe120b6d3fd727bc79a1209dbb233c4cf74b2c37cd3dcd02c087 days 4 hrs ago0x356a75deedae2b3dc8ab0ac1b0b458eec0f0111e  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b51 Ether0.000021046
0xc336d1558d63dc15cccfe3017af6561306c97c449db10f7a6697666e7bd0c8ef87 days 5 hrs ago0x356a75deedae2b3dc8ab0ac1b0b458eec0f0111e  IN   0x19662c22eaab9fb69add72ef54b296c5a72593b51 Ether0.000021046
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
  Latest 5 Internal Transactions

ParentTxHash Block Age From To Value
0x37cc2ae5d3b016d7b04de065ce7a957860cf3ac5ae091c29b9d778ec049cb7f4500801382 days 22 hrs ago0x19662c22eaab9fb69add72ef54b296c5a72593b50x33358ad0d06fafa08aeebffb3f66acd05f6d08be1 Ether
0x5e2e87ddd1130a60a15ff630f2ed12ee7e3f6760cca7a31c150d6d7a368c835b498572586 days 17 hrs ago0x19662c22eaab9fb69add72ef54b296c5a72593b50x33358ad0d06fafa08aeebffb3f66acd05f6d08be1 Ether
0x6464b72604ed9c38adf1ee645a721964fe13c4ef72bce05e6ff48af72b34ff73498374387 days 1 hr ago0x19662c22eaab9fb69add72ef54b296c5a72593b50x33358ad0d06fafa08aeebffb3f66acd05f6d08be1 Ether
0x168dc41541f9ccb7bc149ea6ef36d15f8ff66a198167406975af69a9e20627fe498314587 days 3 hrs ago0x19662c22eaab9fb69add72ef54b296c5a72593b50x33358ad0d06fafa08aeebffb3f66acd05f6d08be1 Ether
0x73637945387869fafcc35ac42ffdee1afc9d06dfe2507bc4ff055c0ff39d4662498065187 days 13 hrs ago0x19662c22eaab9fb69add72ef54b296c5a72593b50x33358ad0d06fafa08aeebffb3f66acd05f6d08be1 Ether
[ Download CSV Export  ] 
Contract Source Code Verified (Exact match)
Contract Name: TruPreSale
Compiler Version: v0.4.18+commit.9cf6e910
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts
pragma solidity ^0.4.18;


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

    function div(uint256 a, uint256 b) internal pure returns (uint256) {

        uint256 c = a / b;

        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 Ownable {

    address public owner;


    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }

    function Ownable() public {
        owner = msg.sender;
    }

    function transferOwnership(address newOwner) public onlyOwner {
        require(newOwner != address(0));
        OwnershipTransferred(owner, newOwner);
        owner = newOwner;
    }

}


contract ERC20Basic {

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


contract BasicToken is ERC20Basic {
    using SafeMath for uint256;

    mapping(address => uint256) balances;

    function transfer(address _to, uint256 _value) public returns (bool) {
        require(_to != address(0));
        require(_value <= balances[msg.sender]);
        balances[msg.sender] = balances[msg.sender].sub(_value);
        balances[_to] = balances[_to].add(_value);
        Transfer(msg.sender, _to, _value);
        return true;
    }

    function balanceOf(address _owner) public view returns (uint256 balance) {
        return balances[_owner];
    }

}


contract ERC20 is ERC20Basic {

    function allowance(address owner, address spender) public view 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 StandardToken is ERC20, BasicToken {

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

    function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
        require(_to != address(0));
        require(_value <= balances[_from]);
        require(_value <= allowed[_from][msg.sender]);
        balances[_from] = balances[_from].sub(_value);
        balances[_to] = balances[_to].add(_value);
        allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
        Transfer(_from, _to, _value);
        return true;
    }

    function approve(address _spender, uint256 _value) public returns (bool) {
        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    }

    function allowance(address _owner, address _spender) public view returns (uint256) {
        return allowed[_owner][_spender];
    }

    function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
        allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
        Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
        return true;
    }

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


contract ReleasableToken is StandardToken, Ownable {

    address public releaseAgent;

    bool public released = false;

    event Released();

    event ReleaseAgentSet(address releaseAgent);

    event TransferAgentSet(address transferAgent, bool status);

    mapping (address => bool) public transferAgents;

    modifier canTransfer(address _sender) {
        require(released || transferAgents[_sender]);
        _;
    }

    modifier inReleaseState(bool releaseState) {
        require(releaseState == released);
        _;
    }

    modifier onlyReleaseAgent() {
        require(msg.sender == releaseAgent);
        _;
    }

    function setReleaseAgent(address addr) public onlyOwner inReleaseState(false) {
        ReleaseAgentSet(addr);
        releaseAgent = addr;
    }

    function setTransferAgent(address addr, bool state) public onlyOwner inReleaseState(false) {
        TransferAgentSet(addr, state);
        transferAgents[addr] = state;
    }

    function releaseTokenTransfer() public onlyReleaseAgent {
        Released();
        released = true;
    }

    function transfer(address _to, 
                      uint _value) public canTransfer(msg.sender) returns (bool success) {
        return super.transfer(_to, _value);
    }

    function transferFrom(address _from, 
                          address _to, 
                          uint _value) public canTransfer(_from) returns (bool success) {
        return super.transferFrom(_from, _to, _value);
    }
}


contract TruMintableToken is ReleasableToken {
    
    using SafeMath for uint256;
    using SafeMath for uint;

    bool public mintingFinished = false;

    bool public preSaleComplete = false;

    bool public saleComplete = false;

    event Minted(address indexed _to, uint256 _amount);

    event MintFinished(address indexed _executor);
    
    event PreSaleComplete(address indexed _executor);

    event SaleComplete(address indexed _executor);

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

    function mint(address _to, uint256 _amount) public onlyOwner canMint returns (bool) {
        require(_amount > 0);
        require(_to != address(0));
        totalSupply = totalSupply.add(_amount);
        balances[_to] = balances[_to].add(_amount);
        Minted(_to, _amount);
        Transfer(0x0, _to, _amount);
        return true;
    }

    function finishMinting(bool _presale, bool _sale) public onlyOwner returns (bool) {
        require(_sale != _presale);
        if (_presale == true) {
            preSaleComplete = true;
            PreSaleComplete(msg.sender);
            return true;
        }
        require(preSaleComplete == true);
        saleComplete = true;
        SaleComplete(msg.sender);
        mintingFinished = true;
        MintFinished(msg.sender);
        return true;
    }
}


contract UpgradeAgent {
    
    uint public originalSupply;

    function isUpgradeAgent() public pure returns (bool) {
        return true;
    }

    function upgradeFrom(address _from, uint256 _value) public;
}


contract TruUpgradeableToken is StandardToken {

    using SafeMath for uint256;
    using SafeMath for uint;

    address public upgradeMaster;

    UpgradeAgent public upgradeAgent;

    uint256 public totalUpgraded;

    bool private isUpgradeable = true;

    enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading}

    event Upgrade(address indexed from, 
        address indexed to, 
        uint256 upgradeValue);

    event UpgradeAgentSet(address indexed agent, 
        address indexed executor);

    event NewUpgradedAmount(uint256 originalBalance, 
        uint256 newBalance, 
        address indexed executor);
    
    modifier onlyUpgradeMaster() {
        require(msg.sender == upgradeMaster);
        _;
    }

    function TruUpgradeableToken(address _upgradeMaster) public {
        require(_upgradeMaster != address(0));
        upgradeMaster = _upgradeMaster;
    }

    function upgrade(uint256 _value) public {
        UpgradeState state = getUpgradeState();
        require((state == UpgradeState.ReadyToUpgrade) || (state == UpgradeState.Upgrading));
        require(_value > 0);
        require(balances[msg.sender] >= _value);
        uint256 upgradedAmount = totalUpgraded.add(_value);
        uint256 senderBalance = balances[msg.sender];
        uint256 newSenderBalance = senderBalance.sub(_value);      
        uint256 newTotalSupply = totalSupply.sub(_value);
        balances[msg.sender] = newSenderBalance;
        totalSupply = newTotalSupply;        
        NewUpgradedAmount(totalUpgraded, newTotalSupply, msg.sender);
        totalUpgraded = upgradedAmount;
        upgradeAgent.upgradeFrom(msg.sender, _value);
        Upgrade(msg.sender, upgradeAgent, _value);
    }

    function setUpgradeAgent(address _agent) public onlyUpgradeMaster {
        require(_agent != address(0));
        require(canUpgrade());
        require(getUpgradeState() != UpgradeState.Upgrading);
        UpgradeAgent newUAgent = UpgradeAgent(_agent);
        require(newUAgent.isUpgradeAgent());
        require(newUAgent.originalSupply() == totalSupply);
        UpgradeAgentSet(upgradeAgent, msg.sender);
        upgradeAgent = newUAgent;
    }

    function getUpgradeState() public constant returns(UpgradeState) {
        if (!canUpgrade())
            return UpgradeState.NotAllowed;
        else if (upgradeAgent == address(0))
            return UpgradeState.WaitingForAgent;
        else if (totalUpgraded == 0)
            return UpgradeState.ReadyToUpgrade;
        else 
            return UpgradeState.Upgrading;
    }

    function setUpgradeMaster(address _master) public onlyUpgradeMaster {
        require(_master != address(0));
        upgradeMaster = _master;
    }

    function canUpgrade() public constant returns(bool) {
        return isUpgradeable;
    }
}


contract TruReputationToken is TruMintableToken, TruUpgradeableToken {

    using SafeMath for uint256;
    
    using SafeMath for uint;

    uint8 public constant decimals = 18;

    string public constant name = "Tru Reputation Token";

    string public constant symbol = "TRU";

    address public execBoard = 0x0;

    event BoardAddressChanged(address indexed oldAddress, 
        address indexed newAddress, 
        address indexed executor);

    modifier onlyExecBoard() {
        require(msg.sender == execBoard);
        _;
    }

    function TruReputationToken() public TruUpgradeableToken(msg.sender) {
        execBoard = msg.sender;
        BoardAddressChanged(0x0, msg.sender, msg.sender);
    }
    
    function changeBoardAddress(address _newAddress) public onlyExecBoard {
        require(_newAddress != address(0));
        require(_newAddress != execBoard);
        address oldAddress = execBoard;
        execBoard = _newAddress;
        BoardAddressChanged(oldAddress, _newAddress, msg.sender);
    }

    function canUpgrade() public constant returns(bool) {
        return released && super.canUpgrade();
    }

    function setUpgradeMaster(address _master) public onlyOwner {
        super.setUpgradeMaster(_master);
    }
}


contract Haltable is Ownable {

    bool public halted;

    event HaltStatus(bool status);

    modifier stopInEmergency {
        require(!halted);
        _;
    }

    modifier onlyInEmergency {
        require(halted);
        _;
    }

    function halt() external onlyOwner {
        halted = true;
        HaltStatus(halted);
    }

    function unhalt() external onlyOwner onlyInEmergency {
        halted = false;
        HaltStatus(halted);
    }
}


contract TruSale is Ownable, Haltable {
    
    using SafeMath for uint256;
  
    TruReputationToken public truToken;

    uint256 public saleStartTime;
    
    uint256 public saleEndTime;

    uint public purchaserCount = 0;

    address public multiSigWallet;

    uint256 public constant BASE_RATE = 1000;
  
    uint256 public constant PRESALE_RATE = 1250;

    uint256 public constant SALE_RATE = 1125;

    uint256 public constant MIN_AMOUNT = 1 * 10**18;

    uint256 public constant MAX_AMOUNT = 20 * 10**18;

    uint256 public weiRaised;

    uint256 public cap;

    bool public isCompleted = false;

    bool public isPreSale = false;

    bool public isCrowdSale = false;

    uint256 public soldTokens = 0;

    mapping(address => uint256) public purchasedAmount;

    mapping(address => uint256) public tokenAmount;

    mapping (address => bool) public purchaserWhiteList;

    event TokenPurchased(
        address indexed purchaser, 
        address indexed recipient, 
        uint256 weiValue, 
        uint256 tokenAmount);

    event WhiteListUpdated(address indexed purchaserAddress, 
        bool whitelistStatus, 
        address indexed executor);

    event EndChanged(uint256 oldEnd, 
        uint256 newEnd, 
        address indexed executor);

    event Completed(address indexed executor);

    modifier onlyTokenOwner(address _tokenOwner) {
        require(msg.sender == _tokenOwner);
        _;
    }

    function TruSale(uint256 _startTime, 
        uint256 _endTime, 
        address _token, 
        address _saleWallet) public {
        require(_token != address(0));
        TruReputationToken tToken = TruReputationToken(_token);
        address tokenOwner = tToken.owner();
        createSale(_startTime, _endTime, _token, _saleWallet, tokenOwner);
    }

    function buy() public payable stopInEmergency {
        require(checkSaleValid());
        validatePurchase(msg.sender);
    }

    function updateWhitelist(address _purchaser, uint _status) public onlyOwner {
        require(_purchaser != address(0));
        bool boolStatus = false;
        if (_status == 0) {
            boolStatus = false;
        } else if (_status == 1) {
            boolStatus = true;
        } else {
            revert();
        }
        WhiteListUpdated(_purchaser, boolStatus, msg.sender);
        purchaserWhiteList[_purchaser] = boolStatus;
    }

    function changeEndTime(uint256 _endTime) public onlyOwner {
        require(_endTime >= saleStartTime);
        EndChanged(saleEndTime, _endTime, msg.sender);
        saleEndTime = _endTime;
    }

    function hasEnded() public constant returns (bool) {
        bool isCapHit = weiRaised >= cap;
        bool isExpired = now > saleEndTime;
        return isExpired || isCapHit;
    }
    
    function checkSaleValid() internal constant returns (bool) {
        bool afterStart = now >= saleStartTime;
        bool beforeEnd = now <= saleEndTime;
        bool capNotHit = weiRaised.add(msg.value) <= cap;
        return afterStart && beforeEnd && capNotHit;
    }

    function validatePurchase(address _purchaser) internal stopInEmergency {
        require(_purchaser != address(0));
        require(msg.value > 0);
        buyTokens(_purchaser);
    }

    function forwardFunds() internal {
        multiSigWallet.transfer(msg.value);
    }

    function createSale(
        uint256 _startTime, 
        uint256 _endTime, 
        address _token, 
        address _saleWallet, 
        address _tokenOwner) 
        internal onlyTokenOwner(_tokenOwner) 
    {
        require(now <= _startTime);
        require(_endTime >= _startTime);
        require(_saleWallet != address(0));
        truToken = TruReputationToken(_token);
        multiSigWallet = _saleWallet;
        saleStartTime = _startTime;
        saleEndTime = _endTime;
    }

    function buyTokens(address _purchaser) private {
        uint256 weiTotal = msg.value;
        require(weiTotal >= MIN_AMOUNT);
        if (weiTotal > MAX_AMOUNT) {
            require(purchaserWhiteList[msg.sender]); 
        }
        if (purchasedAmount[msg.sender] != 0 && !purchaserWhiteList[msg.sender]) {
            uint256 totalPurchased = purchasedAmount[msg.sender];
            totalPurchased = totalPurchased.add(weiTotal);
            require(totalPurchased < MAX_AMOUNT);
        }
        uint256 tokenRate = BASE_RATE;    
        if (isPreSale) {
            tokenRate = PRESALE_RATE;
        }
        if (isCrowdSale) {
            tokenRate = SALE_RATE;
        }
        uint256 noOfTokens = weiTotal.mul(tokenRate);
        weiRaised = weiRaised.add(weiTotal);
        if (purchasedAmount[msg.sender] == 0) {
            purchaserCount++;
        }
        soldTokens = soldTokens.add(noOfTokens);
        purchasedAmount[msg.sender] = purchasedAmount[msg.sender].add(msg.value);
        tokenAmount[msg.sender] = tokenAmount[msg.sender].add(noOfTokens);
        truToken.mint(_purchaser, noOfTokens);
        TokenPurchased(msg.sender,
        _purchaser,
        weiTotal,
        noOfTokens);
        forwardFunds();
    }
}


contract TruPreSale is TruSale {
    
    using SafeMath for uint256;
    
    uint256 public constant PRESALE_CAP = 4000 * 10**18;
    
    function TruPreSale(
        uint256 _startTime, 
        uint256 _endTime, 
        address _token,
        address _saleWallet) public TruSale(_startTime, _endTime, _token, _saleWallet) 
    {
        isPreSale = true;
        isCrowdSale = false;
        cap = PRESALE_CAP;
    }
    
    function finalise() public onlyOwner {
        require(!isCompleted);
        require(hasEnded());

        completion();
        Completed(msg.sender);

        isCompleted = true;
    }

    function completion() internal {
        uint256 poolTokens = truToken.totalSupply();
        truToken.mint(multiSigWallet, poolTokens);
        truToken.finishMinting(true, false);
        truToken.transferOwnership(msg.sender);
    }
}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"truToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"purchaserCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isCrowdSale","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_purchaser","type":"address"},{"name":"_status","type":"uint256"}],"name":"updateWhitelist","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"saleStartTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_endTime","type":"uint256"}],"name":"changeEndTime","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"PRESALE_RATE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"cap","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"weiRaised","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"BASE_RATE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"purchasedAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"multiSigWallet","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPreSale","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"halt","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"soldTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"SALE_RATE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"finalise","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"buy","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"tokenAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"halted","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PRESALE_CAP","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unhalt","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"MAX_AMOUNT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MIN_AMOUNT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"hasEnded","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"saleEndTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"purchaserWhiteList","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isCompleted","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_startTime","type":"uint256"},{"name":"_endTime","type":"uint256"},{"name":"_token","type":"address"},{"name":"_saleWallet","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"purchaser","type":"address"},{"indexed":true,"name":"recipient","type":"address"},{"indexed":false,"name":"weiValue","type":"uint256"},{"indexed":false,"name":"tokenAmount","type":"uint256"}],"name":"TokenPurchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"purchaserAddress","type":"address"},{"indexed":false,"name":"whitelistStatus","type":"bool"},{"indexed":true,"name":"executor","type":"address"}],"name":"WhiteListUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"oldEnd","type":"uint256"},{"indexed":false,"name":"newEnd","type":"uint256"},{"indexed":true,"name":"executor","type":"address"}],"name":"EndChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"executor","type":"address"}],"name":"Completed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"status","type":"bool"}],"name":"HaltStatus","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

  Contract Creation Code Switch To Opcodes View
6060604052600060048190556008805462ffffff19169055600955341561002557600080fd5b6040516080806111238339810160405280805191906020018051919060200180519190602001805160008054600160a060020a03191633600160a060020a0390811691909117825591935086925085918591859181908416151561008857600080fd5b83915081600160a060020a0316638da5cb5b6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156100ea57600080fd5b6102c65a03f115156100fb57600080fd5b5050506040518051915061012190508686868685640100000000610e7261015582021704565b50506008805462ff00001961ff001990911661010017169055505068d8d726b7177a800000600755506101df945050505050565b8080600160a060020a031633600160a060020a031614151561017657600080fd5b428690111561018457600080fd5b8585101561019157600080fd5b600160a060020a03831615156101a657600080fd5b505060018054600160a060020a03938416600160a060020a03199182161790915560058054929093169116179055600291909155600355565b610f35806101ee6000396000f3006060604052600436106101665763ffffffff60e060020a60003504166303dcf6bc811461016b5780631101eaaf1461019a5780631128798f146101bf5780631a73293d146101e65780631cbaee2d1461020a5780633052b75e1461021d578063340695c014610233578063355274ea146102465780634042b66f1461025957806341910f901461026c57806344c4dcc11461027f5780634b8feb4f1461029e5780634ced4734146102b15780635ed7ca5b146102c45780635ed9ebfc146102d7578063888f2b13146102ea5780638da5cb5b146102fd578063a439926314610310578063a6f2ae3a14610323578063a96b7f051461032b578063b9b8af0b1461034a578063bd94fafc1461035d578063cb3e64fd14610370578063d40dc87014610383578063ddbcb5fa14610396578063ecb70fb7146103a9578063ed338ff1146103bc578063f209fc1f146103cf578063f2fde38b146103ee578063fa391c641461040d575b600080fd5b341561017657600080fd5b61017e610420565b604051600160a060020a03909116815260200160405180910390f35b34156101a557600080fd5b6101ad61042f565b60405190815260200160405180910390f35b34156101ca57600080fd5b6101d2610435565b604051901515815260200160405180910390f35b34156101f157600080fd5b610208600160a060020a0360043516602435610444565b005b341561021557600080fd5b6101ad61050a565b341561022857600080fd5b610208600435610510565b341561023e57600080fd5b6101ad610585565b341561025157600080fd5b6101ad61058b565b341561026457600080fd5b6101ad610591565b341561027757600080fd5b6101ad610597565b341561028a57600080fd5b6101ad600160a060020a036004351661059d565b34156102a957600080fd5b61017e6105af565b34156102bc57600080fd5b6101d26105be565b34156102cf57600080fd5b6102086105cc565b34156102e257600080fd5b6101ad61064a565b34156102f557600080fd5b6101ad610650565b341561030857600080fd5b61017e610656565b341561031b57600080fd5b610208610665565b6102086106f0565b341561033657600080fd5b6101ad600160a060020a0360043516610725565b341561035557600080fd5b6101d2610737565b341561036857600080fd5b6101ad610747565b341561037b57600080fd5b610208610754565b341561038e57600080fd5b6101ad6107e8565b34156103a157600080fd5b6101ad6107f5565b34156103b457600080fd5b6101d2610801565b34156103c757600080fd5b6101ad610824565b34156103da57600080fd5b6101d2600160a060020a036004351661082a565b34156103f957600080fd5b610208600160a060020a036004351661083f565b341561041857600080fd5b6101d26108da565b600154600160a060020a031681565b60045481565b60085462010000900460ff1681565b6000805433600160a060020a0390811691161461046057600080fd5b600160a060020a038316151561047557600080fd5b50600081151561048757506000610494565b8160011415610166575060015b33600160a060020a031683600160a060020a03167f8ca4768867d6dd3086cb1120155b17a60265fdd2a9ff75d10d8813db2106d0d383604051901515815260200160405180910390a3600160a060020a03929092166000908152600c60205260409020805460ff19169215159290921790915550565b60025481565b60005433600160a060020a0390811691161461052b57600080fd5b60025481101561053a57600080fd5b33600160a060020a03167f865dc0d9b16df9da67f71d311a74ee68855aba52167a37d5050795896be4847a6003548360405191825260208201526040908101905180910390a2600355565b6104e281565b60075481565b60065481565b6103e881565b600a6020526000908152604090205481565b600554600160a060020a031681565b600854610100900460ff1681565b60005433600160a060020a039081169116146105e757600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a908117918290557fe861f077f52eac499a1a8ed361f263e79e28e73cebd0814ca9ab39b9932df61e910460ff16604051901515815260200160405180910390a1565b60095481565b61046581565b600054600160a060020a031681565b60005433600160a060020a0390811691161461068057600080fd5b60085460ff161561069057600080fd5b610698610801565b15156106a357600080fd5b6106ab6108e3565b33600160a060020a03167fa1026cbe28583bb9d49fa77a384dd9ae2610003b8b30e30bc20452c1e16a0a4460405160405180910390a26008805460ff19166001179055565b60005460a060020a900460ff161561070757600080fd5b61070f610aa8565b151561071a57600080fd5b61072333610af2565b565b600b6020526000908152604090205481565b60005460a060020a900460ff1681565b68d8d726b7177a80000081565b60005433600160a060020a0390811691161461076f57600080fd5b60005460a060020a900460ff16151561078757600080fd5b6000805474ff00000000000000000000000000000000000000001916908190557fe861f077f52eac499a1a8ed361f263e79e28e73cebd0814ca9ab39b9932df61e9060a060020a900460ff16604051901515815260200160405180910390a1565b6801158e460913d0000081565b670de0b6b3a764000081565b60075460065460035460009290911015904211808061081d5750815b9250505090565b60035481565b600c6020526000908152604090205460ff1681565b60005433600160a060020a0390811691161461085a57600080fd5b600160a060020a038116151561086f57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60085460ff1681565b600154600090600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561092d57600080fd5b6102c65a03f1151561093e57600080fd5b5050506040518051600154600554919350600160a060020a0390811692506340c10f1991168360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156109b057600080fd5b6102c65a03f115156109c157600080fd5b5050506040518051505060018054600160a060020a03169063e6d30bf2906000806040516020015260405160e060020a63ffffffff8516028152911515600483015215156024820152604401602060405180830381600087803b1515610a2657600080fd5b6102c65a03f11515610a3757600080fd5b50505060405180515050600154600160a060020a031663f2fde38b3360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b1515610a9157600080fd5b6102c65a03f11515610aa257600080fd5b50505050565b600254600354600754600654600093429081101593901115918491610ad3903463ffffffff610b3716565b11159050828015610ae15750815b8015610aea5750805b935050505090565b60005460a060020a900460ff1615610b0957600080fd5b600160a060020a0381161515610b1e57600080fd5b60003411610b2b57600080fd5b610b3481610b51565b50565b600082820183811015610b4657fe5b8091505b5092915050565b3460008080670de0b6b3a7640000841015610b6b57600080fd5b6801158e460913d00000841115610ba357600160a060020a0333166000908152600c602052604090205460ff161515610ba357600080fd5b600160a060020a0333166000908152600a602052604090205415801590610be35750600160a060020a0333166000908152600c602052604090205460ff16155b15610c2a57600160a060020a0333166000908152600a60205260409020549250610c13838563ffffffff610b3716565b92506801158e460913d000008310610c2a57600080fd5b6008546103e89250610100900460ff1615610c45576104e291505b60085462010000900460ff1615610c5c5761046591505b610c6c848363ffffffff610e1316565b600654909150610c82908563ffffffff610b3716565b600655600160a060020a0333166000908152600a60205260409020541515610cae576004805460010190555b600954610cc1908263ffffffff610b3716565b600955600160a060020a0333166000908152600a6020526040902054610ced903463ffffffff610b3716565b600160a060020a0333166000908152600a6020908152604080832093909355600b90522054610d22908263ffffffff610b3716565b600160a060020a033381166000908152600b602052604080822093909355600154909116916340c10f19918891859190516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610d9a57600080fd5b6102c65a03f11515610dab57600080fd5b505050604051805190505084600160a060020a031633600160a060020a03167f8daf503382665d950e449b86172be5222275c90f4ddf69c29fdaa8237a562a6d868460405191825260208201526040908101905180910390a3610e0c610e3e565b5050505050565b600080831515610e265760009150610b4a565b50828202828482811515610e3657fe5b0414610b4657fe5b600554600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561072357600080fd5b8080600160a060020a031633600160a060020a0316141515610e9357600080fd5b4286901115610ea157600080fd5b85851015610eae57600080fd5b600160a060020a0383161515610ec357600080fd5b505060018054600160a060020a0393841673ffffffffffffffffffffffffffffffffffffffff1991821617909155600580549290931691161790556002919091556003555600a165627a7a72305820f1ea5d28bb6d79d007c54b5f0b515eaa1b406927f6562beaeb398cce41fe0ad00029000000000000000000000000000000000000000000000000000000005a4dfb20000000000000000000000000000000000000000000000000000000005a9d15200000000000000000000000009d8571a8f168251851748cbc98b0e7168d249c7d00000000000000000000000033358ad0d06fafa08aeebffb3f66acd05f6d08be

    Constructor Arguments (ABI-encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000005a4dfb20000000000000000000000000000000000000000000000000000000005a9d15200000000000000000000000009d8571a8f168251851748cbc98b0e7168d249c7d00000000000000000000000033358ad0d06fafa08aeebffb3f66acd05f6d08be

-----Decoded View---------------
Found 4 constructor arguments :
Arg [0] : 000000000000000000000000000000000000000000000000000000005a4dfb20
Arg [1] : 000000000000000000000000000000000000000000000000000000005a9d1520
Arg [2] : 0000000000000000000000009d8571a8f168251851748cbc98b0e7168d249c7d
Arg [3] : 00000000000000000000000033358ad0d06fafa08aeebffb3f66acd05f6d08be


   Swarm Source:
bzzr://f1ea5d28bb6d79d007c54b5f0b515eaa1b406927f6562beaeb398cce41fe0ad0

 

View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "downvote" button for any spammy posts, and the "upvote" for interesting conversations.