Contract 0xda9f43015749056182352e9dC6D3eE0B6293D80A 4

 
Txn Hash
Method
Block
From
To
Value
0x450463ef9d9309ac4b3ba665882be1fddbe3e49c3d35a98a72663219fc01efddApprove153676922022-08-18 22:38:561 hr 31 mins ago0xa3f7fe5f82ea5db2e8f163afb99494b3f0c278a6 IN  Etherlambos: EL Token0 Ether0.‍00132558 26.‍38304789
0x554afb42adf5aebb1603c6bd8db2330d34e0d9f0958a9d75177db9b6db0abc23Approve153670292022-08-18 20:13:093 hrs 57 mins ago0x06a3c6c7f1f2636cef629333e174fe7c91ea35c8 IN  Etherlambos: EL Token0 Ether0.‍00042219 13.‍91347241
0xb3bf94435fa5979ce4c2ffd9dc4cf9bfcfc5b209a44576ebc9f7ffce728f1217Approve153660552022-08-18 16:28:307 hrs 41 mins ago0x06a3c6c7f1f2636cef629333e174fe7c91ea35c8 IN  Etherlambos: EL Token0 Ether0.‍00067414 22.‍21688852
0x133a4d6fc6901e9702e76a574bbba9bc38bd69cb418c2e50384b857caee65ef6Approve153660552022-08-18 16:28:307 hrs 41 mins ago0x06a3c6c7f1f2636cef629333e174fe7c91ea35c8 IN  Etherlambos: EL Token0 Ether0.‍00070652 23.‍28388852
0xa42606b716e581ea0127c91ac802aa93c9c7aa64dfa48b9abca09e251a6ff874Approve153660552022-08-18 16:28:307 hrs 41 mins ago0x06a3c6c7f1f2636cef629333e174fe7c91ea35c8 IN  Etherlambos: EL Token0 Ether0.‍00061977 20.‍42506738
0xb052ae25c912573d75fc905396ea1aeb22acedc5fa563733089110af9eabb518Approve153655262022-08-18 14:26:399 hrs 43 mins ago0xeb0b800490872bfab051a14da86c397c57e3ff92 IN  Etherlambos: EL Token0 Ether0.‍00053861 17.‍75030219
0x6f1f511ce988490d49e3de6cc3fcee38cac5aef5659eefe999135361273d2ef1Approve153655182022-08-18 14:24:489 hrs 45 mins ago0xeb0b800490872bfab051a14da86c397c57e3ff92 IN  Etherlambos: EL Token0 Ether0.‍00053978 17.‍78877943
0x8872dd560987900d1ad83e9ec59c1d1ca43daf7b78f6121643cec5866f8f6869Approve153654032022-08-18 14:01:0110 hrs 9 mins ago0xa348311bfb53c1ad8236b41284708da9482e92a1 IN  Etherlambos: EL Token0 Ether0.‍00051722 17.‍04534256
0xf351a11f01c37c05ac4e287f2ccfee246e8186a143b969fa1bdf8c761db44dadApprove153638102022-08-18 7:52:5616 hrs 17 mins ago0x0a6c15942c151392ec1ab410e7ec1b5bc9b5b890 IN  Etherlambos: EL Token0 Ether0.‍00028982 9.‍55131075
0xaec7a89e0067cabd6f1a629f60a0fba52bdef260bd52a7a25c56d1d42b73c1f9Approve153605572022-08-17 19:28:151 day 4 hrs agoENS Name cryptero.eth IN  Etherlambos: EL Token0 Ether0.‍00058994 17.‍79947074
0x0301b28b310b547435f056ca4c09935ac20fbb8b30eaac337215d131b8ca123dApprove153604172022-08-17 18:56:401 day 5 hrs agoENS Name rssi.eth IN  Etherlambos: EL Token0 Ether0.‍00073352 22.‍13158519
0xd92ebe263b19412bffa09a2921b7a8f6151da418d790690c0cf797c8904100efApprove153594842022-08-17 15:21:511 day 8 hrs ago0x192fcb7706e539a77dcf1766d64bb49a468d80d7 IN  Etherlambos: EL Token0 Ether0.‍00037288 12.‍29339398
0x1c19b7288a64b13bc90f719151241058fd68762593b816ea2985b7fd323ae44dApprove153593922022-08-17 15:03:051 day 9 hrs agoENS Name bem.eth IN  Etherlambos: EL Token0 Ether0.‍00042425 13.‍9816082
0x801c3f163ff605419a8930172ffc73bf65022c4917e15b6430b6d5bc85f689f0Approve153591442022-08-17 14:06:011 day 10 hrs ago0xbba01ce736a925db609d0021d2672b48676602c9 IN  Etherlambos: EL Token0 Ether0.‍00059153 17.‍84737489
0x14f98fcb6b2f75efb9e8741bb90b255bb691c153403a5861cd16cf1ed4946e90Approve153546102022-08-16 21:00:082 days 3 hrs ago0xa348311bfb53c1ad8236b41284708da9482e92a1 IN  Etherlambos: EL Token0 Ether0.‍00100338 19.‍97017758
0x9748c8c144bf9dc5bbd596e585b9f42755e611c9bc40a85726ce06d13df2800cApprove153539722022-08-16 18:38:152 days 5 hrs ago0x750aa9c69266f540bfc6c9389b69abfd00bfdd18 IN  Etherlambos: EL Token0 Ether0.‍00063662 12.‍6706087
0x01619b04227adacf56cd96f0102a45f1cc6930c5afd2dd591e417afc71d45be5Approve153539602022-08-16 18:36:142 days 5 hrs ago0x750aa9c69266f540bfc6c9389b69abfd00bfdd18 IN  Etherlambos: EL Token0 Ether0.‍00072151 14.‍3601673
0x7d2cba6c788ba496f038a831572ca50ff26d6c12dacd7298fbeacd0246c9247cApprove153468932022-08-15 15:49:073 days 8 hrs ago0x7b13db2e4a7c8eb58b53429d9507df79ad91ee64 IN  Etherlambos: EL Token0 Ether0.‍00049026 16.‍15688949
0x3af0dc0cd78283b9d5a89f270eed7186250b8484ed95f9d9a8c7f629547df30fApprove153452302022-08-15 9:20:503 days 14 hrs ago0xbb1edb8c64d7baa322fadfd13d4a5db96d02a2e1 IN  Etherlambos: EL Token0 Ether0.‍00044102 13.‍3064031
0x9c46a9ddceee91ee40e05100fbc31585a5ea8c23e8979b4b446ae17284a60058Approve153438792022-08-15 4:12:203 days 19 hrs ago0xd0ff3e387a2ad23841fe60adcb3cf28b46ba7a14 IN  Etherlambos: EL Token0 Ether0.‍0006202 12.‍3438694
0xfdb230a8eaaf83f31b48b6e405c2f817cd8839f5bbd78d59894253e607bb0bb5Approve153436202022-08-15 3:10:253 days 20 hrs agoENS Name defstalkr.eth IN  Etherlambos: EL Token0 Ether0.‍00074647 14.‍86053498
0x23e3f083cff26b1b4c804e04d06628d4a34be0e9868608d265f1560fe7c1a1efApprove153418202022-08-14 20:15:514 days 3 hrs agoENS Name karmawav.eth IN  Etherlambos: EL Token0 Ether0.‍00094102 18.‍72901823
0x9c19973c18f7eb8985fc19640b90d24502b72989c4ce6bbead5947ebd3f2cb33Approve153404922022-08-14 15:09:494 days 9 hrs agoENS Name moondawg.eth IN  Etherlambos: EL Token0 Ether0.‍00082422 16.‍40445787
0xb930589abd49d026eb77a5f43347a087a116317c88026f0388efa5f331533863Approve153402742022-08-14 14:25:374 days 9 hrs ago0xe6ac306031ac3d6c9d3c8a2bbe34fd2a4115f0c8 IN  Etherlambos: EL Token0 Ether0.‍00045193 8.‍99483424
0xec3195f71bfe001b7b3b953d33ebe2646957a0fe96e581170ed9ce87947d1fc3Transfer153402512022-08-14 14:21:094 days 9 hrs ago0x9110311db81551a5871657e0d811127fe957fffa IN  Etherlambos: EL Token0 Ether0.‍00063324 13.‍54369088
[ Download CSV Export 

OVERVIEW

Digital high-end luxury vehicles on the Ethereum blockchain. Etherlambos can be collected, traded, and tuned. Tuning will translate into a modification of appearance, engine capacity, or driving behaviour. All Etherlambos come in a limited edition.

View more zero value Internal Transactions in Advanced View mode
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
EtherLambosCore

Compiler Version
v0.4.18+commit.9cf6e910

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2018-03-11
*/

pragma solidity ^0.4.11;


/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
  address public owner;


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  function Ownable() {
    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) onlyOwner {
    if (newOwner != address(0)) {
      owner = newOwner;
    }
  }

}



/// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens
/// @author Dieter Shirley <[email protected]> (https://github.com/dete)
contract ERC721 {
    // Required methods
    function totalSupply() public view returns (uint256 total);
    function balanceOf(address _owner) public view returns (uint256 balance);
    function ownerOf(uint256 _tokenId) external view returns (address owner);
    function approve(address _to, uint256 _tokenId) external;
    function transfer(address _to, uint256 _tokenId) external;
    function transferFrom(address _from, address _to, uint256 _tokenId) external;
    
    // Optional methods used by ServiceStation contract
    function tuneLambo(uint256 _newattributes, uint256 _tokenId) external;
    function getLamboAttributes(uint256 _id) external view returns (uint256 attributes);
    function getLamboModel(uint256 _tokenId) external view returns (uint64 _model);
    // Events
    event Transfer(address from, address to, uint256 tokenId);
    event Approval(address owner, address approved, uint256 tokenId);

    // Optional
    // function name() public view returns (string name);
    // function symbol() public view returns (string symbol);
    // function tokensOfOwner(address _owner) external view returns (uint256[] tokenIds);
    // function tokenMetadata(uint256 _tokenId, string _preferredTransport) public view returns (string infoUrl);

    // ERC-165 Compatibility (https://github.com/ethereum/EIPs/issues/165)
    function supportsInterface(bytes4 _interfaceID) external view returns (bool);
}



/// @title A facet of EtherLamboCore that manages special access privileges.
/// @author Axiom Zen (https://www.axiomzen.co) adapted by Kenny Bania
/// @dev ...
contract EtherLambosAccessControl {
    // This facet controls access control for Etherlambos. There are four roles managed here:
    //
    //     - The CEO: The CEO can reassign other roles and change the addresses of our dependent smart
    //         contracts. It is also the only role that can unpause the smart contract. It is initially
    //         set to the address that created the smart contract in the EtherLamboCore constructor.
    //
    //     - The CFO: The CFO can withdraw funds from EtherLamboCore and its auction contracts.
    //
    //     - The COO: The COO can release new models for sale.
    //
    // It should be noted that these roles are distinct without overlap in their access abilities, the
    // abilities listed for each role above are exhaustive. In particular, while the CEO can assign any
    // address to any role, the CEO address itself doesn't have the ability to act in those roles. This
    // restriction is intentional so that we aren't tempted to use the CEO address frequently out of
    // convenience. The less we use an address, the less likely it is that we somehow compromise the
    // account.

    /// @dev Emited when contract is upgraded - See README.md for updgrade plan
    event ContractUpgrade(address newContract);

    // The addresses of the accounts (or contracts) that can execute actions within each roles.
    address public ceoAddress;
    address public cfoAddress;
    address public cooAddress;

    // @dev Keeps track whether the contract is paused. When that is true, most actions are blocked
    bool public paused = false;

    /// @dev Access modifier for CEO-only functionality
    modifier onlyCEO() {
        require(msg.sender == ceoAddress);
        _;
    }

    /// @dev Access modifier for CFO-only functionality
    modifier onlyCFO() {
        require(msg.sender == cfoAddress);
        _;
    }

    /// @dev Access modifier for COO-only functionality
    modifier onlyCOO() {
        require(msg.sender == cooAddress);
        _;
    }

    modifier onlyCLevel() {
        require(
            msg.sender == cooAddress ||
            msg.sender == ceoAddress ||
            msg.sender == cfoAddress
        );
        _;
    }

    /// @dev Assigns a new address to act as the CEO. Only available to the current CEO.
    /// @param _newCEO The address of the new CEO
    function setCEO(address _newCEO) external onlyCEO {
        require(_newCEO != address(0));

        ceoAddress = _newCEO;
    }

    /// @dev Assigns a new address to act as the CFO. Only available to the current CEO.
    /// @param _newCFO The address of the new CFO
    function setCFO(address _newCFO) external onlyCEO {
        require(_newCFO != address(0));

        cfoAddress = _newCFO;
    }

    /// @dev Assigns a new address to act as the COO. Only available to the current CEO.
    /// @param _newCOO The address of the new COO
    function setCOO(address _newCOO) external onlyCEO {
        require(_newCOO != address(0));

        cooAddress = _newCOO;
    }

    /*** Pausable functionality adapted from OpenZeppelin ***/

    /// @dev Modifier to allow actions only when the contract IS NOT paused
    modifier whenNotPaused() {
        require(!paused);
        _;
    }

    /// @dev Modifier to allow actions only when the contract IS paused
    modifier whenPaused {
        require(paused);
        _;
    }

    /// @dev Called by any "C-level" role to pause the contract. Used only when
    ///  a bug or exploit is detected and we need to limit damage.
    function pause() external onlyCLevel whenNotPaused {
        paused = true;
    }

    /// @dev Unpauses the smart contract. Can only be called by the CEO, since
    ///  one reason we may pause the contract is when CFO or COO accounts are
    ///  compromised.
    /// @notice This is public rather than external so it can be called by
    ///  derived contracts.
    function unpause() public onlyCEO whenPaused {
        // can't unpause if contract was upgraded
        paused = false;
    }
}



/// @title Base contract for EtherLambos. Holds all common structs, events and base variables.
/// @author Axiom Zen (https://www.axiomzen.co) adapted by Kenny Bania
/// @dev ...
contract EtherLambosBase is EtherLambosAccessControl {
    /*** EVENTS ***/

    /// @dev The Build event is fired whenever a new car model is build by the COO
    event Build(address owner, uint256 lamboId, uint256 attributes);

    /// @dev Transfer event as defined in current draft of ERC721. Emitted every time a car
    ///  ownership is assigned, including builds.
    event Transfer(address from, address to, uint256 tokenId);

    event Tune(uint256 _newattributes, uint256 _tokenId);
    
    /*** DATA TYPES ***/

    /// @dev The main EtherLambos struct. Every car in EtherLambos is represented by a copy
    ///  of this structure, so great care was taken to ensure that it fits neatly into
    ///  exactly two 256-bit words. Note that the order of the members in this structure
    ///  is important because of the byte-packing rules used by Ethereum.
    ///  Ref: http://solidity.readthedocs.io/en/develop/miscellaneous.html
    struct Lambo {
        // sports-car attributes like max speed, weight etc. are stored here.
        // These attributes can be changed due to tuning/upgrades
        uint256 attributes;

        // The timestamp from the block when this car came was constructed.
        uint64 buildTime;
        
        // the Lambo model identifier
        uint64 model;

    }


    // An approximation of currently how many seconds are in between blocks.
    uint256 public secondsPerBlock = 15;

    /*** STORAGE ***/

    /// @dev An array containing the Lambo struct for all Lambos in existence. The ID
    ///  of each car is actually an index into this array. Note that 0 is invalid index.
    Lambo[] lambos;

    /// @dev A mapping from car IDs to the address that owns them. All cars have
    ///  some valid owner address.
    mapping (uint256 => address) public lamboIndexToOwner;

    // @dev A mapping from owner address to count of tokens that address owns.
    //  Used internally inside balanceOf() to resolve ownership count.
    mapping (address => uint256) ownershipTokenCount;

    /// @dev A mapping from LamboIDs to an address that has been approved to call
    ///  transferFrom(). Each Lambo can only have one approved address for transfer
    ///  at any time. A zero value means no approval is outstanding.
    mapping (uint256 => address) public lamboIndexToApproved;

    /// @dev The address of the MarketPlace contract that handles sales of Lambos. This
    ///  same contract handles both peer-to-peer sales as well as new model sales. 
    MarketPlace public marketPlace;
    ServiceStation public serviceStation;
    /// @dev Assigns ownership of a specific Lambo to an address.
    function _transfer(address _from, address _to, uint256 _tokenId) internal {
        // Since the number of lambos is capped to 2^32 we can't overflow this
        ownershipTokenCount[_to]++;
        // transfer ownership
        lamboIndexToOwner[_tokenId] = _to;
        // When creating new lambos _from is 0x0, but we can't account that address.
        if (_from != address(0)) {
            ownershipTokenCount[_from]--;
            // clear any previously approved ownership exchange
            delete lamboIndexToApproved[_tokenId];
        }
        // Emit the transfer event.
        Transfer(_from, _to, _tokenId);
    }

    /// @dev An internal method that creates a new lambo and stores it. This
    ///  method doesn't do any checking and should only be called when the
    ///  input data is known to be valid. Will generate both a Build event
    ///  and a Transfer event.
    /// @param _attributes The lambo's attributes.
    /// @param _owner The inital owner of this car, must be non-zero
    function _createLambo(
        uint256 _attributes,
        address _owner,
        uint64  _model
    )
        internal
        returns (uint)
    {

        
        Lambo memory _lambo = Lambo({
            attributes: _attributes,
            buildTime: uint64(now),
            model:_model
        });
        uint256 newLamboId = lambos.push(_lambo) - 1;

        // It's probably never going to happen, 4 billion cars is A LOT, but
        // let's just be 100% sure we never let this happen.
        require(newLamboId == uint256(uint32(newLamboId)));

        // emit the build event
        Build(
            _owner,
            newLamboId,
            _lambo.attributes
        );

        // This will assign ownership, and also emit the Transfer event as
        // per ERC721 draft
        _transfer(0, _owner, newLamboId);

        return newLamboId;
    }
     /// @dev An internal method that tunes an existing lambo. This
    ///  method doesn't do any checking and should only be called when the
    ///  input data is known to be valid. Will generate a Tune event
    /// @param _newattributes The lambo's new attributes.
    /// @param _tokenId The car to be tuned.
    function _tuneLambo(
        uint256 _newattributes,
        uint256 _tokenId
    )
        internal
    {
        lambos[_tokenId].attributes=_newattributes;
     
        // emit the tune event
        Tune(
            _tokenId,
            _newattributes
        );

    }
    // Any C-level can fix how many seconds per blocks are currently observed.
    function setSecondsPerBlock(uint256 secs) external onlyCLevel {
        //require(secs < cooldowns[0]);
        secondsPerBlock = secs;
    }
}

/// @title The external contract that is responsible for generating metadata for the cars,
///  it has one function that will return the data as bytes.
contract ERC721Metadata {
    /// @dev Given a token Id, returns a byte array that is supposed to be converted into string.
    function getMetadata(uint256 _tokenId, string) public view returns (bytes32[4] buffer, uint256 count) {
        if (_tokenId == 1) {
            buffer[0] = "Hello World! :D";
            count = 15;
        } else if (_tokenId == 2) {
            buffer[0] = "I would definitely choose a medi";
            buffer[1] = "um length string.";
            count = 49;
        } else if (_tokenId == 3) {
            buffer[0] = "Lorem ipsum dolor sit amet, mi e";
            buffer[1] = "st accumsan dapibus augue lorem,";
            buffer[2] = " tristique vestibulum id, libero";
            buffer[3] = " suscipit varius sapien aliquam.";
            count = 128;
        }
    }
}

/// @title The facet of the EtherLambosCore contract that manages ownership, ERC-721 (draft) compliant.
/// @author Axiom Zen (https://www.axiomzen.co) adapted by Cryptoknights
/// @dev Ref: https://github.com/ethereum/EIPs/issues/721

contract EtherLambosOwnership is EtherLambosBase, ERC721 {

    /// @notice Name and symbol of the non fungible token, as defined in ERC721.
    string public constant name = "EtherLambos";
    string public constant symbol = "EL";

    // The contract that will return lambo metadata
    ERC721Metadata public erc721Metadata;

    bytes4 constant InterfaceSignature_ERC165 =
        bytes4(keccak256('supportsInterface(bytes4)'));

    bytes4 constant InterfaceSignature_ERC721 =
        bytes4(keccak256('name()')) ^
        bytes4(keccak256('symbol()')) ^
        bytes4(keccak256('totalSupply()')) ^
        bytes4(keccak256('balanceOf(address)')) ^
        bytes4(keccak256('ownerOf(uint256)')) ^
        bytes4(keccak256('approve(address,uint256)')) ^
        bytes4(keccak256('transfer(address,uint256)')) ^
        bytes4(keccak256('transferFrom(address,address,uint256)')) ^
        bytes4(keccak256('tokensOfOwner(address)')) ^
        bytes4(keccak256('tokenMetadata(uint256,string)'));

    /// @notice Introspection interface as per ERC-165 (https://github.com/ethereum/EIPs/issues/165).
    ///  Returns true for any standardized interfaces implemented by this contract. We implement
    ///  ERC-165 (obviously!) and ERC-721.
    function supportsInterface(bytes4 _interfaceID) external view returns (bool)
    {
        // DEBUG ONLY
        //require((InterfaceSignature_ERC165 == 0x01ffc9a7) && (InterfaceSignature_ERC721 == 0x9a20483d));

        return ((_interfaceID == InterfaceSignature_ERC165) || (_interfaceID == InterfaceSignature_ERC721));
    }

    /// @dev Set the address of the sibling contract that tracks metadata.
    ///  CEO only.
    function setMetadataAddress(address _contractAddress) public onlyCEO {
        erc721Metadata = ERC721Metadata(_contractAddress);
    }

    // Internal utility functions: These functions all assume that their input arguments
    // are valid. We leave it to public methods to sanitize their inputs and follow
    // the required logic.

    /// @dev Checks if a given address is the current owner of a particular Lambo.
    /// @param _claimant the address we are validating against.
    /// @param _tokenId kitten id, only valid when > 0
    function _owns(address _claimant, uint256 _tokenId) internal view returns (bool) {
        return lamboIndexToOwner[_tokenId] == _claimant;
    }

    /// @dev Checks if a given address currently has transferApproval for a particular Lambo.
    /// @param _claimant the address we are confirming Lambo is approved for.
    /// @param _tokenId lambo id, only valid when > 0
    function _approvedFor(address _claimant, uint256 _tokenId) internal view returns (bool) {
        return lamboIndexToApproved[_tokenId] == _claimant;
    }

    /// @dev Marks an address as being approved for transferFrom(), overwriting any previous
    ///  approval. Setting _approved to address(0) clears all transfer approval.
    ///  NOTE: _approve() does NOT send the Approval event. This is intentional because
    ///  _approve() and transferFrom() are used together for putting Lambos on sale, and
    ///  there is no value in spamming the log with Approval events in that case.
    function _approve(uint256 _tokenId, address _approved) internal {
        lamboIndexToApproved[_tokenId] = _approved;
    }

    /// @notice Returns the number of Lambos owned by a specific address.
    /// @param _owner The owner address to check.
    /// @dev Required for ERC-721 compliance
    function balanceOf(address _owner) public view returns (uint256 count) {
        return ownershipTokenCount[_owner];
    }

    /// @notice Transfers a Lambo to another address. If transferring to a smart
    ///  contract be VERY CAREFUL to ensure that it is aware of ERC-721 (or
    ///  EtherLambos specifically) or your Lambo may be lost forever. Seriously.
    /// @param _to The address of the recipient, can be a user or contract.
    /// @param _tokenId The ID of the Lambo to transfer.
    /// @dev Required for ERC-721 compliance.
    function transfer(
        address _to,
        uint256 _tokenId
    )
        external
        whenNotPaused
    {
        // Safety check to prevent against an unexpected 0x0 default.
        require(_to != address(0));
        // Disallow transfers to this contract to prevent accidental misuse.
        // The contract should never own any lambos.
        require(_to != address(this));
        // Disallow transfers to the auction contracts to prevent accidental
        // misuse. Marketplace contracts should only take ownership of Lambos
        // through the allow + transferFrom flow.
        require(_to != address(marketPlace));

        // You can only send your own car.
        require(_owns(msg.sender, _tokenId));

        // Reassign ownership, clear pending approvals, emit Transfer event.
        _transfer(msg.sender, _to, _tokenId);
    }

    /// @notice Grant another address the right to transfer a specific Lambo via
    ///  transferFrom(). This is the preferred flow for transfering NFTs to contracts.
    /// @param _to The address to be granted transfer approval. Pass address(0) to
    ///  clear all approvals.
    /// @param _tokenId The ID of the Lambo that can be transferred if this call succeeds.
    /// @dev Required for ERC-721 compliance.
    function approve(
        address _to,
        uint256 _tokenId
    )
        external
        whenNotPaused
    {
        // Only an owner can grant transfer approval.
        require(_owns(msg.sender, _tokenId));

        // Register the approval (replacing any previous approval).
        _approve(_tokenId, _to);

        // Emit approval event.
        Approval(msg.sender, _to, _tokenId);
    }

    /// @notice Transfer a Lambo owned by another address, for which the calling address
    ///  has previously been granted transfer approval by the owner.
    /// @param _from The address that owns the Lambo to be transfered.
    /// @param _to The address that should take ownership of the Lambo. Can be any address,
    ///  including the caller.
    /// @param _tokenId The ID of the Lambo to be transferred.
    /// @dev Required for ERC-721 compliance.
    function transferFrom(
        address _from,
        address _to,
        uint256 _tokenId
    )
        external
        whenNotPaused
    {
        // Safety check to prevent against an unexpected 0x0 default.
        require(_to != address(0));
        // Disallow transfers to this contract to prevent accidental misuse.
        // The contract should never own any lambos.
        require(_to != address(this));
        // Check for approval and valid ownership
        require(_approvedFor(msg.sender, _tokenId));
        require(_owns(_from, _tokenId));

        // Reassign ownership (also clears pending approvals and emits Transfer event).
        _transfer(_from, _to, _tokenId);
    }

    /// @notice Returns the total number of Lambos currently in existence.
    /// @dev Required for ERC-721 compliance.
    function totalSupply() public view returns (uint) {
        return lambos.length - 1;
    }

    /// @notice Returns the address currently assigned ownership of a given Lambo.
    /// @dev Required for ERC-721 compliance.
    function ownerOf(uint256 _tokenId)
        external
        view
        returns (address owner)
    {
        owner = lamboIndexToOwner[_tokenId];

        require(owner != address(0));
    }

    /// @notice Returns a list of all Lambo IDs assigned to an address.
    /// @param _owner The owner whose Lambo we are interested in.
    /// @dev This method MUST NEVER be called by smart contract code. First, it's fairly
    ///  expensive (it walks the entire Lambo array looking for cars belonging to owner),
    ///  but it also returns a dynamic array, which is only supported for web3 calls, and
    ///  not contract-to-contract calls.
    function tokensOfOwner(address _owner) external view returns(uint256[] ownerTokens) {
        uint256 tokenCount = balanceOf(_owner);

        if (tokenCount == 0) {
            // Return an empty array
            return new uint256[](0);
        } else {
            uint256[] memory result = new uint256[](tokenCount);
            uint256 totalCars = totalSupply();
            uint256 resultIndex = 0;

            // We count on the fact that all cars have IDs starting at 1 and increasing
            // sequentially up to the totalCat count.
            uint256 carId;

            for (carId = 1; carId <= totalCars; carId++) {
                if (lamboIndexToOwner[carId] == _owner) {
                    result[resultIndex] = carId;
                    resultIndex++;
                }
            }

            return result;
        }
    }

    /// @dev Adapted from memcpy() by @arachnid (Nick Johnson <[email protected]>)
    ///  This method is licenced under the Apache License.
    ///  Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol
    function _memcpy(uint _dest, uint _src, uint _len) private view {
        // Copy word-length chunks while possible
        for(; _len >= 32; _len -= 32) {
            assembly {
                mstore(_dest, mload(_src))
            }
            _dest += 32;
            _src += 32;
        }

        // Copy remaining bytes
        uint256 mask = 256 ** (32 - _len) - 1;
        assembly {
            let srcpart := and(mload(_src), not(mask))
            let destpart := and(mload(_dest), mask)
            mstore(_dest, or(destpart, srcpart))
        }
    }

    /// @dev Adapted from toString(slice) by @arachnid (Nick Johnson <[email protected]>)
    ///  This method is licenced under the Apache License.
    ///  Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol
    function _toString(bytes32[4] _rawBytes, uint256 _stringLength) private view returns (string) {
        var outputString = new string(_stringLength);
        uint256 outputPtr;
        uint256 bytesPtr;

        assembly {
            outputPtr := add(outputString, 32)
            bytesPtr := _rawBytes
        }

        _memcpy(outputPtr, bytesPtr, _stringLength);

        return outputString;
    }

    /// @notice Returns a URI pointing to a metadata package for this token conforming to
    ///  ERC-721 (https://github.com/ethereum/EIPs/issues/721)
    /// @param _tokenId The ID number of the Lambos whose metadata should be returned.
    function tokenMetadata(uint256 _tokenId, string _preferredTransport) external view returns (string infoUrl) {
        require(erc721Metadata != address(0));
        bytes32[4] memory buffer;
        uint256 count;
        (buffer, count) = erc721Metadata.getMetadata(_tokenId, _preferredTransport);

        return _toString(buffer, count);
    }
}


/// @title MarketPlace core
/// @dev Contains models, variables, and internal methods for the marketplace.
/// @notice We omit a fallback function to prevent accidental sends to this contract.
contract MarketPlaceBase is Ownable {

    // Represents an sale on an NFT
    struct Sale {
        // Current owner of NFT
        address seller;
        // Price (in wei) 
        uint128 price;
        // Time when sale started
        // NOTE: 0 if this sale has been concluded
        uint64 startedAt;
    }
    
    struct Affiliates {
        address affiliate_address;
        uint64 commission;
        uint64 pricecut;
    }
    
    //Affiliates[] affiliates;
    // Reference to contract tracking NFT ownership
    ERC721 public nonFungibleContract;

    // Cut owner takes on each sale, measured in basis points (1/100 of a percent).
    // Values 0-10,000 map to 0%-100%
    uint256 public ownerCut;

    //map the Affiliate Code to the Affiliate
    mapping (uint256 => Affiliates) codeToAffiliate;

    // Map from token ID to their corresponding sale.
    mapping (uint256 => Sale) tokenIdToSale;

    event SaleCreated(uint256 tokenId, uint256 price);
    event SaleSuccessful(uint256 tokenId, uint256 price, address buyer);
    event SaleCancelled(uint256 tokenId);

    /// @dev Returns true if the claimant owns the token.
    /// @param _claimant - Address claiming to own the token.
    /// @param _tokenId - ID of token whose ownership to verify.
    function _owns(address _claimant, uint256 _tokenId) internal view returns (bool) {
        return (nonFungibleContract.ownerOf(_tokenId) == _claimant);
    }

    /// @dev Escrows the NFT, assigning ownership to this contract.
    /// Throws if the escrow fails.
    /// @param _owner - Current owner address of token to escrow.
    /// @param _tokenId - ID of token whose approval to verify.
    function _escrow(address _owner, uint256 _tokenId) internal {
        // it will throw if transfer fails
        nonFungibleContract.transferFrom(_owner, this, _tokenId);
    }

    /// @dev Transfers an NFT owned by this contract to another address.
    /// Returns true if the transfer succeeds.
    /// @param _receiver - Address to transfer NFT to.
    /// @param _tokenId - ID of token to transfer.
    function _transfer(address _receiver, uint256 _tokenId) internal {
        // it will throw if transfer fails
        nonFungibleContract.transfer(_receiver, _tokenId);
    }

    /// @dev Adds an sale to the list of open sales. Also fires the
    ///  SaleCreated event.
    /// @param _tokenId The ID of the token to be put on sale.
    /// @param _sale Sale to add.
    function _addSale(uint256 _tokenId, Sale _sale) internal {
        

        tokenIdToSale[_tokenId] = _sale;

        SaleCreated(
            uint256(_tokenId),
            uint256(_sale.price)
        );
    }

    /// @dev Cancels a sale unconditionally.
    function _cancelSale(uint256 _tokenId, address _seller) internal {
        _removeSale(_tokenId);
        _transfer(_seller, _tokenId);
        SaleCancelled(_tokenId);
    }

    /// @dev Computes the price and transfers winnings.
    /// Does NOT transfer ownership of token.
    function _bid(uint256 _tokenId, uint256 _bidAmount)
        internal
        returns (uint256)
    {
        // Get a reference to the sale struct
        Sale storage sale = tokenIdToSale[_tokenId];

        // Explicitly check that this sale is currently live.
        // (Because of how Ethereum mappings work, we can't just count
        // on the lookup above failing. An invalid _tokenId will just
        // return a sale object that is all zeros.)
        require(_isOnSale(sale));

        // Check that the bid is greater than or equal to the current price
        uint256 price = sale.price;
        require(_bidAmount >= price);

        // Grab a reference to the seller before the sale struct
        // gets deleted.
        address seller = sale.seller;

        // The bid is good! Remove the sale before sending the fees
        // to the sender so we can't have a reentrancy attack.
        _removeSale(_tokenId);

        // Transfer proceeds to seller (if there are any!)
        if (price > 0) {
            // Calculate the Marketplace's cut.
            // (NOTE: _computeCut() is guaranteed to return a
            // value <= price, so this subtraction can't go negative.)
            uint256 marketplaceCut = _computeCut(price);
            uint256 sellerProceeds = price - marketplaceCut;

            // NOTE: Doing a transfer() in the middle of a complex
            // method like this is generally discouraged because of
            // reentrancy attacks and DoS attacks if the seller is
            // a contract with an invalid fallback function. We explicitly
            // guard against reentrancy attacks by removing the auction
            // before calling transfer(), and the only thing the seller
            // can DoS is the sale of their own asset! (And if it's an
            // accident, they can call cancelAuction(). )
            seller.transfer(sellerProceeds);
        }

        // Calculate any excess funds included with the bid. If the excess
        // is anything worth worrying about, transfer it back to bidder.
        // NOTE: We checked above that the bid amount is greater than or
        // equal to the price so this cannot underflow.
        uint256 bidExcess = _bidAmount - price;

        // Return the funds. Similar to the previous transfer, this is
        // not susceptible to a re-entry attack because the auction is
        // removed before any transfers occur.
        msg.sender.transfer(bidExcess);

        // Tell the world!
        SaleSuccessful(_tokenId, price, msg.sender);

        return price;
    }

    /// @dev Removes a sale from the list of open sales.
    /// @param _tokenId - ID of NFT on sale.
    function _removeSale(uint256 _tokenId) internal {
        delete tokenIdToSale[_tokenId];
    }

    /// @dev Returns true if the NFT is on sale.
    /// @param _sale - Sale to check.
    function _isOnSale(Sale storage _sale) internal view returns (bool) {
        return (_sale.startedAt > 0);
    }


    /// @dev Computes owner's cut of a sale.
    /// @param _price - Sale price of NFT.
    function _computeCut(uint256 _price) internal view returns (uint256) {
        // NOTE: We don't use SafeMath (or similar) in this function because
        //  all of our entry functions carefully cap the maximum values for
        //  currency (at 128-bits), and ownerCut <= 10000 (see the require()
        //  statement in the Marketplace constructor). The result of this
        //  function is always guaranteed to be <= _price.
        return _price * ownerCut / 10000;
    }
    function _computeAffiliateCut(uint256 _price,Affiliates affiliate) internal view returns (uint256) {
        // NOTE: We don't use SafeMath (or similar) in this function because
        //  all of our entry functions carefully cap the maximum values for
        //  currency (at 128-bits), and ownerCut <= 10000 (see the require()
        //  statement in the Marketplace constructor). The result of this
        //  function is always guaranteed to be <= _price.
        return _price * affiliate.commission / 10000;
    }
    /// @dev Adds an affiliate to the list.
    /// @param _code The referall code of the affiliate.
    /// @param _affiliate Affiliate to add.
    function _addAffiliate(uint256 _code, Affiliates _affiliate) internal {
        codeToAffiliate[_code] = _affiliate;
   
    }
    
    /// @dev Removes a affiliate from the list.
    /// @param _code - The referall code of the affiliate.
    function _removeAffiliate(uint256 _code) internal {
        delete codeToAffiliate[_code];
    }
    
    
    //_bidReferral(_tokenId, msg.value);
    /// @dev Computes the price and transfers winnings.
    /// Does NOT transfer ownership of token.
    function _bidReferral(uint256 _tokenId, uint256 _bidAmount,Affiliates _affiliate)
        internal
        returns (uint256)
    {
        
        // Get a reference to the sale struct
        Sale storage sale = tokenIdToSale[_tokenId];

        //Only Owner of Contract can sell referrals
        require(sale.seller==owner);

        // Explicitly check that this sale is currently live.
        // (Because of how Ethereum mappings work, we can't just count
        // on the lookup above failing. An invalid _tokenId will just
        // return a sale object that is all zeros.)
        require(_isOnSale(sale));
        // Check that the bid is greater than or equal to the current price
        
        uint256 price = sale.price;
        
        //deduce the affiliate pricecut
        price=price * _affiliate.pricecut / 10000;  
        require(_bidAmount >= price);

        // Grab a reference to the seller before the sale struct
        // gets deleted.
        address seller = sale.seller;
        address affiliate_address = _affiliate.affiliate_address;
        
        // The bid is good! Remove the sale before sending the fees
        // to the sender so we can't have a reentrancy attack.
        _removeSale(_tokenId);

        // Transfer proceeds to seller (if there are any!)
        if (price > 0) {
            // Calculate the Marketplace's cut.
            // (NOTE: _computeCut() is guaranteed to return a
            // value <= price, so this subtraction can't go negative.)
            uint256 affiliateCut = _computeAffiliateCut(price,_affiliate);
            uint256 sellerProceeds = price - affiliateCut;

            // NOTE: Doing a transfer() in the middle of a complex
            // method like this is generally discouraged because of
            // reentrancy attacks and DoS attacks if the seller is
            // a contract with an invalid fallback function. We explicitly
            // guard against reentrancy attacks by removing the auction
            // before calling transfer(), and the only thing the seller
            // can DoS is the sale of their own asset! (And if it's an
            // accident, they can call cancelAuction(). )
            seller.transfer(sellerProceeds);
            affiliate_address.transfer(affiliateCut);
        }

        // Calculate any excess funds included with the bid. If the excess
        // is anything worth worrying about, transfer it back to bidder.
        // NOTE: We checked above that the bid amount is greater than or
        // equal to the price so this cannot underflow.
        uint256 bidExcess = _bidAmount - price;

        // Return the funds. Similar to the previous transfer, this is
        // not susceptible to a re-entry attack because the auction is
        // removed before any transfers occur.
        msg.sender.transfer(bidExcess);

        // Tell the world!
        SaleSuccessful(_tokenId, price, msg.sender);

        return price;
    }
}

/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 */
contract Pausable is Ownable {
  event Pause();
  event Unpause();

  bool public paused = false;


  /**
   * @dev modifier to allow actions only when the contract IS paused
   */
  modifier whenNotPaused() {
    require(!paused);
    _;
  }

  /**
   * @dev modifier to allow actions only when the contract IS NOT paused
   */
  modifier whenPaused {
    require(paused);
    _;
  }

  /**
   * @dev called by the owner to pause, triggers stopped state
   */
  function pause() onlyOwner whenNotPaused returns (bool) {
    paused = true;
    Pause();
    return true;
  }

  /**
   * @dev called by the owner to unpause, returns to normal state
   */
  function unpause() onlyOwner whenPaused returns (bool) {
    paused = false;
    Unpause();
    return true;
  }
}

/// @title MarketPlace for non-fungible tokens.
/// @notice We omit a fallback function to prevent accidental sends to this contract.
contract MarketPlace is Pausable, MarketPlaceBase {

	// @dev Sanity check that allows us to ensure that we are pointing to the
    //  right auction in our setSaleMarketplaceAddress() call.
    bool public isMarketplace = true;
	
    /// @dev The ERC-165 interface signature for ERC-721.
    ///  Ref: https://github.com/ethereum/EIPs/issues/165
    ///  Ref: https://github.com/ethereum/EIPs/issues/721
    bytes4 constant InterfaceSignature_ERC721 = bytes4(0x9a20483d);

    /// @dev Constructor creates a reference to the NFT ownership contract
    ///  and verifies the owner cut is in the valid range.
    /// @param _nftAddress - address of a deployed contract implementing
    ///  the Nonfungible Interface.
    /// @param _cut - percent cut the owner takes on each sale, must be
    ///  between 0-10,000.
    function MarketPlace(address _nftAddress, uint256 _cut) public {
        require(_cut <= 10000);
        ownerCut = _cut;

        ERC721 candidateContract = ERC721(_nftAddress);
        //require(candidateContract.supportsInterface(InterfaceSignature_ERC721));
        nonFungibleContract = candidateContract;
    }
    function setNFTAddress(address _nftAddress, uint256 _cut) external onlyOwner {
        require(_cut <= 10000);
        ownerCut = _cut;
        ERC721 candidateContract = ERC721(_nftAddress);
        //require(candidateContract.supportsInterface(InterfaceSignature_ERC721));
        nonFungibleContract = candidateContract;
    }
    /// @dev Remove all Ether from the contract, which is the owner's cuts
    ///  as well as any Ether sent directly to the contract address.
    ///  Always transfers to the NFT contract, but can be called either by
    ///  the owner or the NFT contract.
    function withdrawBalance() external {
        address nftAddress = address(nonFungibleContract);

        require(
            msg.sender == owner ||
            msg.sender == nftAddress
        );
        // We are using this boolean method to make sure that even if one fails it will still work
        bool res = nftAddress.send(this.balance);
    }

    /// @dev Creates and begins a new sale.
    /// @param _tokenId - ID of token to sale, sender must be owner.
    /// @param _price - Price of item (in wei)
    /// @param _seller - Seller, if not the message sender
    function createSale(
        uint256 _tokenId,
        uint256 _price,
        address _seller
    )
        external
        whenNotPaused
    {
        // Sanity check that no inputs overflow how many bits we've allocated
        // to store them in the auction struct.
        require(_price == uint256(uint128(_price)));
        
        //require(_owns(msg.sender, _tokenId));
        //_escrow(msg.sender, _tokenId);
        
        require(msg.sender == address(nonFungibleContract));
        _escrow(_seller, _tokenId);
        
        Sale memory sale = Sale(
            _seller,
            uint128(_price),
            uint64(now)
        );
        _addSale(_tokenId, sale);
    }


    

    /// @dev Bids on a sale, completing the sale and transferring
    ///  ownership of the NFT if enough Ether is supplied.
    /// @param _tokenId - ID of token to bid on.
    function bid(uint256 _tokenId)
        external
        payable
        whenNotPaused
    {
        // _bid will throw if the bid or funds transfer fails
       _bid(_tokenId, msg.value); 
       _transfer(msg.sender, _tokenId);
      
    }

    /// @dev Bids on a sale, completing the sale and transferring
    ///  ownership of the NFT if enough Ether is supplied.
    /// @param _tokenId - ID of token to bid on.
    function bidReferral(uint256 _tokenId,uint256 _code)
        external
        payable
        whenNotPaused
    {
        // _bid will throw if the bid or funds transfer fails
        Affiliates storage affiliate = codeToAffiliate[_code];
        
        require(affiliate.affiliate_address!=0&&_code>0);
        _bidReferral(_tokenId, msg.value,affiliate);
        _transfer(msg.sender, _tokenId);

       
    }
    
    /// @dev Cancels an sale that hasn't been won yet.
    ///  Returns the NFT to original owner.
    /// @notice This is a state-modifying function that can
    ///  be called while the contract is paused.
    /// @param _tokenId - ID of token on sale
    function cancelSale(uint256 _tokenId)
        external
    {
        Sale storage sale = tokenIdToSale[_tokenId];
        require(_isOnSale(sale));
        address seller = sale.seller;
        require(msg.sender == seller);
        _cancelSale(_tokenId, seller);
    }

    /// @dev Cancels a sale when the contract is paused.
    ///  Only the owner may do this, and NFTs are returned to
    ///  the seller. This should only be used in emergencies.
    /// @param _tokenId - ID of the NFT on sale to cancel.
    function cancelSaleWhenPaused(uint256 _tokenId)
        whenPaused
        onlyOwner
        external
    {
        Sale storage sale = tokenIdToSale[_tokenId];
        require(_isOnSale(sale));
        _cancelSale(_tokenId, sale.seller);
    }

    /// @dev Returns sale info for an NFT on sale.
    /// @param _tokenId - ID of NFT on sale.
    function getSale(uint256 _tokenId)
        external
        view
        returns
    (
        address seller,
        uint256 price,
        uint256 startedAt
    ) {
        Sale storage sale = tokenIdToSale[_tokenId];
        require(_isOnSale(sale));
        return (
            sale.seller,
            sale.price,
            sale.startedAt
        );
    }

    /// @dev Returns the current price of a sale.
    /// @param _tokenId - ID of the token price we are checking.
    function getCurrentPrice(uint256 _tokenId)
        external
        view
        returns (uint256)
    {
        Sale storage sale = tokenIdToSale[_tokenId];
        require(_isOnSale(sale));
        return sale.price;
    }


    /// @dev Creates and begins a new sale.
    /// @param _code - ID of token to sale, sender must be owner.
    /// @param _commission - percentage of commission for affiliate
    /// @param _pricecut - percentage of sell price cut for buyer
    /// @param _affiliate_address - affiliate address 
    function createAffiliate(
        uint256 _code,
        uint64  _commission,
        uint64  _pricecut,
        address _affiliate_address
    )
        external
        onlyOwner
    {

        Affiliates memory affiliate = Affiliates(
            address(_affiliate_address),
            uint64(_commission),
            uint64(_pricecut)
        );
        _addAffiliate(_code, affiliate);
    }
    
    /// @dev Returns affiliate info for an affiliate code.
    /// @param _code - code for an affiliate.
    function getAffiliate(uint256 _code)
        external
        view
        onlyOwner
        returns
    (
         address affiliate_address,
         uint64 commission,
         uint64 pricecut
    ) {
        Affiliates storage affiliate = codeToAffiliate[_code];
        
        return (
            affiliate.affiliate_address,
            affiliate.commission,
            affiliate.pricecut
        );
    }
     /// @dev Removes affiliate.
    ///  Only the owner may do this
    /// @param _code - code for an affiliate.
    function removeAffiliate(uint256 _code)
        onlyOwner
        external
    {
        _removeAffiliate(_code); 
        
    }
}


/// @title ServiceStationBase core
/// @dev Contains models, variables, and internal methods for the ServiceStation.
contract ServiceStationBase {

    // Reference to contract tracking NFT ownership
    ERC721 public nonFungibleContract;

    struct Tune{
        uint256 startChange;
        uint256 rangeChange;
        uint256 attChange;
        bool plusMinus;
        bool replace;
        uint128 price;
        bool active;
        uint64 model;
    }
    Tune[] options;
    
   
    
    /// @dev Returns true if the claimant owns the token.
    /// @param _claimant - Address claiming to own the token.
    /// @param _tokenId - ID of token whose ownership to verify.
    function _owns(address _claimant, uint256 _tokenId) internal view returns (bool) {
        return (nonFungibleContract.ownerOf(_tokenId) == _claimant);
    }
  
    /// @dev Calls the NFT Contract with the tuned attributes 
    function _tune(uint256 _newattributes, uint256 _tokenId) internal {
    nonFungibleContract.tuneLambo(_newattributes, _tokenId);
    }
    
    function _changeAttributes(uint256 _tokenId,uint256 _optionIndex) internal {
    
    //Get model from token
    uint64 model = nonFungibleContract.getLamboModel(_tokenId);
    //throw if tune option is not made for model
    require(options[_optionIndex].model==model);
    
    //Get original attributes
    uint256 attributes = nonFungibleContract.getLamboAttributes(_tokenId);
    uint256 part=0;
    
    //Dissect for options
    part=(attributes/(10 ** options[_optionIndex].startChange)) % (10 ** options[_optionIndex].rangeChange);
    //part=1544;
    //Change attributes & verify
    //Should attChange be added,subtracted or replaced?
    if(options[_optionIndex].replace == false)
        {
            
            //change should be added
            if(options[_optionIndex].plusMinus == false)
            {
                //e.g. if range = 4 then value can not be higher then 9999 - overflow check
                require((part+options[_optionIndex].attChange)<(10**options[_optionIndex].rangeChange));
                //add to attributes
                attributes=attributes+options[_optionIndex].attChange*(10 ** options[_optionIndex].startChange);
            }
            else{
                //do some subtraction
                //e.g. value must be greater then 0
                require(part>options[_optionIndex].attChange);
                //substract from attributes 
                attributes-=options[_optionIndex].attChange*(10 ** options[_optionIndex].startChange);
            }
        }
    else
        {
            //do some replacing
            attributes=attributes-part*(10 ** options[_optionIndex].startChange);
            attributes+=options[_optionIndex].attChange*(10 ** options[_optionIndex].startChange);
        }
    
  
   
    //Tune Lambo in NFT contract
    _tune(uint256(attributes), _tokenId);
       
        
    }
    
    
}


/// @title ServiceStation for non-fungible tokens.
contract ServiceStation is Pausable, ServiceStationBase {

	// @dev Sanity check that allows us to ensure that we are pointing to the right call.
    bool public isServicestation = true;
	
    /// @dev The ERC-165 interface signature for ERC-721.
    ///  Ref: https://github.com/ethereum/EIPs/issues/165
    ///  Ref: https://github.com/ethereum/EIPs/issues/721
    bytes4 constant InterfaceSignature_ERC721 = bytes4(0x9a20483d);

    uint256 public optionCount;
    mapping (uint64 => uint256) public modelIndexToOptionCount;
    /// @dev Constructor creates a reference to the NFT ownership contract
    ///  and verifies the owner cut is in the valid range.
    /// @param _nftAddress - address of a deployed contract implementing
    ///  the Nonfungible Interface.
    function ServiceStation(address _nftAddress) public {

        ERC721 candidateContract = ERC721(_nftAddress);
        //require(candidateContract.supportsInterface(InterfaceSignature_ERC721));
        nonFungibleContract = candidateContract;
        _newTuneOption(0,0,0,false,false,0,0);
        
    }
    function setNFTAddress(address _nftAddress) external onlyOwner {
        
        ERC721 candidateContract = ERC721(_nftAddress);
        //require(candidateContract.supportsInterface(InterfaceSignature_ERC721));
        nonFungibleContract = candidateContract;
    }
    
    function newTuneOption(
        uint32 _startChange,
        uint32 _rangeChange,
        uint256 _attChange,
        bool _plusMinus,
        bool _replace,
        uint128 _price,
        uint64 _model
        )
        external
        {
           //Only allow owner to add new options
           require(msg.sender == owner ); 
           optionCount++;
           modelIndexToOptionCount[_model]++;
           _newTuneOption(_startChange,_rangeChange,_attChange,_plusMinus, _replace,_price,_model);
       
        }
    function changeTuneOption(
        uint32 _startChange,
        uint32 _rangeChange,
        uint256 _attChange,
        bool _plusMinus,
        bool _replace,
        uint128 _price,
        bool _isactive,
        uint64 _model,
        uint256 _optionIndex
        )
        external
        {
           //Only allow owner to add new options
           require(msg.sender == owner ); 
           
           
           _changeTuneOption(_startChange,_rangeChange,_attChange,_plusMinus, _replace,_price,_isactive,_model,_optionIndex);
       
        }
        
    function _newTuneOption( uint32 _startChange,
        uint32 _rangeChange,
        uint256 _attChange,
        bool _plusMinus,
        bool _replace,
        uint128 _price,
        uint64 _model
        ) 
        internal
        {
        
           Tune memory _option = Tune({
            startChange: _startChange,
            rangeChange: _rangeChange,
            attChange: _attChange,
            plusMinus: _plusMinus,
            replace: _replace,
            price: _price,
            active: true,
            model: _model
            });
        
        options.push(_option);
    }
    
    function _changeTuneOption( uint32 _startChange,
        uint32 _rangeChange,
        uint256 _attChange,
        bool _plusMinus,
        bool _replace,
        uint128 _price,
        bool _isactive,
        uint64 _model,
        uint256 _optionIndex
        ) 
        internal
        {
        
           Tune memory _option = Tune({
            startChange: _startChange,
            rangeChange: _rangeChange,
            attChange: _attChange,
            plusMinus: _plusMinus,
            replace: _replace,
            price: _price,
            active: _isactive,
            model: _model
            });
        
        options[_optionIndex]=_option;
    }
    
    function disableTuneOption(uint256 index) external
    {
        require(msg.sender == owner ); 
        options[index].active=false;
    }
    
    function enableTuneOption(uint256 index) external
    {
        require(msg.sender == owner ); 
        options[index].active=true;
    }
    function getOption(uint256 _index) 
    external view
    returns (
        uint256 _startChange,
        uint256 _rangeChange,
        uint256 _attChange,
        bool _plusMinus,
        uint128 _price,
        bool active,
        uint64 model
    ) 
    {
      
        //require(options[_index].active);
        return (
            options[_index].startChange,
            options[_index].rangeChange,
            options[_index].attChange,
            options[_index].plusMinus,
            options[_index].price,
            options[_index].active,
            options[_index].model
        );  
    }
    
    function getOptionCount() external view returns (uint256 _optionCount)
        {
        return optionCount;    
        }
    
    function tuneLambo(uint256 _tokenId,uint256 _optionIndex) external payable
    {
       //Caller needs to own Lambo
       require(_owns(msg.sender, _tokenId)); 
       //Tuning Option needs to be enabled
       require(options[_optionIndex].active);
       //Enough money for tuning to spend?
       require(msg.value>=options[_optionIndex].price);
       
       _changeAttributes(_tokenId,_optionIndex);
    }
    /// @dev Remove all Ether from the contract, which is the owner's cuts
    ///  as well as any Ether sent directly to the contract address.
    ///  Always transfers to the NFT contract, but can be called either by
    ///  the owner or the NFT contract.
    function withdrawBalance() external {
        address nftAddress = address(nonFungibleContract);

        require(
            msg.sender == owner ||
            msg.sender == nftAddress
        );
        // We are using this boolean method to make sure that even if one fails it will still work
        bool res = owner.send(this.balance);
    }

    function getOptionsForModel(uint64 _model) external view returns(uint256[] _optionsModel) {
        //uint256 tokenCount = balanceOf(_owner);

        //if (tokenCount == 0) {
            // Return an empty array
        //    return new uint256[](0);
        //} else {
            uint256[] memory result = new uint256[](modelIndexToOptionCount[_model]);
            //uint256 totalCars = totalSupply();
            uint256 resultIndex = 0;

            // We count on the fact that all cars have IDs starting at 0 and increasing
            // sequentially up to the optionCount count.
            uint256 optionId;

            for (optionId = 1; optionId <= optionCount; optionId++) {
                if (options[optionId].model == _model && options[optionId].active == true) {
                    result[resultIndex] = optionId;
                    resultIndex++;
                }
            }

            return result;
       // }
    }

}



////No SiringClockAuction needed for Lambos
////No separate modification for SaleContract needed

/// @title Handles creating sales for sale of lambos.
///  This wrapper of ReverseSale exists only so that users can create
///  sales with only one transaction.
contract EtherLambosSale is EtherLambosOwnership {

    // @notice The sale contract variables are defined in EtherLambosBase to allow
    //  us to refer to them in EtherLambosOwnership to prevent accidental transfers.
    // `saleMarketplace` refers to the auction for p2p sale of cars.
   

    /// @dev Sets the reference to the sale auction.
    /// @param _address - Address of sale contract.
    function setMarketplaceAddress(address _address) external onlyCEO {
        MarketPlace candidateContract = MarketPlace(_address);

        // NOTE: verify that a contract is what we expect - https://github.com/Lunyr/crowdsale-contracts/blob/cfadd15986c30521d8ba7d5b6f57b4fefcc7ac38/contracts/LunyrToken.sol#L117
        require(candidateContract.isMarketplace());

        // Set the new contract address
        marketPlace = candidateContract;
    }


    /// @dev Put a lambo up for sale.
    ///  Does some ownership trickery to create auctions in one tx.
    function createLamboSale(
        uint256 _carId,
        uint256 _price
    )
        external
        whenNotPaused
    {
        // Sale contract checks input sizes
        // If lambo is already on any sale, this will throw
        // because it will be owned by the sale contract.
        require(_owns(msg.sender, _carId));
        
        _approve(_carId, marketPlace);
        // Sale throws if inputs are invalid and clears
        // transfer after escrowing the lambo.
        marketPlace.createSale(
            _carId,
            _price,
            msg.sender
        );
    }
    
    
    function bulkCreateLamboSale(
        uint256 _price,
        uint256 _tokenIdStart,
        uint256 _tokenCount
    )
        external
        onlyCOO
    {
        // Sale contract checks input sizes
        // If lambo is already on any sale, this will throw
        // because it will be owned by the sale contract.
        for(uint256 i=0;i<_tokenCount;i++)
            {
            require(_owns(msg.sender, _tokenIdStart+i));
        
            _approve(_tokenIdStart+i, marketPlace);
            // Sale throws if inputs are invalid and clears
            // transfer after escrowing the lambo.
            marketPlace.createSale(
                _tokenIdStart+i,
                _price,
             msg.sender
            );
        }
    }
    /// @dev Transfers the balance of the marketPlace contract
    /// to the EtherLambosCore contract. We use two-step withdrawal to
    /// prevent two transfer calls in the auction bid function.
    function withdrawSaleBalances() external onlyCLevel {
        marketPlace.withdrawBalance();
        
    }
}

/// @title all functions related to creating lambos
contract EtherLambosBuilding is EtherLambosSale {

    // Limits the number of cars the contract owner can ever create.
    //uint256 public constant PROMO_CREATION_LIMIT = 5000;
    //uint256 public constant GEN0_CREATION_LIMIT = 45000;


    // Counts the number of cars the contract owner has created.
    uint256 public lambosBuildCount;


    /// @dev we can build lambos. Only callable by COO
    /// @param _attributes the encoded attributes of the lambo to be created, any value is accepted
    /// @param _owner the future owner of the created lambo. Default to contract COO
    /// @param _model the model of the created lambo. 
    function createLambo(uint256 _attributes, address _owner, uint64 _model) external onlyCOO {
        address lamboOwner = _owner;
        if (lamboOwner == address(0)) {
             lamboOwner = cooAddress;
        }
        //require(promoCreatedCount < PROMO_CREATION_LIMIT);

        lambosBuildCount++;
        _createLambo(_attributes, lamboOwner, _model);
    }

    function bulkCreateLambo(uint256 _attributes, address _owner, uint64 _model,uint256 count, uint256 startNo) external onlyCOO {
        address lamboOwner = _owner;
        uint256 att=_attributes;
        if (lamboOwner == address(0)) {
             lamboOwner = cooAddress;
        }
        
        //do some replacing
            //_attributes=_attributes-part*(10 ** 66);
        
        
        //require(promoCreatedCount < PROMO_CREATION_LIMIT);
        for(uint256 i=0;i<count;i++)
            {
            lambosBuildCount++;
            att=_attributes+(startNo+i)*(10 ** 66);
            _createLambo(att, lamboOwner, _model);
            }
    }
}

/// @title all functions related to tuning lambos
contract EtherLambosTuning is EtherLambosBuilding {

    // Counts the number of tunings have been done.
    uint256 public lambosTuneCount;

    function setServicestationAddress(address _address) external onlyCEO {
        ServiceStation candidateContract = ServiceStation(_address);

        // NOTE: verify that a contract is what we expect - https://github.com/Lunyr/crowdsale-contracts/blob/cfadd15986c30521d8ba7d5b6f57b4fefcc7ac38/contracts/LunyrToken.sol#L117
        require(candidateContract.isServicestation());

        // Set the new contract address
        serviceStation = candidateContract;
    }
    /// @dev we can tune lambos. Only callable by ServiceStation contract
    /// @param _newattributes the new encoded attributes of the lambo to be updated
    /// @param _tokenId the lambo to be tuned.
    function tuneLambo(uint256 _newattributes, uint256 _tokenId) external {
        
        //Tuning can only be done by the ServiceStation Contract. 
        require(
            msg.sender == address(serviceStation)
        );
        
        
        lambosTuneCount++;
        _tuneLambo(_newattributes, _tokenId);
    }
    function withdrawTuneBalances() external onlyCLevel {
        serviceStation.withdrawBalance();
        
    }

}

/// @title EtherLambos: Collectible, tuneable, and super stylish lambos on the Ethereum blockchain.
/// @author Cryptoknights code adapted from Axiom Zen (https://www.axiomzen.co)
/// @dev The main EtherLambos contract, keeps track of lambos.
contract EtherLambosCore is EtherLambosTuning {

    // This is the main EtherLambos contract. In order to keep our code seperated into logical sections,
    // we've broken it up in two ways. First, we have several seperately-instantiated sibling contracts
    // that handle sales. The sales are
    // seperate since their logic is somewhat complex and there's always a risk of subtle bugs. By keeping
    // them in their own contracts, we can upgrade them without disrupting the main contract that tracks
    // lambo ownership. 
    //
    // Secondly, we break the core contract into multiple files using inheritence, one for each major
    // facet of functionality of EtherLambos. This allows us to keep related code bundled together while still
    // avoiding a single giant file with everything in it. The breakdown is as follows:
    //
    //      - EtherLambosBase: This is where we define the most fundamental code shared throughout the core
    //             functionality. This includes our main data storage, constants and data types, plus
    //             internal functions for managing these items.
    //
    //      - EtherLambosAccessControl: This contract manages the various addresses and constraints for operations
    //             that can be executed only by specific roles. Namely CEO, CFO and COO.
    //
    //      - EtherLambosOwnership: This provides the methods required for basic non-fungible token
    //             transactions, following the draft ERC-721 spec (https://github.com/ethereum/EIPs/issues/721).
    //
    //      - EtherLambosSale: Here we have the public methods for sales. 
    //
    //      - EtherLambosBuilding: This final facet contains the functionality we use for creating new cars.
    //             

    // Set in case the core contract is broken and an upgrade is required
    address public newContractAddress;

    /// @notice Creates the main EtherLambos smart contract instance.
    function EtherLambosCore() public {
        // Starts paused.
        paused = true;

        // the creator of the contract is the initial CEO
        ceoAddress = msg.sender;

        // the creator of the contract is also the initial COO
        cooAddress = msg.sender;

        // start with the car 0 
        _createLambo(uint256(-1), address(0),0);
    }

    /// @dev Used to mark the smart contract as upgraded, in case there is a serious
    ///  breaking bug. This method does nothing but keep track of the new contract and
    ///  emit a message indicating that the new address is set. It's up to clients of this
    ///  contract to update to the new contract address in that case. (This contract will
    ///  be paused indefinitely if such an upgrade takes place.)
    /// @param _v2Address new address
    function setNewAddress(address _v2Address) external onlyCEO whenPaused {
        // See README.md for updgrade plan
        newContractAddress = _v2Address;
        ContractUpgrade(_v2Address);
    }

    /// @notice No tipping!
    /// @dev Reject all Ether from being sent here, unless it's from the marketPlace contract.
    /// (Hopefully, we can prevent user accidents.)
    function() external payable {
        require(
            msg.sender == address(marketPlace)
        );
    }

    /// @notice Returns all the relevant information about a specific lambo.
    /// @param _id The ID of the lambo of interest.
    function getLambo(uint256 _id)
        external
        view
        returns (
        uint256 buildTime,
        uint256 attributes
    ) {
        Lambo storage kit = lambos[_id];

        buildTime = uint256(kit.buildTime);
        attributes = kit.attributes;
    }
    /// @notice Returns all the relevant information about a specific lambo.
    /// @param _id The ID of the lambo of interest.
    function getLamboAttributes(uint256 _id)
        external
        view
        returns (
        uint256 attributes
    ) {
        Lambo storage kit = lambos[_id];
        attributes = kit.attributes;
        return attributes;
    }
    
    /// @notice Returns all the relevant information about a specific lambo.
    /// @param _id The ID of the lambo of interest.
    function getLamboModel(uint256 _id)
        external
        view
        returns (
        uint64 model
    ) {
        Lambo storage kit = lambos[_id];
        model = kit.model;
        return model;
    }
    /// @dev Override unpause so it requires all external contract addresses
    ///  to be set before contract can be unpaused. Also, we can't have
    ///  newContractAddress set either, because then the contract was upgraded.
    /// @notice This is public rather than external so we can call super.unpause
    ///  without using an expensive CALL.
    function unpause() public onlyCEO whenPaused {
        require(marketPlace != address(0));
        require(serviceStation != address(0));
        require(newContractAddress == address(0));

        // Actually unpause the contract.
        super.unpause();
    }

    // @dev Allows the CFO to capture the balance available to the contract.
    function withdrawBalance() external onlyCFO {
        uint256 balance = this.balance;
        cfoAddress.send(balance);
     
    }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[{"name":"_interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"cfoAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"},{"name":"_preferredTransport","type":"string"}],"name":"tokenMetadata","outputs":[{"name":"infoUrl","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lambosTuneCount","outputs":[{"name":"","type":"uint256"}],"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":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_attributes","type":"uint256"},{"name":"_owner","type":"address"},{"name":"_model","type":"uint64"}],"name":"createLambo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"ceoAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"serviceStation","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newCEO","type":"address"}],"name":"setCEO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newCOO","type":"address"}],"name":"setCOO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"marketPlace","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newattributes","type":"uint256"},{"name":"_tokenId","type":"uint256"}],"name":"tuneLambo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"lamboIndexToApproved","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint256"}],"name":"getLamboAttributes","outputs":[{"name":"attributes","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_address","type":"address"}],"name":"setServicestationAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newCFO","type":"address"}],"name":"setCFO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"secs","type":"uint256"}],"name":"setSecondsPerBlock","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawBalance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"name":"owner","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"newContractAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"count","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawTuneBalances","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_v2Address","type":"address"}],"name":"setNewAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"secondsPerBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"name":"ownerTokens","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawSaleBalances","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint256"}],"name":"getLamboModel","outputs":[{"name":"model","type":"uint64"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"cooAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_price","type":"uint256"},{"name":"_tokenIdStart","type":"uint256"},{"name":"_tokenCount","type":"uint256"}],"name":"bulkCreateLamboSale","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"lamboIndexToOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_address","type":"address"}],"name":"setMarketplaceAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"erc721Metadata","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_carId","type":"uint256"},{"name":"_price","type":"uint256"}],"name":"createLamboSale","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_contractAddress","type":"address"}],"name":"setMetadataAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint256"}],"name":"getLambo","outputs":[{"name":"buildTime","type":"uint256"},{"name":"attributes","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_attributes","type":"uint256"},{"name":"_owner","type":"address"},{"name":"_model","type":"uint64"},{"name":"count","type":"uint256"},{"name":"startNo","type":"uint256"}],"name":"bulkCreateLambo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"lambosBuildCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"from","type":"address"},{"indexed":false,"name":"to","type":"address"},{"indexed":false,"name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"approved","type":"address"},{"indexed":false,"name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"lamboId","type":"uint256"},{"indexed":false,"name":"attributes","type":"uint256"}],"name":"Build","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_newattributes","type":"uint256"},{"indexed":false,"name":"_tokenId","type":"uint256"}],"name":"Tune","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newContract","type":"address"}],"name":"ContractUpgrade","type":"event"}]

60606040526000600260146101000a81548160ff021916908315150217905550600f60035534156200003057600080fd5b6001600260146101000a81548160ff021916908315150217905550336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506200010e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600080620001156401000000000262003042176401000000009004565b5062000578565b600062000121620004ad565b60006060604051908101604052808781526020014267ffffffffffffffff1681526020018567ffffffffffffffff1681525091506001600480548060010182816200016d9190620004e3565b916000526020600020906002020160008590919091506000820151816000015560208201518160010160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160010160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555050500390508063ffffffff16811415156200020557600080fd5b7f26762795cda5552a98dbf495f5525efb05f3d55c5764fa0c6cfaa27150fe180785828460000151604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a16200029e60008683620002aa6401000000000262003228176401000000009004565b80925050509392505050565b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505550816005600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415156200040957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001900391905055506007600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef838383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1505050565b60606040519081016040528060008152602001600067ffffffffffffffff168152602001600067ffffffffffffffff1681525090565b815481835581811511620005135760020281600202836000526020600020918201910162000512919062000518565b5b505050565b6200057591905b8082111562000571576000808201600090556001820160006101000a81549067ffffffffffffffff02191690556001820160086101000a81549067ffffffffffffffff0219169055506002016200051f565b5090565b90565b6136b480620005886000396000f300606060405260043610610225576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301ffc9a7146102835780630519ce79146102dd5780630560ff44146103325780630668f649146103e257806306fdde031461040b578063095ea7b31461049957806309ca60c1146104db5780630a0f81681461053057806312df2f491461058557806318160ddd146105da57806323b872dd1461060357806327d7874c146106645780632ba73c151461069d5780632e25d2a6146106d6578063313138e11461072b57806331e0900c1461075757806335347560146107ba5780633f4ba83a146107f15780634a4d9b00146108065780634e0a33791461083f5780635663896e146108785780635c975abb1461089b5780635fd8c710146108c85780636352211e146108dd5780636af04a571461094057806370a082311461099557806370ff6325146109e257806371587988146109f75780637a7d493714610a305780638456cb5914610a595780638462151c14610a6e5780638601332214610afc57806395d89b4114610b11578063a080c8ba14610b9f578063a9059cbb14610bea578063b047fb5014610c2c578063b34d471d14610c81578063b38697f614610cb6578063b47cc55614610d19578063bc4006f514610d52578063cfe7e7a014610da7578063e17b25af14610dd3578063efbbbd6514610e0c578063f28f0f6a14610e4a578063f92561f314610eb1575b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561028157600080fd5b005b341561028e57600080fd5b6102c360048080357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916906020019091905050610eda565b604051808215151515815260200191505060405180910390f35b34156102e857600080fd5b6102f06111eb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561033d57600080fd5b61036760048080359060200190919080359060200190820180359060200191909192905050611211565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a757808201518184015260208101905061038c565b50505050905090810190601f1680156103d45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103ed57600080fd5b6103f561137c565b6040518082815260200191505060405180910390f35b341561041657600080fd5b61041e611382565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561045e578082015181840152602081019050610443565b50505050905090810190601f16801561048b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104a457600080fd5b6104d9600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506113bb565b005b34156104e657600080fd5b61052e600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803567ffffffffffffffff16906020019091905050611499565b005b341561053b57600080fd5b610543611579565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561059057600080fd5b61059861159e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105e557600080fd5b6105ed6115c4565b6040518082815260200191505060405180910390f35b341561060e57600080fd5b610662600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506115d4565b005b341561066f57600080fd5b61069b600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506116a1565b005b34156106a857600080fd5b6106d4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061177b565b005b34156106e157600080fd5b6106e9611856565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561073657600080fd5b610755600480803590602001909190803590602001909190505061187c565b005b341561076257600080fd5b61077860048080359060200190919050506118f8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156107c557600080fd5b6107db600480803590602001909190505061192b565b6040518082815260200191505060405180910390f35b34156107fc57600080fd5b61080461195d565b005b341561081157600080fd5b61083d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611af6565b005b341561084a57600080fd5b610876600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c2d565b005b341561088357600080fd5b6108996004808035906020019091905050611d08565b005b34156108a657600080fd5b6108ae611e1d565b604051808215151515815260200191505060405180910390f35b34156108d357600080fd5b6108db611e30565b005b34156108e857600080fd5b6108fe6004808035906020019091905050611f03565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561094b57600080fd5b610953611f7c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156109a057600080fd5b6109cc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611fa2565b6040518082815260200191505060405180910390f35b34156109ed57600080fd5b6109f5611feb565b005b3415610a0257600080fd5b610a2e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612191565b005b3415610a3b57600080fd5b610a436122ae565b6040518082815260200191505060405180910390f35b3415610a6457600080fd5b610a6c6122b4565b005b3415610a7957600080fd5b610aa5600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506123f8565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610ae8578082015181840152602081019050610acd565b505050509050019250505060405180910390f35b3415610b0757600080fd5b610b0f61252f565b005b3415610b1c57600080fd5b610b246126d5565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610b64578082015181840152602081019050610b49565b50505050905090810190601f168015610b915780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610baa57600080fd5b610bc0600480803590602001909190505061270e565b604051808267ffffffffffffffff1667ffffffffffffffff16815260200191505060405180910390f35b3415610bf557600080fd5b610c2a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050612754565b005b3415610c3757600080fd5b610c3f612868565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610c8c57600080fd5b610cb4600480803590602001909190803590602001909190803590602001909190505061288e565b005b3415610cc157600080fd5b610cd76004808035906020019091905050612a33565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610d2457600080fd5b610d50600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612a66565b005b3415610d5d57600080fd5b610d65612b9d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610db257600080fd5b610dd16004808035906020019091908035906020019091905050612bc3565b005b3415610dde57600080fd5b610e0a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612d04565b005b3415610e1757600080fd5b610e2d6004808035906020019091905050612da3565b604051808381526020018281526020019250505060405180910390f35b3415610e5557600080fd5b610eaf600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803567ffffffffffffffff16906020019091908035906020019091908035906020019091905050612df9565b005b3415610ebc57600080fd5b610ec4612f22565b6040518082815260200191505060405180910390f35b600060405180807f737570706f727473496e74657266616365286279746573342900000000000000815250601901905060405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806111e4575060405180807f746f6b656e4d657461646174612875696e743235362c737472696e6729000000815250601d019050604051809103902060405180807f746f6b656e734f664f776e6572286164647265737329000000000000000000008152506016019050604051809103902060405180807f7472616e7366657246726f6d28616464726573732c616464726573732c75696e81526020017f74323536290000000000000000000000000000000000000000000000000000008152506025019050604051809103902060405180807f7472616e7366657228616464726573732c75696e7432353629000000000000008152506019019050604051809103902060405180807f617070726f766528616464726573732c75696e743235362900000000000000008152506018019050604051809103902060405180807f6f776e65724f662875696e7432353629000000000000000000000000000000008152506010019050604051809103902060405180807f62616c616e63654f6628616464726573732900000000000000000000000000008152506012019050604051809103902060405180807f746f74616c537570706c79282900000000000000000000000000000000000000815250600d019050604051809103902060405180807f73796d626f6c28290000000000000000000000000000000000000000000000008152506008019050604051809103902060405180807f6e616d6528290000000000000000000000000000000000000000000000000000815250600601905060405180910390201818181818181818187bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611219613570565b611221613584565b60008073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561128057600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cb4799f2878787600060405160a001526040518463ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180848152602001806020018281038252848482818152602001925080828437820191505094505050505060a060405180830381600087803b151561133b57600080fd5b6102c65a03f1151561134c57600080fd5b5050506040518060800180519060200160405280925081935050506113718282612f28565b925050509392505050565b600c5481565b6040805190810160405280600b81526020017f45746865724c616d626f7300000000000000000000000000000000000000000081525081565b600260149054906101000a900460ff161515156113d757600080fd5b6113e13382612f80565b15156113ec57600080fd5b6113f68183612fec565b7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925338383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a15050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114f757600080fd5b829050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561155557600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b600b60008154809291906001019190505550611572848284613042565b5050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160048054905003905090565b600260149054906101000a900460ff161515156115f057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561162c57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561166757600080fd5b61167133826131bc565b151561167c57600080fd5b6116868382612f80565b151561169157600080fd5b61169c838383613228565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116fc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561173857600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117d657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561181257600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118d857600080fd5b600c600081548092919060010191905055506118f4828261342a565b5050565b60076020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060048381548110151561193d57fe5b906000526020600020906002020190508060000154915081915050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119b857600080fd5b600260149054906101000a900460ff1615156119d357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515611a3157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515611a8f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611aec57600080fd5b611af4613492565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b5357600080fd5b8190508073ffffffffffffffffffffffffffffffffffffffff166325746a7d6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515611bc257600080fd5b6102c65a03f11515611bd357600080fd5b505050604051805190501515611be857600080fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c8857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611cc457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611db057506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80611e085750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611e1357600080fd5b8060038190555050565b600260149054906101000a900460ff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e8e57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff16319050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050505050565b60006005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611f7757600080fd5b919050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061209357506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806120eb5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156120f657600080fd5b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635fd8c7106040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b151561217b57600080fd5b6102c65a03f1151561218c57600080fd5b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156121ec57600080fd5b600260149054906101000a900460ff16151561220757600080fd5b80600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f450db8da6efbe9c22f2347f7c2021231df1fc58d3ae9a2fa75d39fa44619930581604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b60035481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061235c57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806123b45750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156123bf57600080fd5b600260149054906101000a900460ff161515156123db57600080fd5b6001600260146101000a81548160ff021916908315150217905550565b6124006135af565b600061240a6135af565b600080600061241887611fa2565b9450600085141561244a5760006040518059106124325750595b90808252806020026020018201604052509550612525565b846040518059106124585750595b908082528060200260200182016040525093506124736115c4565b925060009150600190505b8281111515612521578673ffffffffffffffffffffffffffffffffffffffff166005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612514578084838151811015156124fd57fe5b906020019060200201818152505081806001019250505b808060010191505061247e565b8395505b5050505050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806125d757506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b8061262f5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561263a57600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635fd8c7106040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b15156126bf57600080fd5b6102c65a03f115156126d057600080fd5b505050565b6040805190810160405280600281526020017f454c00000000000000000000000000000000000000000000000000000000000081525081565b60008060048381548110151561272057fe5b906000526020600020906002020190508060010160089054906101000a900467ffffffffffffffff16915081915050919050565b600260149054906101000a900460ff1615151561277057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156127ac57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156127e757600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561284457600080fd5b61284e3382612f80565b151561285957600080fd5b612864338383613228565b5050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156128ec57600080fd5b600090505b81811015612a2d5761290533828501612f80565b151561291057600080fd5b61293e818401600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612fec565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663995cd65382850186336040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019350505050600060405180830381600087803b1515612a0c57600080fd5b6102c65a03f11515612a1d57600080fd5b50505080806001019150506128f1565b50505050565b60056020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612ac357600080fd5b8190508073ffffffffffffffffffffffffffffffffffffffff1663f4b86c486000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515612b3257600080fd5b6102c65a03f11515612b4357600080fd5b505050604051805190501515612b5857600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260149054906101000a900460ff16151515612bdf57600080fd5b612be93383612f80565b1515612bf457600080fd5b612c2082600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612fec565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663995cd6538383336040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019350505050600060405180830381600087803b1515612cec57600080fd5b6102c65a03f11515612cfd57600080fd5b5050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612d5f57600080fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806000600484815481101515612db757fe5b906000526020600020906002020190508060010160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1692508060000154915050915091565b6000806000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612e5a57600080fd5b869250879150600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612ebb57600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692505b600090505b84811015612f1857600b600081548092919060010191905055507b097edd871cfda3a5697758bf0e3cbb5ac5741c6400000000000000008185010288019150612f0a828488613042565b508080600101915050612ec0565b5050505050505050565b600b5481565b612f30613570565b612f38613570565b60008084604051805910612f495750595b9080825280601f01601f19166020018201604052509250602083019150859050612f74828287613525565b82935050505092915050565b60008273ffffffffffffffffffffffffffffffffffffffff166005600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b806007600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b600061304c6135c3565b60006060604051908101604052808781526020014267ffffffffffffffff1681526020018567ffffffffffffffff16815250915060016004805480600101828161309691906135f9565b916000526020600020906002020160008590919091506000820151816000015560208201518160010160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160010160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555050500390508063ffffffff168114151561312d57600080fd5b7f26762795cda5552a98dbf495f5525efb05f3d55c5764fa0c6cfaa27150fe180785828460000151604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a16131b060008683613228565b80925050509392505050565b60008273ffffffffffffffffffffffffffffffffffffffff166007600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505550816005600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151561338657600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001900391905055506007600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef838383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1505050565b8160048281548110151561343a57fe5b9060005260206000209060020201600001819055507f272448c13d10252513897c38c25bf3b0384e3fb8060c7acf11a39696894ffd878183604051808381526020018281526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156134ed57600080fd5b600260149054906101000a900460ff16151561350857600080fd5b6000600260146101000a81548160ff021916908315150217905550565b60005b60208210151561354d5782518452602084019350602083019250602082039150613528565b6001826020036101000a0390508019835116818551168181178652505050505050565b602060405190810160405280600081525090565b6080604051908101604052806004905b60008019168152602001906001900390816135945790505090565b602060405190810160405280600081525090565b60606040519081016040528060008152602001600067ffffffffffffffff168152602001600067ffffffffffffffff1681525090565b81548183558181151161362657600202816002028360005260206000209182019101613625919061362b565b5b505050565b61368591905b80821115613681576000808201600090556001820160006101000a81549067ffffffffffffffff02191690556001820160086101000a81549067ffffffffffffffff021916905550600201613631565b5090565b905600a165627a7a723058203f5a39911159de7c11a04261251bf63c9fed76eed8dd55cafbad0bf4ba2829630029

Swarm Source

bzzr://3f5a39911159de7c11a04261251bf63c9fed76eed8dd55cafbad0bf4ba282963
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.