Skip to content
Verified contractPartial

KeplerTokenCrowdsale

Address0x890b34eb2c4c432b3487b95be6896bfd5cc9dc18
Balance

0 ETH

 

Transactions

4

 

Compiler

solc 0.4.21

 

Same code

1 more contract

 

Details

Compiler
solc 0.4.21+commit.dfe3193c
Language
solidity
Optimization
Yes, 200 runs
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
5,770,487
Creation transaction
0x7347317f39…0a5547e766

KeplerTokenCrowdsale.sol

// Recovered by EthereumHistory (ethereumhistory.com) -sw
pragma solidity ^0.4.21;

interface token {
  function transfer(address receiver, uint amount) external;
}

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);

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

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

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

}

contract KeplerTokenCrowdsale is Ownable {

  using SafeMath for uint256;

    uint256 public TokensPerETH;
    token public tokenReward;
    event FundTransfer(address backer, uint256 amount, bool isContribution);

    function KeplerTokenCrowdsale(
        uint256 etherPrice,
        address addressOfTokenUsedAsReward
    ) public {
        TokensPerETH = etherPrice * 150 / 125;
        tokenReward = token(addressOfTokenUsedAsReward);
    }

    function () payable public {
    	require(msg.value != 0);
        uint256 amount = msg.value;
        tokenReward.transfer(msg.sender, amount * TokensPerETH);
        emit FundTransfer(msg.sender, amount, true);
    }

    function changeEtherPrice(uint256 newEtherPrice) onlyOwner public {
        TokensPerETH = newEtherPrice * 150 / 125;
    }

    function withdraw(uint256 value) onlyOwner public {
        uint256 amount = value * 10**16;
        owner.transfer(amount);
        emit FundTransfer(owner, amount, false);
    }

    function withdrawTokens(address otherTokenAddress, uint256 amount) onlyOwner public {
        token otherToken = token(otherTokenAddress);
        otherToken.transfer(owner, amount);
    }

    function destroy() onlyOwner public {
        selfdestruct(owner);
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.