Sponsored Link:   Ambrosus Main-Net Launching: Stake AMB in Masternodes and get regular rewards for maintaining network integrity.
Contract Overview
Balance: 0 Ether
Ether Value: $0
Transactions: 6 txns
 Latest 6 txns

TxHash Age From To Value [TxFee]
0x027e208ea16814bc439517bdfcd8e9b38a6ba4c5737ca85b96bf3760cc4bcbcc4 days 17 hrs ago0x7e707c9a3b0fcbf98bf8c4a40c51e66e229d25d4  IN   0x09541e5e03e3f10730fee50131168a99c5ce15c10.0051 Ether0.002247415
0xd8ffd74ce71d8f16d10b2853b09f1ceaaf2f8947cf517719ac7c13b45c8070964 days 17 hrs ago0x7e707c9a3b0fcbf98bf8c4a40c51e66e229d25d4  IN   0x09541e5e03e3f10730fee50131168a99c5ce15c10.005 Ether0.001370375
0x3074e15df9f106a558b671b489595b9febca6cd491b18695a4bdb90505dc4f284 days 17 hrs ago0x7e707c9a3b0fcbf98bf8c4a40c51e66e229d25d4  IN   0x09541e5e03e3f10730fee50131168a99c5ce15c10.005 Ether0.0013963
0x72207a65d94f23c9b7685cd2a790af97299edc214c15266795922bc03119767b8 days 16 hrs ago0x033dd16452cdb450d8c5ceeadae92d057625b1f6  IN   0x09541e5e03e3f10730fee50131168a99c5ce15c10.005 Ether0.001272225
0xa19b2388a62401896487b8777fd2f60dd8c46d6d653f33c4df10351a1caea6759 days 5 hrs ago0x033dd16452cdb450d8c5ceeadae92d057625b1f6  IN   0x09541e5e03e3f10730fee50131168a99c5ce15c10 Ether0.000795262
0xd4172580a3bcadcb9755371182b45c425d90071673dd35bb11b90f8d759aad779 days 5 hrs ago0x033dd16452cdb450d8c5ceeadae92d057625b1f6  IN    Contract Creation0 Ether0.0084483
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 4 Internal Transactions

ParentTxHash Block Age From To Value
0x027e208ea16814bc439517bdfcd8e9b38a6ba4c5737ca85b96bf3760cc4bcbcc59792504 days 17 hrs ago0x09541e5e03e3f10730fee50131168a99c5ce15c10x517f07460dc7d82ac4a49aa270bfc9e3412c17870.0051 Ether
0xd8ffd74ce71d8f16d10b2853b09f1ceaaf2f8947cf517719ac7c13b45c80709659792504 days 17 hrs ago0x09541e5e03e3f10730fee50131168a99c5ce15c10x517f07460dc7d82ac4a49aa270bfc9e3412c17870.005 Ether
0x3074e15df9f106a558b671b489595b9febca6cd491b18695a4bdb90505dc4f2859792504 days 17 hrs ago0x09541e5e03e3f10730fee50131168a99c5ce15c10x517f07460dc7d82ac4a49aa270bfc9e3412c17870.005 Ether
0x72207a65d94f23c9b7685cd2a790af97299edc214c15266795922bc03119767b59557748 days 16 hrs ago0x09541e5e03e3f10730fee50131168a99c5ce15c10x517f07460dc7d82ac4a49aa270bfc9e3412c17870.005 Ether
[ Download CSV Export  ] 
Contract Source Code Verified (Exact match)
Contract Name: Crowdsale
Compiler Version: v0.4.24+commit.e67f0147
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.24;

contract ERC20Basic {
  function totalSupply() public view returns (uint256);
  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 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 Ownable {
  address public owner;


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


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  constructor() public {
    owner = msg.sender;
  }

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }

  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function transferOwnership(address newOwner) public onlyOwner {
    require(newOwner != address(0));
    emit OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }
}

contract Crowdsale is Ownable {
  using SafeMath for uint256;

  ERC20 public token;

  // How many wei units a buyer gets per token
  uint256 public price;

  // Amount of wei raised
  uint256 public weiRaised;

  /**
   * Event for token purchase logging
   * @param beneficiary who got the tokens
   * @param value weis paid for purchase
   * @param amount amount of tokens purchased
   */
  event TokenPurchase(
    address indexed beneficiary,
    uint256 value,
    uint256 amount
  );

  bool public isFinalized = false;

  event Finalized();

  /**
   * @param _token Address of the token being sold
   * @param _price How many wei units a buyer gets per token
   */
  constructor(ERC20 _token, uint256 _price) public {
    require(_token != address(0));
    require(_price > 0);
    token = _token;
    price = _price;
  }

  /**
   * Crowdsale token purchase logic
   */
  function () external payable {
    require(!isFinalized);

    address beneficiary = msg.sender;
    uint256 weiAmount = msg.value;

    require(beneficiary != address(0));
    require(weiAmount != 0);

    uint256 tokens = weiAmount.div(price);
    uint256 selfBalance = balance();
    require(tokens > 0);
    require(tokens <= selfBalance);

    // Get tokens to beneficiary
    token.transfer(beneficiary, tokens);

    emit TokenPurchase(
      beneficiary,
      weiAmount,
      tokens
    );

    // Transfet eth to owner
    owner.transfer(msg.value);

    // update state
    weiRaised = weiRaised.add(weiAmount);
  }


  /**
   * Self tokken ballance
   */
  function balance() public view returns (uint256) {
    address self = address(this);
    uint256 selfBalance = token.balanceOf(self);
    return selfBalance;
  }

  /**
   * Set new price
   * @param _price How many wei units a buyer gets per token
   */
  function setPrice(uint256 _price) onlyOwner public {
    require(_price > 0);
    price = _price;
  }

  /**
   * Must be called after crowdsale ends, to do some extra finalization work.
   */
  function finalize() onlyOwner public {
    require(!isFinalized);

    transferBallance();

    emit Finalized();
    isFinalized = true;
  }

  /**
   * Send all token ballance to owner
   */
  function transferBallance() onlyOwner public {
    uint256 selfBalance = balance();
    token.transfer(msg.sender, selfBalance);
  }
}

library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
    if (a == 0) {
      return 0;
    }
    c = a * b;
    assert(c / a == b);
    return c;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    // uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return a / b;
  }

  /**
  * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
    c = a + b;
    assert(c >= a);
    return c;
  }
}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"weiRaised","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"finalize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isFinalized","outputs":[{"name":"","type":"bool"}],"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":"_price","type":"uint256"}],"name":"setPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"transferBallance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"price","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"balance","outputs":[{"name":"","type":"uint256"}],"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":"token","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_token","type":"address"},{"name":"_price","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"beneficiary","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"TokenPurchase","type":"event"},{"anonymous":false,"inputs":[],"name":"Finalized","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
60806040526004805460ff1916905534801561001a57600080fd5b5060405160408061071183398101604052805160209091015160008054600160a060020a03191633179055600160a060020a038216151561005a57600080fd5b6000811161006757600080fd5b60018054600160a060020a031916600160a060020a0393909316929092179091556002556106778061009a6000396000f3006080604052600436106100a35763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416634042b66f81146102495780634bb278f3146102705780638d4e4083146102875780638da5cb5b146102b057806391b7f5ed146102e15780639aeceb1d146102f9578063a035b1fe1461030e578063b69ef8a814610323578063f2fde38b14610338578063fc0c546a14610359575b60045460009081908190819060ff16156100bc57600080fd5b3393503492508315156100ce57600080fd5b8215156100da57600080fd5b6002546100ee90849063ffffffff61036e16565b91506100f8610383565b90506000821161010757600080fd5b8082111561011457600080fd5b600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038781166004830152602482018690529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561018357600080fd5b505af1158015610197573d6000803e3d6000fd5b505050506040513d60208110156101ad57600080fd5b505060408051848152602081018490528151600160a060020a038716927fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f928290030190a260008054604051600160a060020a03909116913480156108fc02929091818181858888f1935050505015801561022c573d6000803e3d6000fd5b50600354610240908463ffffffff61042216565b60035550505050005b34801561025557600080fd5b5061025e610435565b60408051918252519081900360200190f35b34801561027c57600080fd5b5061028561043b565b005b34801561029357600080fd5b5061029c6104a2565b604080519115158252519081900360200190f35b3480156102bc57600080fd5b506102c56104ab565b60408051600160a060020a039092168252519081900360200190f35b3480156102ed57600080fd5b506102856004356104ba565b34801561030557600080fd5b506102856104e3565b34801561031a57600080fd5b5061025e6105a2565b34801561032f57600080fd5b5061025e610383565b34801561034457600080fd5b50610285600160a060020a03600435166105a8565b34801561036557600080fd5b506102c561063c565b6000818381151561037b57fe5b049392505050565b600154604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820181905291516000938492600160a060020a03909116916370a082319160248082019260209290919082900301818787803b1580156103ef57600080fd5b505af1158015610403573d6000803e3d6000fd5b505050506040513d602081101561041957600080fd5b50519392505050565b8181018281101561042f57fe5b92915050565b60035481565b600054600160a060020a0316331461045257600080fd5b60045460ff161561046257600080fd5b61046a6104e3565b6040517f6823b073d48d6e3a7d385eeb601452d680e74bb46afe3255a7d778f3a9b1768190600090a16004805460ff19166001179055565b60045460ff1681565b600054600160a060020a031681565b600054600160a060020a031633146104d157600080fd5b600081116104de57600080fd5b600255565b60008054600160a060020a031633146104fb57600080fd5b610503610383565b600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018490529051929350600160a060020a039091169163a9059cbb916044808201926020929091908290030181600087803b15801561057357600080fd5b505af1158015610587573d6000803e3d6000fd5b505050506040513d602081101561059d57600080fd5b505050565b60025481565b600054600160a060020a031633146105bf57600080fd5b600160a060020a03811615156105d457600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600154600160a060020a0316815600a165627a7a723058208958ee9f856fd2dfbc5aad65f3a9a147aee31ef1d0daf7893847a4172d3f511100290000000000000000000000002cf2d4919e639b25b806126eb5c97d043ffb0a7000000000000000000000000000000000000000000000000000000000002d8c72

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

-----Decoded View---------------
Found 2 constructor arguments :
Arg [0] : 0000000000000000000000002cf2d4919e639b25b806126eb5c97d043ffb0a70
Arg [1] : 00000000000000000000000000000000000000000000000000000000002d8c72


   Swarm Source:
bzzr://8958ee9f856fd2dfbc5aad65f3a9a147aee31ef1d0daf7893847a4172d3f5111

 

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.