Contract Overview
Balance: 0.0486666666666667 Ether
Ether Value: $4.34 (@ $89.19/ETH)
Transactions: 10 txns
Misc:
Address Watch: Add To Watch List
Contract Creator: 0x5df8259a6ee3cc03e6229c8c9ede019967edd477at txn 0x6f63872f5e8471fde8b007003aa48766bc6b203d35764c98beaf22739069232c
Token Balance:
 Latest 10 txns

TxHash Age From To Value [TxFee]
0xcf4962eaa48c964304617c1bf2ce1a5e264bf534cbc20b9ba4859325eb0f8700116 days 23 mins ago0xab4dbec3e97c0ef03d596f0375c99a14a76ab4b3  IN   0x97e9c7678b34b09bdb404bafd573cafc4240a5d20.017 Ether0.000287445
0x446e19899d2cadc7be0f3987844c6fc38f3eb0674441a75ccd8b4af7e357be5d128 days 15 mins ago0x5df8259a6ee3cc03e6229c8c9ede019967edd477  IN   0x97e9c7678b34b09bdb404bafd573cafc4240a5d20 Ether0.000089262
0x6e3d534026ee2c2555cf9b1e84b815155837878404d65449dac6dcfecdd4b58a128 days 27 mins ago0x5ab00bf937d4a83b9841ca462689773aba62e5d1  IN   0x97e9c7678b34b09bdb404bafd573cafc4240a5d21 Ether0.000169956
0x7bad938f0b63882a50815e1dbfb7d15c36a03a6d4165728324f8cc38bc7b27a0135 days 1 hr ago0x5ab00bf937d4a83b9841ca462689773aba62e5d1  IN   0x97e9c7678b34b09bdb404bafd573cafc4240a5d20.008 Ether0.000114978
0x8cb8edea772b56905af9503287d12a86ffc5fb8d759e2d62b70cb0360def58aa138 days 19 hrs ago0xa4b6d2c60ba0f8c6c6cb0f048dd8e6142badd7d3  IN   0x97e9c7678b34b09bdb404bafd573cafc4240a5d20.007 Ether0.0000467379
0x7ad5bf7a6875f8602b1047e72300c5f624d5bac7dab279a63abc4592285dd7b4169 days 18 hrs ago0x906b53a538602fe3fb6f66eab42eb8fd734fbc17  IN   0x97e9c7678b34b09bdb404bafd573cafc4240a5d20.005 Ether0.000114978
0x81bf639fa94766e7dac0432d3733aabe21190c21fbefe3a2fbca0d1f236399df176 days 21 hrs ago0xa4b6d2c60ba0f8c6c6cb0f048dd8e6142badd7d3  IN   0x97e9c7678b34b09bdb404bafd573cafc4240a5d20.01 Ether0.000172467
0xb55dfafe5b72a5a5cca72b55572ddd7e742f5af623425257d611f561b8fe8671184 days 13 hrs ago0x5df8259a6ee3cc03e6229c8c9ede019967edd477  IN   0x97e9c7678b34b09bdb404bafd573cafc4240a5d20 Ether0.00007636
0x120578e1cecc6c017d8e9d6df257751236a84f4935ce6454b2b392fe1d5a7b13184 days 13 hrs ago0x5df8259a6ee3cc03e6229c8c9ede019967edd477  IN   0x97e9c7678b34b09bdb404bafd573cafc4240a5d20.01 Ether0.000084978
0x6f63872f5e8471fde8b007003aa48766bc6b203d35764c98beaf22739069232c184 days 14 hrs ago0x5df8259a6ee3cc03e6229c8c9ede019967edd477  IN    Contract Creation0 Ether0.011402865
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 2 Internal Transactions

ParentTxHash Block Age From To Value
0x446e19899d2cadc7be0f3987844c6fc38f3eb0674441a75ccd8b4af7e357be5d6103159128 days 15 mins ago0x97e9c7678b34b09bdb404bafd573cafc4240a5d20x5df8259a6ee3cc03e6229c8c9ede019967edd4771 Ether
0xb55dfafe5b72a5a5cca72b55572ddd7e742f5af623425257d611f561b8fe86715771420184 days 13 hrs ago0x97e9c7678b34b09bdb404bafd573cafc4240a5d20x5df8259a6ee3cc03e6229c8c9ede019967edd4770.0083333333333333 Ether
[ Download CSV Export  ] 
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: VfSE_Token_Exchange
Compiler Text: v0.4.24+commit.e67f0147
Optimization Enabled: No
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.23;

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

  constructor() 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;
  }

}

interface TokenContract {
  function transfer(address _recipient, uint256 _amount) external returns (bool);
  function balanceOf(address _holder) external view returns (uint256);
  function transferFrom(address _from, address _to, uint256 _value) external returns (bool);
}

contract VfSE_Token_Exchange is Ownable {
  using SafeMath for uint256;

  uint256 public buyPrice;
  uint256 public sellPrice;
  address public tokenAddress;
  uint256 private fullEther = 1 ether;


  constructor() public {
    buyPrice = 360;
    sellPrice = 300;
    tokenAddress = 0xeDc2f2077252c2E9B5CB5b5713CC74A071A4d298;
  }

  function setBuyPrice(uint256 _price) onlyOwner public {
    buyPrice = _price;
  }

  function setSellPrice(uint256 _price) onlyOwner public {
    sellPrice = _price;
  }

  function() payable public {
    sellTokens();
  }

  function sellTokens() payable public {
    TokenContract tkn = TokenContract(tokenAddress);
    uint256 tokensToSell = msg.value.mul(sellPrice);
    tokensToSell = tokensToSell.div(100);
    require(tkn.balanceOf(address(this)) >= tokensToSell);
    tkn.transfer(msg.sender, tokensToSell);
    emit SellTransaction(msg.value, tokensToSell);
  }

  function buyTokens(uint256 _amount) public {
    address seller = msg.sender;
    TokenContract tkn = TokenContract(tokenAddress);
    uint256 transactionPrice = _amount.div(buyPrice);
    transactionPrice = transactionPrice.mul(100);
    require (address(this).balance >= transactionPrice);
    require (tkn.transferFrom(msg.sender, address(this), _amount));
    seller.transfer(transactionPrice);
    emit BuyTransaction(transactionPrice, _amount);
  }

  function getBalance(uint256 _amount) onlyOwner public {
    msg.sender.transfer(_amount);
  }

  function getTokens(uint256 _amount) onlyOwner public {
    TokenContract tkn = TokenContract(tokenAddress);
    tkn.transfer(msg.sender, _amount);
  }

  function killMe() onlyOwner public {
    TokenContract tkn = TokenContract(tokenAddress);
    uint256 tokensLeft = tkn.balanceOf(address(this));
    tkn.transfer(msg.sender, tokensLeft);
    msg.sender.transfer(address(this).balance);
    selfdestruct(owner);
  }

  function changeToken(address _address) onlyOwner public {
    tokenAddress = _address;
  }

  event SellTransaction(uint256 ethAmount, uint256 tokenAmount);
  event BuyTransaction(uint256 ethAmount, uint256 tokenAmount);
}

    Contract ABI  
[{"constant":false,"inputs":[{"name":"_amount","type":"uint256"}],"name":"getBalance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_amount","type":"uint256"}],"name":"buyTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"sellPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_price","type":"uint256"}],"name":"setBuyPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_address","type":"address"}],"name":"changeToken","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"buyPrice","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":"sellTokens","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"tokenAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"killMe","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_amount","type":"uint256"}],"name":"getTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_price","type":"uint256"}],"name":"setSellPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"ethAmount","type":"uint256"},{"indexed":false,"name":"tokenAmount","type":"uint256"}],"name":"SellTransaction","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"ethAmount","type":"uint256"},{"indexed":false,"name":"tokenAmount","type":"uint256"}],"name":"BuyTransaction","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
6080604052670de0b6b3a764000060045534801561001c57600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061016860018190555061012c60028190555073edc2f2077252c2e9b5cb5b5713cc74a071a4d298600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611052806100d36000396000f3006080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631e010439146100cf5780633610724e146100fc5780634b7503341461012957806363ae8d6c1461015457806366829b16146101815780638620410b146101c45780638da5cb5b146101ef5780639904e174146102465780639d76ea5814610250578063b603cd80146102a7578063d3c9cc26146102be578063f2fde38b146102eb578063fc6634b91461032e575b6100cd61035b565b005b3480156100db57600080fd5b506100fa600480360381019080803590602001909291905050506105b6565b005b34801561010857600080fd5b506101276004803603810190808035906020019092919050505061065b565b005b34801561013557600080fd5b5061013e610884565b6040518082815260200191505060405180910390f35b34801561016057600080fd5b5061017f6004803603810190808035906020019092919050505061088a565b005b34801561018d57600080fd5b506101c2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108ef565b005b3480156101d057600080fd5b506101d961098e565b6040518082815260200191505060405180910390f35b3480156101fb57600080fd5b50610204610994565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61024e61035b565b005b34801561025c57600080fd5b506102656109b9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102b357600080fd5b506102bc6109df565b005b3480156102ca57600080fd5b506102e960048036038101908080359060200190929190505050610cb1565b005b3480156102f757600080fd5b5061032c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e16565b005b34801561033a57600080fd5b5061035960048036038101908080359060200190929190505050610f6b565b005b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915061039860025434610fd090919063ffffffff16565b90506103ae60648261100b90919063ffffffff16565b9050808273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561044c57600080fd5b505af1158015610460573d6000803e3d6000fd5b505050506040513d602081101561047657600080fd5b81019080805190602001909291905050501015151561049457600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561053757600080fd5b505af115801561054b573d6000803e3d6000fd5b505050506040513d602081101561056157600080fd5b8101908080519060200190929190505050507fbd99bec557de6fde8d37e6d49b3fa4ea5deea0250fd8fb6128a442c678621fe03482604051808381526020018281526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561061157600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610657573d6000803e3d6000fd5b5050565b6000806000339250600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915061069d6001548561100b90919063ffffffff16565b90506106b3606482610fd090919063ffffffff16565b9050803073ffffffffffffffffffffffffffffffffffffffff1631101515156106db57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166323b872dd3330876040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156107b257600080fd5b505af11580156107c6573d6000803e3d6000fd5b505050506040513d60208110156107dc57600080fd5b810190808051906020019092919050505015156107f857600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561083e573d6000803e3d6000fd5b507f069299dc7eeed935cbb3f821a000e0ff607d67634a90d88b5fc7056fcf6998a18185604051808381526020018281526020019250505060405180910390a150505050565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108e557600080fd5b8060018190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561094a57600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a3d57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691508173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610afd57600080fd5b505af1158015610b11573d6000803e3d6000fd5b505050506040513d6020811015610b2757600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610bdd57600080fd5b505af1158015610bf1573d6000803e3d6000fd5b505050506040513d6020811015610c0757600080fd5b8101908080519060200190929190505050503373ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015610c76573d6000803e3d6000fd5b506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d0e57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610dd657600080fd5b505af1158015610dea573d6000803e3d6000fd5b505050506040513d6020811015610e0057600080fd5b8101908080519060200190929190505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610ead57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fc657600080fd5b8060028190555050565b6000806000841415610fe55760009150611004565b8284029050828482811515610ff657fe5b0414151561100057fe5b8091505b5092915050565b600080828481151561101957fe5b04905080915050929150505600a165627a7a7230582020f3101d6b65b6df4d7b2fe5e66ab7ab399b02cc15a9bb26c7407d8e069dd39e0029

   Swarm Source:
bzzr://20f3101d6b65b6df4d7b2fe5e66ab7ab399b02cc15a9bb26c7407d8e069dd39e

 

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.