Sponsored Link:   SHPING - $3.4M RAISED IN PRESALE - ON TRACK TO BE LARGEST ICO IN AUSTRALIA - JOIN NOW
Contract Overview
ETH Balance: 0 Ether
ETH USD Value: $0
No Of Transactions: 1 txn
  Latest 1 txn

TxHash Age From To Value [TxFee]
0xb95815ce729e0ce3504eebe8a8d8d60fde245ee5a060c3dd7c72e40165474134124 days 4 hrs ago0xf1c88081deec50ebf4a8e5531487a0389ac367f8  IN   0xa482405a81f9ec60b9cb3cedf6a4b05bee887c5f0.03 Ether0.001685364
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
  Latest 2 Internal Transactions

ParentTxHash Block Age From To Value
0xb95815ce729e0ce3504eebe8a8d8d60fde245ee5a060c3dd7c72e401654741344422481124 days 4 hrs ago0xa482405a81f9ec60b9cb3cedf6a4b05bee887c5f0x34abcc1fdedb49c953445c11a71e428d719ba8d90.03 Ether
0xf6bb5d408d4e4c473469974186f444fa160989936c6885c6b002628cc2f0e6824013775228 days 2 hrs ago0x34abcc1fdedb49c953445c11a71e428d719ba8d9  Contract Creation0 Ether
[ Download CSV Export  ] 
Warning: The compiled contract might be susceptible to ZeroFunctionSelector (very low-severity), DelegateCallReturnValue (low-severity), ECRecoverMalformedInput (medium-severity), SkipEmptyStringLiteral (low-severity) Solidity compiler bugs.

Contract Source Code Verified
Note: Displaying matching verified source code at contract 0xc01c1eb26edbda9ef749ccd0aab78f916e310600
Contract Name: SellENS
Compiler Version: v0.4.11+commit.68ef5810
Optimization Enabled: No
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts
pragma solidity ^0.4.11;

/*

ENS Trade Factory
========================

Listed names and additional information available at ensnames.com
Author: /u/Cintix
*/

// Interfaces for the various ENS contracts
contract AbstractENS {
  function setResolver(bytes32 node, address resolver);
}
contract Resolver {
  function setAddr(bytes32 node, address addr);
}
contract Deed {
  address public previousOwner;
}
contract Registrar {
  function transfer(bytes32 _hash, address newOwner);
  function entries(bytes32 _hash) constant returns (uint, Deed, uint, uint, uint);
}

// The child contract, used to make buying as simple as sending ETH.
contract SellENS {
  SellENSFactory factory;
  
  function SellENS(){
    // Store the address of the factory (0x34abcc1fdedb49c953445c11a71e428d719ba8d9)
    factory = SellENSFactory(msg.sender);
  }
  
  function () payable {
    // Delegate the work back to the factory to save space on the blockchain.
    // This saves on gas when creating sell contracts.
    // Could be replaced with a delegatecall to a library, but that
    // would require a second contract deployment and added complexity.
    factory.transfer(msg.value);
    factory.sell_label(msg.sender, msg.value);
  }
}

// The factory which produces the seller child contracts.
contract SellENSFactory {
  // Store the relevant information for each child contract.
  struct SellENSInfo {
    string label;
    uint price;
    address owner;
  }
  mapping (address => SellENSInfo) public get_info;
  
  // The developer address, used for seller fees.
  address developer = 0x4e6A1c57CdBfd97e8efe831f8f4418b1F2A09e6e;
  // The Ethereum Name Service primary contract.
  AbstractENS ens = AbstractENS(0x314159265dD8dbb310642f98f50C066173C1259b);
  // The Ethereum Name Service Registrar contract.
  Registrar registrar = Registrar(0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef);
  // The Ethereum Name Service Public Resolver contract.
  Resolver resolver = Resolver(0x1da022710dF5002339274AaDEe8D58218e9D6AB5);
  // The hash of ".eth" under which all top level names are registered.
  bytes32 root_node = 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;
  
  // Events used to help track sales.
  event SellENSCreated(SellENS sell_ens);
  event LabelSold(SellENS sell_ens);
  
  // Called by name sellers to make a new seller child contract.
  function createSellENS(string label, uint price) {
    SellENS sell_ens = new SellENS();
    // Store the seller's address so they can get paid when the name sells.
    get_info[sell_ens] = SellENSInfo(label, price, msg.sender);
    SellENSCreated(sell_ens);
  }
  
  // Called only by seller child contracts when a name is purchased.
  function sell_label(address buyer, uint amount_paid){
    SellENS sell_ens = SellENS(msg.sender);
    // Verify the sender is a child contract.
    if (get_info[sell_ens].owner == 0x0) throw;
    
    string label = get_info[sell_ens].label;
    uint price = get_info[sell_ens].price;
    address owner = get_info[sell_ens].owner;
    
    // Calculate the hash of the name being bought.
    bytes32 label_hash = sha3(label);
    // Retrieve the name's deed.
    Deed deed;
    (,deed,,,) = registrar.entries(label_hash);
    // Verify the deed's previous owner matches the seller.
    if (deed.previousOwner() != owner) throw;
    // Calculate the hash of the full name (i.e. rumours.eth).
    bytes32 node = sha3(root_node, label_hash);
    // Set the name's resolver to the public resolver.
    ens.setResolver(node, resolver);
    // Configure the resolver to direct payments sent to the name to the buyer.
    resolver.setAddr(node, buyer);
    // Transfer the name's deed to the buyer.
    registrar.transfer(label_hash, buyer);

    // Dev fee of 5%
    uint fee = price / 20;
    // The seller pays nothing to unlist and get their name back.
    if (buyer == owner) {
      price = 0;
      fee = 0;
    }
    // 5% to the dev
    developer.transfer(fee);
    // 95% to the seller
    owner.transfer(price - fee);
    // Any extra past the sale price is returned to the buyer.
    if (amount_paid > price) {
      buyer.transfer(amount_paid - price);
    }
    LabelSold(sell_ens);
  }
  
  // The factory must be payable to receive funds from its child contracts.
  function () payable {}
}

    Contract ABI  
[{"inputs":[],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"}]

  Contract Creation Code Switch To Opcodes View
6060604052341561000c57fe5b5b33600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b61016e8061005f6000396000f30060606040525b6101405b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051809050600060405180830381858888f19350505050151561006b57fe5b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635cd689e633346040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b151561012c57fe5b6102c65a03f1151561013a57fe5b5050505b565b0000a165627a7a72305820e75891c413fcc9615ecc1bebb7422c13d8f8085947b4f5365543d9b7cac877960029

   Swarm Source:
bzzr://e75891c413fcc9615ecc1bebb7422c13d8f8085947b4f5365543d9b7cac87796

 

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.