Contract Overview | GoldmintToken
Balance: 0 Ether
Ether Value: $0
Transactions: 4995 txns
Token Tracker: Goldmint MNT Prelaunch Token (MNTP)
 Latest 25 txns From a total of 4995 Transactions

TxHash Age From To Value [TxFee]
0x4d1ad976b393f3fa7dbf45a1bda000f2f5ec680c8206d836465e16a89fd8baf61 hr 33 mins ago0xb68d6cd64ab57068743d9fc70fcf07251046091b  IN   GoldmintToken0 Ether0.0026554
0x72d09edc94b77c6651f0daa0a45daf49f14ea2776476a115183e4380f82dd4c44 hrs 4 mins ago0x97af451326dc049193e031b53b0264cfb6b40dbb  IN   GoldmintToken0 Ether0.00008245152
0xf5674c03a6fa2133aa3c86e5ba48e32789367450bc08ca93abf22ed06a4e1bba6 hrs 13 mins ago0x3c6eb3e9c6c0752bfe3498984906dcfad84504b4  IN   GoldmintToken0 Ether0.0011554
0x30c873fce649e4129d33f768c9b496a74b0e454061fc669be7aa65bfb4f4cb2e6 hrs 45 mins ago0x0b72343fc14bac84166ee9fe69f0cde4a086e20f  IN   GoldmintToken0 Ether0.00026554
0x6bb68ad8fbaad678273ce381fc2473461713aa61d8deee6746d1c7dda33c1bf69 hrs 16 mins ago0x344877fc4c5a45d49546884d5717c8039c4c0b6a  IN   GoldmintToken0 Ether0.000046216
0x4f2d6df25974cda0cf553e12078965e54607bbda54e5b081b0262932b6b953d79 hrs 16 mins ago0x862e5fa327d994db6add791f8396e4950aa63b72  IN   GoldmintToken0 Ether0.000046216
0xed1c0e6410b25609e4dfd632cb57a65d835059d7160a11065e9bbcb91f20abce10 hrs 22 mins ago0x082a427ed7c03b4194c032eef16f3c351de7bf68  IN   GoldmintToken0 Ether0.00027696
0xe1b7c797447e41dfecd648b0fd7aa823a8c8fc343a73a9d57c0ba8519d5f108511 hrs 10 mins ago0x17e3f880ea33e6b9db71f7879ead0324398ab7de  IN   GoldmintToken0 Ether0.000139032
0x51dece96b9d2d00df04265ee371e57178460deeac1cfe779d03d8e8d4aa5154817 hrs 47 mins ago0xf93ec2fdd7930255e1662a5fb647ab7d07d4a8e6  IN   GoldmintToken0 Ether0.000267204
0x4eb303b88b041c083019b3177dce1f55f5727f363d2e241c47f66a29cc5ad3912 days 3 hrs ago0xdb31136a9ef2179bde048b5cc1b94c4181b7aeb6  IN   GoldmintToken0 Ether0.00046096
0x44b8a4c9d670f61baac591fc1e5f40e57e3872a742cf4fa79bc0f228787e54492 days 4 hrs ago0x8398e0c184c48c90a6bb45d58e98d5d964092681  IN   GoldmintToken0 Ether0.000800268
0x6f0221b8b3fb597fab503b6c0d401a386c0e14240c2b8b8fcc30ceede6bfd7f42 days 21 hrs ago0xf93ec2fdd7930255e1662a5fb647ab7d07d4a8e6  IN   GoldmintToken0 Ether0.00023048
0x9eb7109d55461a5280ad680788ab79a7ca7bc04f21af77dbd0edb2421e0c765d2 days 21 hrs ago0xf93ec2fdd7930255e1662a5fb647ab7d07d4a8e6  IN   GoldmintToken0 Ether0.00007597
0xe240085a94d1897e3c9509dd575b05ab512ef33d082de68a234169e76ea7e7fa3 days 3 hrs ago0x3c6eb3e9c6c0752bfe3498984906dcfad84504b4  IN   GoldmintToken0 Ether0.0011522
0x538d844333cada3ceed13360506469f3e5e706669a5d15c41bacb37020f8bff63 days 4 hrs ago0xb2da67d1238010a255a6155626fac47513703c2b  IN   GoldmintToken0 Ether0.00023016
0x44f3393e960cece698213aeac9d83453e5640ddcd35365b7bc96ed6dfb7055423 days 4 hrs ago0xb2da67d1238010a255a6155626fac47513703c2b  IN   GoldmintToken0 Ether0.0002308
0x40f4980dea64e496942c5a488fff1f1a73b914eaf4e7f85a5317c0e02fb0be873 days 7 hrs ago0x88462feb775e3c52cc2defb796aff25bcc2aa705  IN   GoldmintToken0 Ether0.00018464
0x923bafe1bef248d88f631c1ffa62e7f175246c7c7bbf6a5e46f9710844321a2f3 days 7 hrs ago0x0b72343fc14bac84166ee9fe69f0cde4a086e20f  IN   GoldmintToken0 Ether0.000318264
0xd769846ef3cdb4e999e1894c12aa2d8714c875927f374141d03ed55dac48ffe93 days 9 hrs ago0xb2da67d1238010a255a6155626fac47513703c2b  IN   GoldmintToken0 Ether0.000184128
0xd69196b510c123188ad0c5dd7c92cadb4aba06b0ff8b117b32fd5053697690b54 days 1 hr ago0x62bd27a25c6f5e44dd5fdd27e60126b0e1bec686  IN   GoldmintToken0 Ether0.00071448
0xf02ebe15e7e94ff69e3beb79835e897b86afa8ade0be583b6bf5e62d50fb5a4a4 days 7 hrs ago0xb2da67d1238010a255a6155626fac47513703c2b  IN   GoldmintToken0 Ether0.000183872
0x820ceccde9e0a66fed088a6beffb720772f7ad2a32f23d5e8c9b7e5355f34faf4 days 7 hrs ago0xb2da67d1238010a255a6155626fac47513703c2b  IN   GoldmintToken0 Ether0.000183872
0xc599def2497855736049574a36c0f51dbe8f259062068afb01df8792fe0399d44 days 7 hrs ago0xb2da67d1238010a255a6155626fac47513703c2b  IN   GoldmintToken0 Ether0.000183872
0x1082e3fe7412dea6c88d600ff66e8074e71bf47b0e18ce21773eae7e1c3e68c24 days 7 hrs ago0xb2da67d1238010a255a6155626fac47513703c2b  IN   GoldmintToken0 Ether0.000183872
0xfe08d924ba75e34f56b852177c3766f17f20be0298248266fd2772af04f76fd74 days 7 hrs ago0xb2da67d1238010a255a6155626fac47513703c2b  IN   GoldmintToken0 Ether0.000183872
[ 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), NestedArrayFunctionCallDecoder (medium-severity), ZeroFunctionSelector (very low-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: MNTP
Compiler Text: v0.4.16+commit.d7661dd9
Optimization Enabled: No
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.16;

contract SafeMath {
     function safeMul(uint a, uint b) internal returns (uint) {
          uint c = a * b;
          assert(a == 0 || c / a == b);
          return c;
     }

     function safeSub(uint a, uint b) internal returns (uint) {
          assert(b <= a);
          return a - b;
     }

     function safeAdd(uint a, uint b) internal returns (uint) {
          uint c = a + b;
          assert(c>=a && c>=b);
          return c;
     }
}

// ERC20 standard
// We don't use ERC23 standard
contract StdToken is SafeMath {
// Fields:
     mapping(address => uint256) balances;
     mapping (address => mapping (address => uint256)) allowed;
     uint public totalSupply = 0;

// Events:
     event Transfer(address indexed _from, address indexed _to, uint256 _value);
     event Approval(address indexed _owner, address indexed _spender, uint256 _value);

// Functions:
     function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) returns(bool){
          require(balances[msg.sender] >= _value);
          require(balances[_to] + _value > balances[_to]);

          balances[msg.sender] = safeSub(balances[msg.sender],_value);
          balances[_to] = safeAdd(balances[_to],_value);

          Transfer(msg.sender, _to, _value);
          return true;
     }

     function transferFrom(address _from, address _to, uint256 _value) returns(bool){
          require(balances[_from] >= _value);
          require(allowed[_from][msg.sender] >= _value);
          require(balances[_to] + _value > balances[_to]);

          balances[_to] = safeAdd(balances[_to],_value);
          balances[_from] = safeSub(balances[_from],_value);
          allowed[_from][msg.sender] = safeSub(allowed[_from][msg.sender],_value);

          Transfer(_from, _to, _value);
          return true;
     }

     function balanceOf(address _owner) constant returns (uint256) {
          return balances[_owner];
     }

     function approve(address _spender, uint256 _value) returns (bool) {
          // To change the approve amount you first have to reduce the addresses`
          //  allowance to zero by calling `approve(_spender, 0)` if it is not
          //  already 0 to mitigate the race condition described here:
          //  https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
          require((_value == 0) || (allowed[msg.sender][_spender] == 0));

          allowed[msg.sender][_spender] = _value;
          Approval(msg.sender, _spender, _value);
          return true;
     }

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

     modifier onlyPayloadSize(uint _size) {
          require(msg.data.length >= _size + 4);
          _;
     }
}

contract MNTP is StdToken {
// Fields:
     string public constant name = "Goldmint MNT Prelaunch Token";
     string public constant symbol = "MNTP";
     uint public constant decimals = 18;

     address public creator = 0x0;
     address public icoContractAddress = 0x0;
     bool public lockTransfers = false;

     // 10 mln
     uint public constant TOTAL_TOKEN_SUPPLY = 10000000 * 1 ether;

/// Modifiers:
     modifier onlyCreator() { 
          require(msg.sender == creator); 
          _; 
     }

     modifier byIcoContract() { 
          require(msg.sender == icoContractAddress); 
          _; 
     }

     function setCreator(address _creator) onlyCreator {
          creator = _creator;
     }

// Setters/Getters
     function setIcoContractAddress(address _icoContractAddress) onlyCreator {
          icoContractAddress = _icoContractAddress;
     }

// Functions:
     function MNTP() {
          creator = msg.sender;

          assert(TOTAL_TOKEN_SUPPLY == 10000000 * 1 ether);
     }

     /// @dev Override
     function transfer(address _to, uint256 _value) public returns(bool){
          require(!lockTransfers);
          return super.transfer(_to,_value);
     }

     /// @dev Override
     function transferFrom(address _from, address _to, uint256 _value) public returns(bool){
          require(!lockTransfers);
          return super.transferFrom(_from,_to,_value);
     }

     function issueTokens(address _who, uint _tokens) byIcoContract {
          require((totalSupply + _tokens) <= TOTAL_TOKEN_SUPPLY);

          balances[_who] = safeAdd(balances[_who],_tokens);
          totalSupply = safeAdd(totalSupply,_tokens);

          Transfer(0x0, _who, _tokens);
     }

     // For refunds only
     function burnTokens(address _who, uint _tokens) byIcoContract {
          balances[_who] = safeSub(balances[_who], _tokens);
          totalSupply = safeSub(totalSupply, _tokens);
     }

     function lockTransfer(bool _lock) byIcoContract {
          lockTransfers = _lock;
     }

     // Do not allow to send money directly to this contract
     function() {
          revert();
     }
}

// This contract will hold all tokens that were unsold during ICO.
//
// Goldmint Team should be able to withdraw them and sell only after 1 year is passed after 
// ICO is finished.
contract GoldmintUnsold is SafeMath {
     address public creator;
     address public teamAccountAddress;
     address public icoContractAddress;
     uint64 public icoIsFinishedDate;

     MNTP public mntToken;

     function GoldmintUnsold(address _teamAccountAddress,address _mntTokenAddress){
          creator = msg.sender;
          teamAccountAddress = _teamAccountAddress;

          mntToken = MNTP(_mntTokenAddress);          
     }

     modifier onlyCreator() { 
          require(msg.sender==creator); 
          _; 
     }

     modifier onlyIcoContract() { 
          require(msg.sender==icoContractAddress); 
          _; 
     }

// Setters/Getters
     function setIcoContractAddress(address _icoContractAddress) onlyCreator {
          icoContractAddress = _icoContractAddress;
     }

     function finishIco() public onlyIcoContract {
          icoIsFinishedDate = uint64(now);
     }

     // can be called by anyone...
     function withdrawTokens() public {
          // Check if 1 year is passed
          uint64 oneYearPassed = icoIsFinishedDate + 365 days;  
          require(uint(now) >= oneYearPassed);

          // Transfer all tokens from this contract to the teamAccountAddress
          uint total = mntToken.balanceOf(this);
          mntToken.transfer(teamAccountAddress,total);
     }

     // Do not allow to send money directly to this contract
     function() payable {
          revert();
     }
}

contract FoundersVesting is SafeMath {
     address public creator;
     address public teamAccountAddress;
     uint64 public lastWithdrawTime;

     uint public withdrawsCount = 0;
     uint public amountToSend = 0;

     MNTP public mntToken;

     function FoundersVesting(address _teamAccountAddress,address _mntTokenAddress){
          teamAccountAddress = _teamAccountAddress;
          lastWithdrawTime = uint64(now);

          mntToken = MNTP(_mntTokenAddress);          

          creator = msg.sender;
     }

     modifier onlyCreator() { 
          require(msg.sender==creator); 
          _; 
     }

     function withdrawTokens() onlyCreator public {
          // 1 - wait for the next month
          uint64 oneMonth = lastWithdrawTime + 30 days;  
          require(uint(now) >= oneMonth);

          // 2 - calculate amount (only first time)
          if(withdrawsCount==0){
               amountToSend = mntToken.balanceOf(this) / 10;
          }

          require(amountToSend!=0);

          // 3 - send 1/10th
          uint currentBalance = mntToken.balanceOf(this);
          if(currentBalance<amountToSend){
             amountToSend = currentBalance;  
          }
          mntToken.transfer(teamAccountAddress,amountToSend);

          // 4 - update counter
          withdrawsCount++;
          lastWithdrawTime = uint64(now);
     }

     // Do not allow to send money directly to this contract
     function() payable {
          revert();
     }
}

// This is the main Goldmint ICO smart contract
contract Goldmint is SafeMath {
// Constants:
     // These values are HARD CODED!!!
     // For extra security we split single multisig wallet into 10 separate multisig wallets
     //
     // THIS IS A REAL ICO WALLETS!!!
     // PLEASE DOUBLE CHECK THAT...
     address[] public multisigs = [
          0xcEc42E247097C276Ad3D7cFd270aDBd562dA5c61,
          0x373C46c544662B8C5D55c24Cf4F9a5020163eC2f,
          0x672CF829272339A6c8c11b14Acc5F9d07bAFAC7c,
          0xce0e1981A19a57aE808a7575a6738e4527fB9118,
          0x93Aa76cdb17EeA80e4De983108ef575D8fc8f12b,
          0x20ae3329Cd1e35FEfF7115B46218c9D056d430Fd,
          0xe9fC1A57a5dC1CaA3DE22A940E9F09e640615f7E,
          0xD360433950DE9F6FA0e93C29425845EeD6BFA0d0,
          0xF0De97EAff5D6c998c80e07746c81a336e1BBd43,
          0x80b365da1C18f4aa1ecFa0dFA07Ed4417B05Cc69
     ];

     // We count ETH invested by person, for refunds (see below)
     mapping(address => uint) ethInvestedBy;
     uint collectedWei = 0;

     // These can be changed before ICO starts ($7USD/MNTP)
     uint constant STD_PRICE_USD_PER_1000_TOKENS = 7000;

     // The USD/ETH exchange rate may be changed every hour and can vary from $100 to $700 depending on the market. The exchange rate is retrieved from coinmarketcap.com site and is rounded to $1 dollar. For example if current marketcap price is $306.123 per ETH, the price is set as $306 to the contract.
     uint public usdPerEthCoinmarketcapRate = 300;
     uint64 public lastUsdPerEthChangeDate = 0;

     // Price changes from block to block
     uint constant SINGLE_BLOCK_LEN = 700000;
     // 1 000 000 tokens
     uint public constant BONUS_REWARD = 1000000 * 1 ether;
     // 2 000 000 tokens
     uint public constant FOUNDERS_REWARD = 2000000 * 1 ether;
     // 7 000 000 is sold during the ICO
     uint public constant ICO_TOKEN_SUPPLY_LIMIT = 7000000 * 1 ether;
     // 150 000 tokens soft cap (otherwise - refund)
     uint public constant ICO_TOKEN_SOFT_CAP = 150000 * 1 ether;

     // 3 000 000 can be issued from other currencies
     uint public constant MAX_ISSUED_FROM_OTHER_CURRENCIES = 3000000 * 1 ether;
     // 30 000 MNTP tokens per one call only
     uint public constant MAX_SINGLE_ISSUED_FROM_OTHER_CURRENCIES = 30000 * 1 ether;
     uint public issuedFromOtherCurrencies = 0;

// Fields:
     address public creator = 0x0;                // can not be changed after deploy
     address public ethRateChanger = 0x0;         // can not be changed after deploy
     address public tokenManager = 0x0;           // can be changed by token manager only
     address public otherCurrenciesChecker = 0x0; // can not be changed after deploy

     uint64 public icoStartedTime = 0;

     MNTP public mntToken; 

     GoldmintUnsold public unsoldContract;

     // Total amount of tokens sold during ICO
     uint public icoTokensSold = 0;
     // Total amount of tokens sent to GoldmintUnsold contract after ICO is finished
     uint public icoTokensUnsold = 0;
     // Total number of tokens that were issued by a scripts
     uint public issuedExternallyTokens = 0;
     // This is where FOUNDERS_REWARD will be allocated
     address public foundersRewardsAccount = 0x0;

     enum State{
          Init,

          ICORunning,
          ICOPaused,

          // Collected ETH is transferred to multisigs.
          // Unsold tokens transferred to GoldmintUnsold contract.
          ICOFinished,

          // We start to refund if Soft Cap is not reached.
          // Then each token holder should request a refund personally from his
          // personal wallet.
          //
          // We will return ETHs only to the original address. If your address is changed
          // or you have lost your keys -> you will not be able to get a refund.
          // 
          // There is no any possibility to transfer tokens
          // There is no any possibility to move back
          Refunding,

          // In this state we lock all MNT tokens forever.
          // We are going to migrate MNTP -> MNT tokens during this stage. 
          // 
          // There is no any possibility to transfer tokens
          // There is no any possibility to move back
          Migrating
     }
     State public currentState = State.Init;

// Modifiers:
     modifier onlyCreator() { 
          require(msg.sender==creator); 
          _; 
     }
     modifier onlyTokenManager() { 
          require(msg.sender==tokenManager); 
          _; 
     }
     modifier onlyOtherCurrenciesChecker() { 
          require(msg.sender==otherCurrenciesChecker); 
          _; 
     }
     modifier onlyEthSetter() { 
          require(msg.sender==ethRateChanger); 
          _; 
     }

     modifier onlyInState(State state){ 
          require(state==currentState); 
          _; 
     }

// Events:
     event LogStateSwitch(State newState);
     event LogBuy(address indexed owner, uint value);
     event LogBurn(address indexed owner, uint value);
     
// Functions:
     /// @dev Constructor
     function Goldmint(
          address _tokenManager,
          address _ethRateChanger,
          address _otherCurrenciesChecker,

          address _mntTokenAddress,
          address _unsoldContractAddress,
          address _foundersVestingAddress)
     {
          creator = msg.sender;

          tokenManager = _tokenManager;
          ethRateChanger = _ethRateChanger;
          lastUsdPerEthChangeDate = uint64(now);

          otherCurrenciesChecker = _otherCurrenciesChecker; 

          mntToken = MNTP(_mntTokenAddress);
          unsoldContract = GoldmintUnsold(_unsoldContractAddress);

          // slight rename
          foundersRewardsAccount = _foundersVestingAddress;

          assert(multisigs.length==10);
     }

     function startICO() public onlyCreator onlyInState(State.Init) {
          setState(State.ICORunning);
          icoStartedTime = uint64(now);
          mntToken.lockTransfer(true);
          mntToken.issueTokens(foundersRewardsAccount, FOUNDERS_REWARD);
     }

     function pauseICO() public onlyCreator onlyInState(State.ICORunning) {
          setState(State.ICOPaused);
     }

     function resumeICO() public onlyCreator onlyInState(State.ICOPaused) {
          setState(State.ICORunning);
     }

     function startRefunding() public onlyCreator onlyInState(State.ICORunning) {
          // only switch to this state if less than ICO_TOKEN_SOFT_CAP sold
          require(icoTokensSold < ICO_TOKEN_SOFT_CAP);
          setState(State.Refunding);

          // in this state tokens still shouldn't be transferred
          assert(mntToken.lockTransfers());
     }

     function startMigration() public onlyCreator onlyInState(State.ICOFinished) {
          // there is no way back...
          setState(State.Migrating);

          // disable token transfers
          mntToken.lockTransfer(true);
     }

     /// @dev This function can be called by creator at any time,
     /// or by anyone if ICO has really finished.
     function finishICO() public onlyInState(State.ICORunning) {
          require(msg.sender == creator || isIcoFinished());
          setState(State.ICOFinished);

          // 1 - lock all transfers
          mntToken.lockTransfer(false);

          // 2 - move all unsold tokens to unsoldTokens contract
          icoTokensUnsold = safeSub(ICO_TOKEN_SUPPLY_LIMIT,icoTokensSold);
          if(icoTokensUnsold>0){
               mntToken.issueTokens(unsoldContract,icoTokensUnsold);
               unsoldContract.finishIco();
          }

          // 3 - send all ETH to multisigs
          // we have N separate multisigs for extra security
          uint sendThisAmount = (this.balance / 10);

          // 3.1 - send to 9 multisigs
          for(uint i=0; i<9; ++i){
               address ms = multisigs[i];

               if(this.balance>=sendThisAmount){
                    ms.transfer(sendThisAmount);
               }
          }

          // 3.2 - send everything left to 10th multisig
          if(0!=this.balance){
               address lastMs = multisigs[9];
               lastMs.transfer(this.balance);
          }
     }

     function setState(State _s) internal {
          currentState = _s;
          LogStateSwitch(_s);
     }

// Access methods:
     function setTokenManager(address _new) public onlyTokenManager {
          tokenManager = _new;
     }

     // TODO: stealing creator's key means stealing otherCurrenciesChecker key too!
     /*
     function setOtherCurrenciesChecker(address _new) public onlyCreator {
          otherCurrenciesChecker = _new;
     }
     */

     // These are used by frontend so we can not remove them
     function getTokensIcoSold() constant public returns (uint){          
          return icoTokensSold;       
     }      
     
     function getTotalIcoTokens() constant public returns (uint){          
          return ICO_TOKEN_SUPPLY_LIMIT;         
     }       
     
     function getMntTokenBalance(address _of) constant public returns (uint){         
          return mntToken.balanceOf(_of);         
     }        

     function getBlockLength()constant public returns (uint){          
          return SINGLE_BLOCK_LEN;      
     }

     function getCurrentPrice()constant public returns (uint){
          return getMntTokensPerEth(icoTokensSold);
     }

     function getTotalCollectedWei()constant public returns (uint){
          return collectedWei;
     }

/////////////////////////////
     function isIcoFinished() constant public returns(bool) {
          return (icoStartedTime > 0)
            && (now > (icoStartedTime + 30 days) || (icoTokensSold >= ICO_TOKEN_SUPPLY_LIMIT));
     }

     function getMntTokensPerEth(uint _tokensSold) public constant returns (uint){
          // 10 buckets
          uint priceIndex = (_tokensSold / 1 ether) / SINGLE_BLOCK_LEN;
          assert(priceIndex>=0 && (priceIndex<=9));
          
          uint8[10] memory discountPercents = [20,15,10,8,6,4,2,0,0,0];

          // We have to multiply by '1 ether' to avoid float truncations
          // Example: ($7000 * 100) / 120 = $5833.33333
          uint pricePer1000tokensUsd = 
               ((STD_PRICE_USD_PER_1000_TOKENS * 100) * 1 ether) / (100 + discountPercents[priceIndex]);

          // Correct: 300000 / 5833.33333333 = 51.42857142
          // We have to multiply by '1 ether' to avoid float truncations
          uint mntPerEth = (usdPerEthCoinmarketcapRate * 1000 * 1 ether * 1 ether) / pricePer1000tokensUsd;
          return mntPerEth;
     }

     function buyTokens(address _buyer) public payable onlyInState(State.ICORunning) {
          require(msg.value!=0);

          // The price is selected based on current sold tokens.
          // Price can 'overlap'. For example:
          //   1. if currently we sold 699950 tokens (the price is 10% discount)
          //   2. buyer buys 1000 tokens
          //   3. the price of all 1000 tokens would be with 10% discount!!!
          uint newTokens = (msg.value * getMntTokensPerEth(icoTokensSold)) / 1 ether;

          issueTokensInternal(_buyer,newTokens);

          // Update this only when buying from ETH
          ethInvestedBy[msg.sender] = safeAdd(ethInvestedBy[msg.sender], msg.value);

          // This is total collected ETH
          collectedWei = safeAdd(collectedWei, msg.value);
     }

     /// @dev This is called by other currency processors to issue new tokens 
     function issueTokensFromOtherCurrency(address _to, uint _weiCount) onlyInState(State.ICORunning) public onlyOtherCurrenciesChecker {
          require(_weiCount!=0);

          uint newTokens = (_weiCount * getMntTokensPerEth(icoTokensSold)) / 1 ether;
          
          require(newTokens<=MAX_SINGLE_ISSUED_FROM_OTHER_CURRENCIES);
          require((issuedFromOtherCurrencies + newTokens)<=MAX_ISSUED_FROM_OTHER_CURRENCIES);

          issueTokensInternal(_to,newTokens);

          issuedFromOtherCurrencies = issuedFromOtherCurrencies + newTokens;
     }

     /// @dev This can be called to manually issue new tokens 
     /// from the bonus reward
     function issueTokensExternal(address _to, uint _tokens) public onlyTokenManager {
          // in 2 states
          require((State.ICOFinished==currentState) || (State.ICORunning==currentState));
          // can not issue more than BONUS_REWARD
          require((issuedExternallyTokens + _tokens)<=BONUS_REWARD);

          mntToken.issueTokens(_to,_tokens);

          issuedExternallyTokens = issuedExternallyTokens + _tokens;
     }

     function issueTokensInternal(address _to, uint _tokens) internal {
          require((icoTokensSold + _tokens)<=ICO_TOKEN_SUPPLY_LIMIT);

          mntToken.issueTokens(_to,_tokens); 
          icoTokensSold+=_tokens;

          LogBuy(_to,_tokens);
     }

     // anyone can call this and get his money back
     function getMyRefund() public onlyInState(State.Refunding) {
          address sender = msg.sender;
          uint ethValue = ethInvestedBy[sender];

          require(ethValue > 0);

          // 1 - burn tokens
          ethInvestedBy[sender] = 0;
          mntToken.burnTokens(sender, mntToken.balanceOf(sender));

          // 2 - send money back
          sender.transfer(ethValue);
     }

     function setUsdPerEthRate(uint _usdPerEthRate) public onlyEthSetter {
          // 1 - check
          require((_usdPerEthRate>=100) && (_usdPerEthRate<=700));
          uint64 hoursPassed = lastUsdPerEthChangeDate + 1 hours;  
          require(uint(now) >= hoursPassed);

          // 2 - update
          usdPerEthCoinmarketcapRate = _usdPerEthRate;
          lastUsdPerEthChangeDate = uint64(now);
     }

     // Default fallback function
     function() payable {
          // buyTokens -> issueTokensInternal
          buyTokens(msg.sender);
     }
}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"creator","outputs":[{"name":"","type":"address"}],"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":false,"inputs":[{"name":"_who","type":"address"},{"name":"_tokens","type":"uint256"}],"name":"burnTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_icoContractAddress","type":"address"}],"name":"setIcoContractAddress","outputs":[],"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":"_lock","type":"bool"}],"name":"lockTransfer","outputs":[],"payable":false,"stateMutability":"nonpayable","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":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_creator","type":"address"}],"name":"setCreator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_who","type":"address"},{"name":"_tokens","type":"uint256"}],"name":"issueTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lockTransfers","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"icoContractAddress","outputs":[{"name":"","type":"address"}],"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":"TOTAL_TOKEN_SUPPLY","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":false,"stateMutability":"nonpayable","type":"fallback"},{"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"},{"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"}]

  Contract Creation Code Switch To Opcodes View
606060405260006002556000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600460146101000a81548160ff02191690831515021790555034156100b357600080fd5b5b33600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506a084595161401484a0000008014151561010b57fe5b5b5b61152a8061011c6000396000f300606060405236156100fa576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806302d05d3f1461010d57806306fdde0314610162578063095ea7b3146101f15780630d1118ce1461024b578063170381fe1461028d57806318160ddd146102c657806320b44b29146102ef57806323b872dd14610314578063313ce5671461038d5780633f516018146103b6578063475a9fa9146103ef57806370a082311461043157806382b74b891461047e57806395d89b41146104ab5780639fe17cc21461053a578063a9059cbb1461058f578063ccf053ba146105e9578063dd62ed3e14610612575b341561010557600080fd5b5b600080fd5b005b341561011857600080fd5b61012061067e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561016d57600080fd5b6101756106a4565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b65780820151818401525b60208101905061019a565b50505050905090810190601f1680156101e35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101fc57600080fd5b610231600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106dd565b604051808215151515815260200191505060405180910390f35b341561025657600080fd5b61028b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610865565b005b341561029857600080fd5b6102c4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610963565b005b34156102d157600080fd5b6102d9610a05565b6040518082815260200191505060405180910390f35b34156102fa57600080fd5b61031260048080351515906020019091905050610a0b565b005b341561031f57600080fd5b610373600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a86565b604051808215151515815260200191505060405180910390f35b341561039857600080fd5b6103a0610ab9565b6040518082815260200191505060405180910390f35b34156103c157600080fd5b6103ed600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610abe565b005b34156103fa57600080fd5b61042f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b60565b005b341561043c57600080fd5b610468600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ccc565b6040518082815260200191505060405180910390f35b341561048957600080fd5b610491610d15565b604051808215151515815260200191505060405180910390f35b34156104b657600080fd5b6104be610d28565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104ff5780820151818401525b6020810190506104e3565b50505050905090810190601f16801561052c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561054557600080fd5b61054d610d61565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561059a57600080fd5b6105cf600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d87565b604051808215151515815260200191505060405180910390f35b34156105f457600080fd5b6105fc610db8565b6040518082815260200191505060405180910390f35b341561061d57600080fd5b610668600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dc7565b6040518082815260200191505060405180910390f35b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280601c81526020017f476f6c646d696e74204d4e54205072656c61756e636820546f6b656e0000000081525081565b60008082148061076957506000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b151561077457600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108c157600080fd5b6109096000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610e4f565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061095760025482610e4f565b6002819055505b5b5050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109bf57600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b50565b60025481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a6757600080fd5b80600460146101000a81548160ff0219169083151502179055505b5b50565b6000600460149054906101000a900460ff16151515610aa457600080fd5b610aaf848484610e69565b90505b9392505050565b601281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b1a57600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b50565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bbc57600080fd5b6a084595161401484a000000816002540111151515610bda57600080fd5b610c226000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548261125a565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c706002548261125a565b6002819055508173ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b5b5050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b600460149054906101000a900460ff1681565b6040805190810160405280600481526020017f4d4e54500000000000000000000000000000000000000000000000000000000081525081565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460149054906101000a900460ff16151515610da557600080fd5b610daf8383611285565b90505b92915050565b6a084595161401484a00000081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b92915050565b6000828211151515610e5d57fe5b81830390505b92915050565b6000816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610eb857600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610f4357600080fd5b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401111515610fcf57600080fd5b6110176000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361125a565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110a16000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610e4f565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611169600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610e4f565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b60008082840190508381101580156112725750828110155b151561127a57fe5b8091505b5092915050565b600060406004810160003690501015151561129f57600080fd5b826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156112ec57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540111151561137857600080fd5b6113c06000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484610e4f565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061144a6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461125a565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505b5b50929150505600a165627a7a72305820ab77cab76f82a7ab651685bbc17608347288b41a3fd8314fec4b497909da11d00029

   Swarm Source:
bzzr://ab77cab76f82a7ab651685bbc17608347288b41a3fd8314fec4b497909da11d0

 

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.