Contract 0x51b5e223042c7e44736661e7f496e8cf7a879a5d

TxHash Block Age From To Value [TxFee]
0xef7c5c4d9c59729409f041d01f6a22e241213f1ce8bc9f415625a96864a7d75a3751944230 days 17 hrs ago0x35d803f11e900fb6300946b525f0d08d1ffd4bed IN  0x51b5e223042c7e44736661e7f496e8cf7a879a5d0 Ether0.000125535
0x83ab83d00995c526a03e352596fdf013292b6b6972c2c33e8b3c8e25171ab26b3750807230 days 20 hrs ago0x35d803f11e900fb6300946b525f0d08d1ffd4bed IN  0x51b5e223042c7e44736661e7f496e8cf7a879a5d0 Ether0.00114746
0xf81f39e8e1d2587b907051b1d768aee6481987121eaaff1e01aab9dcff68be683741571232 days 13 hrs ago0x225bea75d0b4c0686597097d28d81db86b42ee78 IN  Contract Creation0 Ether0.027689288
[ Download CSV Export 

Latest 25 internal transaction, Click here to view more Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value
0x0f117a3df6e57a9c45e8aac4f182857504483752fa9ccbf259c61b04f0f0082b3802554222 days 18 hrs ago0x51b5e223042c7e44736661e7f496e8cf7a879a5d0xbee217bfe06c6faaa2d5f2e06ebb84c5fb70d9bf0 Ether
0x0f117a3df6e57a9c45e8aac4f182857504483752fa9ccbf259c61b04f0f0082b3802554222 days 18 hrs ago0x51b5e223042c7e44736661e7f496e8cf7a879a5d0xbee217bfe06c6faaa2d5f2e06ebb84c5fb70d9bf0 Ether
0x0f117a3df6e57a9c45e8aac4f182857504483752fa9ccbf259c61b04f0f0082b3802554222 days 18 hrs ago0x51b5e223042c7e44736661e7f496e8cf7a879a5d0xbee217bfe06c6faaa2d5f2e06ebb84c5fb70d9bf0 Ether
0x0f117a3df6e57a9c45e8aac4f182857504483752fa9ccbf259c61b04f0f0082b3802554222 days 18 hrs ago0x51b5e223042c7e44736661e7f496e8cf7a879a5d0xbee217bfe06c6faaa2d5f2e06ebb84c5fb70d9bf0 Ether
0x0f117a3df6e57a9c45e8aac4f182857504483752fa9ccbf259c61b04f0f0082b3802554222 days 18 hrs ago0x25fd4f5460053fa8e5d7d48360292577c9cd6f420x51b5e223042c7e44736661e7f496e8cf7a879a5d0 Ether
0x0f117a3df6e57a9c45e8aac4f182857504483752fa9ccbf259c61b04f0f0082b3802554222 days 18 hrs ago0x25fd4f5460053fa8e5d7d48360292577c9cd6f420x51b5e223042c7e44736661e7f496e8cf7a879a5d0 Ether
0xbfce75c94025e747ab65550c4d092fb87243d8f52be62d32e7160bcf98f505a23791184224 days 17 hrs ago0x51b5e223042c7e44736661e7f496e8cf7a879a5d0xbee217bfe06c6faaa2d5f2e06ebb84c5fb70d9bf0 Ether
0xbfce75c94025e747ab65550c4d092fb87243d8f52be62d32e7160bcf98f505a23791184224 days 17 hrs ago0x51b5e223042c7e44736661e7f496e8cf7a879a5d0xbee217bfe06c6faaa2d5f2e06ebb84c5fb70d9bf0 Ether
0xbfce75c94025e747ab65550c4d092fb87243d8f52be62d32e7160bcf98f505a23791184224 days 17 hrs ago0x25fd4f5460053fa8e5d7d48360292577c9cd6f420x51b5e223042c7e44736661e7f496e8cf7a879a5d0 Ether
0xbfce75c94025e747ab65550c4d092fb87243d8f52be62d32e7160bcf98f505a23791184224 days 17 hrs ago0x25fd4f5460053fa8e5d7d48360292577c9cd6f420x51b5e223042c7e44736661e7f496e8cf7a879a5d0 Ether
0x9f8e494c483709e99f9e2790b61342212c857f5a63272b5ddbd73b682af9e92e3759323229 days 16 hrs ago0x51b5e223042c7e44736661e7f496e8cf7a879a5d0xbee217bfe06c6faaa2d5f2e06ebb84c5fb70d9bf0 Ether
0x9f8e494c483709e99f9e2790b61342212c857f5a63272b5ddbd73b682af9e92e3759323229 days 16 hrs ago0x51b5e223042c7e44736661e7f496e8cf7a879a5d0xbee217bfe06c6faaa2d5f2e06ebb84c5fb70d9bf0 Ether
0x9f8e494c483709e99f9e2790b61342212c857f5a63272b5ddbd73b682af9e92e3759323229 days 16 hrs ago0x51b5e223042c7e44736661e7f496e8cf7a879a5d0xbee217bfe06c6faaa2d5f2e06ebb84c5fb70d9bf0 Ether
0x9f8e494c483709e99f9e2790b61342212c857f5a63272b5ddbd73b682af9e92e3759323229 days 16 hrs ago0x51b5e223042c7e44736661e7f496e8cf7a879a5d0xbee217bfe06c6faaa2d5f2e06ebb84c5fb70d9bf0 Ether
0x9f8e494c483709e99f9e2790b61342212c857f5a63272b5ddbd73b682af9e92e3759323229 days 16 hrs ago0x25fd4f5460053fa8e5d7d48360292577c9cd6f420x51b5e223042c7e44736661e7f496e8cf7a879a5d0 Ether
0x9f8e494c483709e99f9e2790b61342212c857f5a63272b5ddbd73b682af9e92e3759323229 days 16 hrs ago0x25fd4f5460053fa8e5d7d48360292577c9cd6f420x51b5e223042c7e44736661e7f496e8cf7a879a5d0 Ether
0x9ff3f2a5200c0a4e28220c046a954fc9413de8360fc0f71669baad387455e5223752956230 days 15 hrs ago0x51b5e223042c7e44736661e7f496e8cf7a879a5d0xbee217bfe06c6faaa2d5f2e06ebb84c5fb70d9bf0 Ether
0x9ff3f2a5200c0a4e28220c046a954fc9413de8360fc0f71669baad387455e5223752956230 days 15 hrs ago0x51b5e223042c7e44736661e7f496e8cf7a879a5d0xbee217bfe06c6faaa2d5f2e06ebb84c5fb70d9bf0 Ether
0x9ff3f2a5200c0a4e28220c046a954fc9413de8360fc0f71669baad387455e5223752956230 days 15 hrs ago0x25fd4f5460053fa8e5d7d48360292577c9cd6f420x51b5e223042c7e44736661e7f496e8cf7a879a5d0 Ether
0x9ff3f2a5200c0a4e28220c046a954fc9413de8360fc0f71669baad387455e5223752956230 days 15 hrs ago0x51b5e223042c7e44736661e7f496e8cf7a879a5d0xbee217bfe06c6faaa2d5f2e06ebb84c5fb70d9bf0 Ether
0x9ff3f2a5200c0a4e28220c046a954fc9413de8360fc0f71669baad387455e5223752956230 days 15 hrs ago0x51b5e223042c7e44736661e7f496e8cf7a879a5d0xbee217bfe06c6faaa2d5f2e06ebb84c5fb70d9bf0 Ether
0x9ff3f2a5200c0a4e28220c046a954fc9413de8360fc0f71669baad387455e5223752956230 days 15 hrs ago0x25fd4f5460053fa8e5d7d48360292577c9cd6f420x51b5e223042c7e44736661e7f496e8cf7a879a5d0 Ether
0x9ff3f2a5200c0a4e28220c046a954fc9413de8360fc0f71669baad387455e5223752956230 days 15 hrs ago0x25fd4f5460053fa8e5d7d48360292577c9cd6f420x51b5e223042c7e44736661e7f496e8cf7a879a5d0 Ether
0xe6db7b97f0e17bcb25eaeaa2313c9056c82cd82466b219bd861854fe97e80ea93752906230 days 15 hrs ago0x51b5e223042c7e44736661e7f496e8cf7a879a5d0xbee217bfe06c6faaa2d5f2e06ebb84c5fb70d9bf0 Ether
0xe6db7b97f0e17bcb25eaeaa2313c9056c82cd82466b219bd861854fe97e80ea93752906230 days 15 hrs ago0x51b5e223042c7e44736661e7f496e8cf7a879a5d0xbee217bfe06c6faaa2d5f2e06ebb84c5fb70d9bf0 Ether
[ Download CSV Export 
Warning: The compiled contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) Solidity Compiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: Bundle
Compiler Version: v0.4.24+commit.e67f0147
Optimization Enabled: No
Runs (Optimizer):  200


Contract Source Code
pragma solidity ^0.4.24;

contract Ownable {
    address public owner;

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

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

    /**
        @dev Transfers the ownership of the contract.

        @param _to Address of the new owner
    */
    function transferTo(address _to) public onlyOwner returns (bool) {
        require(_to != address(0));
        owner = _to;
        return true;
    } 
} 

contract BytesUtils {
    function readBytes32(bytes data, uint256 index) internal pure returns (bytes32 o) {
        require(data.length / 32 > index);
        assembly {
            o := mload(add(data, add(32, mul(32, index))))
        }
    }
}

interface IERC721Receiver {
    function onERC721Received(
        address _oldOwner,
        uint256 _tokenId,
        bytes   _userData
    ) external returns (bytes4);
}

library SafeMath {
    function add(uint256 x, uint256 y) internal pure returns(uint256) {
        uint256 z = x + y;
        require((z >= x) && (z >= y));
        return z;
    }

    function sub(uint256 x, uint256 y) internal pure returns(uint256) {
        require(x >= y);
        uint256 z = x - y;
        return z;
    }

    function mult(uint256 x, uint256 y) internal pure returns(uint256) {
        uint256 z = x * y;
        require((x == 0)||(z/x == y));
        return z;
    }
}

contract ERC721Base {
    using SafeMath for uint256;

    uint256 private _count;

    mapping(uint256 => address) private _holderOf;
    mapping(address => uint256[]) private _assetsOf;
    mapping(address => mapping(address => bool)) private _operators;
    mapping(uint256 => address) private _approval;
    mapping(uint256 => uint256) private _indexOfAsset;

    event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
    event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
    event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);

    //
    // Global Getters
    //

    /**
     * @dev Gets the total amount of assets stored by the contract
     * @return uint256 representing the total amount of assets
     */
    function totalSupply() external view returns (uint256) {
        return _totalSupply();
    }
    function _totalSupply() internal view returns (uint256) {
        return _count;
    }

    //
    // Asset-centric getter functions
    //

    /**
     * @dev Queries what address owns an asset. This method does not throw.
     * In order to check if the asset exists, use the `exists` function or check if the
     * return value of this call is `0`.
     * @return uint256 the assetId
     */
    function ownerOf(uint256 assetId) external view returns (address) {
        return _ownerOf(assetId);
    }
    function _ownerOf(uint256 assetId) internal view returns (address) {
        return _holderOf[assetId];
    }

    function assetsOf(address owner) external view returns (uint256[]) {
        return _assetsOf[owner];
    }

    /// @notice Enumerate NFTs assigned to an owner
    /// @dev Throws if `_index` >= `balanceOf(_owner)` or if
    ///  `_owner` is the zero address, representing invalid NFTs.
    /// @param _owner An address where we are interested in NFTs owned by them
    /// @param _index A counter less than `balanceOf(_owner)`
    /// @return The token identifier for the `_index`th NFT assigned to `_owner`,
    ///   (sort order not specified)
    function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256) {
        return _assetsOf[_owner][_index];
    }

    //
    // Holder-centric getter functions
    //
    /**
     * @dev Gets the balance of the specified address
     * @param owner address to query the balance of
     * @return uint256 representing the amount owned by the passed address
     */
    function balanceOf(address owner) external view returns (uint256) {
        return _balanceOf(owner);
    }
    function _balanceOf(address owner) internal view returns (uint256) {
        return _assetsOf[owner].length;
    }

    //
    // Authorization getters
    //

    /**
     * @dev Query whether an address has been authorized to move any assets on behalf of someone else
     * @param operator the address that might be authorized
     * @param assetHolder the address that provided the authorization
     * @return bool true if the operator has been authorized to move any assets
     */
    function isApprovedForAll(address operator, address assetHolder)
        external view returns (bool)
    {
        return _isApprovedForAll(operator, assetHolder);
    }
    function _isApprovedForAll(address operator, address assetHolder)
        internal view returns (bool)
    {
        return _operators[assetHolder][operator];
    }

    /**
     * @dev Query what address has been particularly authorized to move an asset
     * @param assetId the asset to be queried for
     * @return bool true if the asset has been approved by the holder
     */
    function getApprovedAddress(uint256 assetId) external view returns (address) {
        return _getApprovedAddress(assetId);
    }
    function _getApprovedAddress(uint256 assetId) internal view returns (address) {
        return _approval[assetId];
    }

    /**
     * @dev Query if an operator can move an asset.
     * @param operator the address that might be authorized
     * @param assetId the asset that has been `approved` for transfer
     * @return bool true if the asset has been approved by the holder
     */
    function isAuthorized(address operator, uint256 assetId) external view returns (bool) {
        return _isAuthorized(operator, assetId);
    }
    function _isAuthorized(address operator, uint256 assetId) internal view returns (bool){
        require(operator != 0);
        address owner = _ownerOf(assetId);
        if (operator == owner) {
            return true;
        }
        return _isApprovedForAll(operator, owner) || _getApprovedAddress(assetId) == operator;
    }

    //
    // Authorization
    //

    /**
     * @dev Authorize a third party operator to manage (send) msg.sender's asset
     * @param operator address to be approved
     * @param authorized bool set to true to authorize, false to withdraw authorization
     */
    function setApprovalForAll(address operator, bool authorized) external returns (bool) {
        return _setApprovalForAll(operator, authorized);
    }

    function _setApprovalForAll(address operator, bool authorized) internal returns (bool) {
        if (authorized) {
            require(!_isApprovedForAll(operator, msg.sender));
            _addAuthorization(operator, msg.sender);
        } else {
            require(_isApprovedForAll(operator, msg.sender));
            _clearAuthorization(operator, msg.sender);
        }
        emit ApprovalForAll(operator, msg.sender, authorized);
        return true;
    }

    function _addAuthorization(address operator, address holder) private {
        _operators[holder][operator] = true;
    }

    function _clearAuthorization(address operator, address holder) private {
        _operators[holder][operator] = false;
    }

    /**
     * @dev Authorize a third party operator to manage one particular asset
     * @param operator address to be approved
     * @param assetId asset to approve
     */
    function approve(address operator, uint256 assetId) external returns (bool) {
        address holder = _ownerOf(assetId);
        require(msg.sender == holder || _isApprovedForAll(msg.sender, holder));
        if (_getApprovedAddress(assetId) != operator) {
            _approval[assetId] = operator;
            emit Approval(holder, operator, assetId);
        }
        return true;
    }

    //
    // Internal Operations
    //

    function _addAssetTo(address to, uint256 assetId) internal {
        _holderOf[assetId] = to;

        uint256 length = _balanceOf(to);

        _assetsOf[to].push(assetId);

        _indexOfAsset[assetId] = length;

        _count = _count.add(1);
    }

    function _removeAssetFrom(address from, uint256 assetId) internal {
        uint256 assetIndex = _indexOfAsset[assetId];
        uint256 lastAssetIndex = _balanceOf(from).sub(1);
        uint256 lastAssetId = _assetsOf[from][lastAssetIndex];

        _holderOf[assetId] = 0;

        // Insert the last asset into the position previously occupied by the asset to be removed
        _assetsOf[from][assetIndex] = lastAssetId;

        // Resize the array
        _assetsOf[from][lastAssetIndex] = 0;
        _assetsOf[from].length--;

        // Remove the array if no more assets are owned to prevent pollution
        if (_assetsOf[from].length == 0) {
            delete _assetsOf[from];
        }

        // Update the index of positions for the asset
        _indexOfAsset[assetId] = 0;
        _indexOfAsset[lastAssetId] = assetIndex;

        _count = _count.sub(1);
    }

    function _clearApproval(address holder, uint256 assetId) internal {
        if (_ownerOf(assetId) == holder && _approval[assetId] != 0) {
            _approval[assetId] = 0;
            emit Approval(holder, 0, assetId);
        }
    }

    //
    // Supply-altering functions
    //

    function _generate(uint256 assetId, address beneficiary) internal {
        require(_holderOf[assetId] == 0);

        _addAssetTo(beneficiary, assetId);

        emit Transfer(0x0, beneficiary, assetId);
    }

    function _destroy(uint256 assetId) internal {
        address holder = _holderOf[assetId];
        require(holder != 0);

        _removeAssetFrom(holder, assetId);

        emit Transfer(holder, 0x0, assetId);
    }

    //
    // Transaction related operations
    //

    modifier onlyHolder(uint256 assetId) {
        require(_ownerOf(assetId) == msg.sender);
        _;
    }

    modifier onlyAuthorized(uint256 assetId) {
        require(_isAuthorized(msg.sender, assetId));
        _;
    }

    modifier isCurrentOwner(address from, uint256 assetId) {
        require(_ownerOf(assetId) == from);
        _;
    }

    /**
     * @dev Alias of `safeTransferFrom(from, to, assetId, '')`
     *
     * @param from address that currently owns an asset
     * @param to address to receive the ownership of the asset
     * @param assetId uint256 ID of the asset to be transferred
     */
    function safeTransferFrom(address from, address to, uint256 assetId) external returns (bool) {
        return _doTransferFrom(from, to, assetId, "", true);
    }

    /**
     * @dev Securely transfers the ownership of a given asset from one address to
     * another address, calling the method `onNFTReceived` on the target address if
     * there's code associated with it
     *
     * @param from address that currently owns an asset
     * @param to address to receive the ownership of the asset
     * @param assetId uint256 ID of the asset to be transferred
     * @param userData bytes arbitrary user information to attach to this transfer
     */
    function safeTransferFrom(address from, address to, uint256 assetId, bytes userData) external returns (bool) {
        return _doTransferFrom(from, to, assetId, userData, true);
    }

    /**
     * @dev Transfers the ownership of a given asset from one address to another address
     * Warning! This function does not attempt to verify that the target address can send
     * tokens.
     *
     * @param from address sending the asset
     * @param to address to receive the ownership of the asset
     * @param assetId uint256 ID of the asset to be transferred
     */
    function transferFrom(address from, address to, uint256 assetId) external returns (bool) {
        return _doTransferFrom(from, to, assetId, "", false);
    }

    function _doTransferFrom(
        address from,
        address to,
        uint256 assetId,
        bytes userData,
        bool doCheck
    )
        onlyAuthorized(assetId)
        internal
        returns (bool)
    {
        _moveToken(from, to, assetId, userData, doCheck);
        return true;
    }

    function _moveToken(
        address from,
        address to,
        uint256 assetId,
        bytes userData,
        bool doCheck
    )
        isCurrentOwner(from, assetId)
        internal
    {
        address holder = _holderOf[assetId];
        _removeAssetFrom(holder, assetId);
        _clearApproval(holder, assetId);
        _addAssetTo(to, assetId);

        if (doCheck && _isContract(to)) {
            // Equals to bytes4(keccak256("onERC721Received(address,uint256,bytes)"))
            bytes4 ERC721_RECEIVED = bytes4(0xf0b9e5ba);
            require(
                IERC721Receiver(to).onERC721Received(
                    holder, assetId, userData
                ) == ERC721_RECEIVED
            );
        }

        emit Transfer(holder, to, assetId);
    }

    /**
     * Internal function that moves an asset from one holder to another
     */

    /**
     * @dev Returns `true` if the contract implements `interfaceID` and `interfaceID` is not 0xffffffff, `false` otherwise
     * @param    _interfaceID The interface identifier, as specified in ERC-165
     */
    function supportsInterface(bytes4 _interfaceID) external view returns (bool) {

        if (_interfaceID == 0xffffffff) {
            return false;
        }
        return _interfaceID == 0x01ffc9a7 || _interfaceID == 0x80ac58cd;
    }

    //
    // Utilities
    //

    function _isContract(address addr) internal view returns (bool) {
        uint size;
        assembly { size := extcodesize(addr) }
        return size > 0;
    }
}


interface ERC721 {
    function transferFrom(address from, address to, uint256 id) external;
    function ownerOf(uint256 id) external view returns (address);
}

contract Bundle is ERC721Base, BytesUtils {
    uint256 private constant MAX_UINT256 = uint256(0) - uint256(1);

    Package[] private packages;

    event Created(address owner, uint256 id);
    event Deposit(address sender, uint256 bundle, address token, uint256 id);
    event Withdraw(address retriever, uint256 bundle, address token, uint256 id);

    struct Package {
        address[] tokens;
        uint256[] ids;
        mapping(address => mapping(uint256 => uint256)) order;
    }

    constructor() public {
        packages.length++;
    }

    modifier canWithdraw(uint256 packageId) {
        require(_isAuthorized(msg.sender, packageId), "Not authorized for withdraw");
        _;
    }

    function canDeposit(uint256 packageId) public view returns (bool) {
        return _isAuthorized(msg.sender, packageId);
    }

    /**
        @notice Get the content of a package
    */
    function content(uint256 id) external view returns (address[] tokens, uint256[] ids) {
        Package memory package = packages[id];
        tokens = package.tokens;
        ids = package.ids;
    }

    // create package
    /**
    @notice Create a empty Package in packages array
    */
    function create() public returns (uint256 id) {
        id = packages.length;
        packages.length++;
        emit Created(msg.sender, id);
        _generate(id, msg.sender);
    }

    /**
        @notice Deposit a non fungible token on a package

        @param _packageId Index of package in packages array
        @param token Token address (ERC721)
        @param tokenId Token identifier

        @return true If the operation was executed
    */
    function deposit(
        uint256 _packageId,
        ERC721 token,
        uint256 tokenId
    ) external returns (bool) {
        uint256 packageId = _packageId == 0 ? create() : _packageId;
        require(canDeposit(packageId), "Not authorized for deposit");
        return _deposit(packageId, token, tokenId);
    }

    /**
        @notice Deposit a batch of non fungible tokens on a package

        @dev The length of tokens and ids should be equal

        @param _packageId Index of package in packages array
        @param tokens Token addresses (ERC721) array
        @param ids Token identifiers array

        @return true If the operation was executed
    */
    function depositBatch(
        uint256 _packageId,
        ERC721[] tokens,
        uint256[] ids
    ) external returns (bool) {
        uint256 packageId = _packageId == 0 ? create() : _packageId;
        require(canDeposit(packageId), "Not authorized for deposit");

        require(tokens.length == ids.length);
        for (uint256 i = 0; i < ids.length; i++) {
            require(_deposit(packageId, tokens[i], ids[i]));
        }

        return true;
    }

    /**
        @notice Withdraw a non fungible token from a packag

        @param packageId Index of package in packages array
        @param token Token address (ERC721)
        @param tokenId Token identifier
        @param to address beneficiary

        @return true If the operation was executed
    */
    function withdraw(
        uint256 packageId,
        ERC721 token,
        uint256 tokenId,
        address to
    ) public canWithdraw(packageId) returns (bool) {
        return _withdraw(packageId, token, tokenId, to);
    }

    /**
        @notice Withdraw a batch of non fungible tokens from a package

        @dev The length of tokens and ids should be equal

        @param packageId Index of package in packages array
        @param tokens Token addresses (ERC721) array
        @param ids Token identifiers array
        @param to address beneficiary

        @return true If the operation was executed
    */
    function withdrawBatch(
        uint256 packageId,
        ERC721[] tokens,
        uint256[] ids,
        address to
    ) external canWithdraw(packageId) returns (bool) {
        for (uint256 i = 0; i < tokens.length; i++) {
            require(_withdraw(packageId, tokens[i], ids[i], to));
        }

        return true;
    }

    /**
        @notice Withdraw all non fungible tokens from a package

        @param packageId Index of package in packages array
        @param to address beneficiary

        @return true If the operation was executed
    */
    function withdrawAll(
        uint256 packageId,
        address to
    ) external canWithdraw(packageId) returns (bool) {
        Package storage package = packages[packageId];
        uint256 i = package.ids.length - 1;

        for (;i != MAX_UINT256; i--) {
            require(_withdraw(packageId, ERC721(package.tokens[i]), package.ids[i], to));
        }

        return true;
    }

    //
    // Internal functions
    //

    function _deposit(
        uint256 packageId,
        ERC721 token,
        uint256 tokenId
    ) internal returns (bool) {
        token.transferFrom(msg.sender, address(this), tokenId);
        require(token.ownerOf(tokenId) == address(this), "ERC721 transfer failed");

        Package storage package = packages[packageId];
        _add(package, token, tokenId);

        emit Deposit(msg.sender, packageId, token, tokenId);

        return true;
    }

    function _withdraw(
        uint256 packageId,
        ERC721 token,
        uint256 tokenId,
        address to
    ) internal returns (bool) {
        Package storage package = packages[packageId];
        _remove(package, token, tokenId);
        emit Withdraw(msg.sender, packageId, token, tokenId);

        token.transferFrom(this, to, tokenId);
        require(token.ownerOf(tokenId) == to, "ERC721 transfer failed");

        return true;
    }

    function _add(
        Package storage package,
        ERC721 token,
        uint256 id
    ) internal {
        uint256 position = package.order[token][id];
        require(!_isAsset(package, position, token, id), "Already exist");
        position = package.tokens.length;
        package.tokens.push(token);
        package.ids.push(id);
        package.order[token][id] = position;
    }

    function _remove(
        Package storage package,
        ERC721 token,
        uint256 id
    ) internal {
        uint256 delPosition = package.order[token][id];
        require(_isAsset(package, delPosition, token, id), "The token does not exist inside the package");

        // Replace item to remove with last item
        // (make the item to remove the last one)
        uint256 lastPosition = package.tokens.length - 1;
        if (lastPosition != delPosition) {
            address lastToken = package.tokens[lastPosition];
            uint256 lastId = package.ids[lastPosition];
            package.tokens[delPosition] = lastToken;
            package.ids[delPosition] = lastId;
            package.order[lastToken][lastId] = delPosition;
        }

        // Remove last position
        package.tokens.length--;
        package.ids.length--;
        delete package.order[token][id];
    }

    function _isAsset(
        Package memory package,
        uint256 position,
        address token,
        uint256 id
    ) internal pure returns (bool) {
        return position != 0 ||
            (package.ids.length != 0 && package.tokens[position] == token && package.ids[position] == id);
    }
}

Contract ABI
[{"constant":true,"inputs":[{"name":"_interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"operator","type":"address"},{"name":"assetId","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","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":"assetId","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"operator","type":"address"},{"name":"assetId","type":"uint256"}],"name":"isAuthorized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"assetsOf","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"packageId","type":"uint256"}],"name":"canDeposit","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"assetId","type":"uint256"}],"name":"safeTransferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"packageId","type":"uint256"},{"name":"to","type":"address"}],"name":"withdrawAll","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_packageId","type":"uint256"},{"name":"tokens","type":"address[]"},{"name":"ids","type":"uint256[]"}],"name":"depositBatch","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"packageId","type":"uint256"},{"name":"token","type":"address"},{"name":"tokenId","type":"uint256"},{"name":"to","type":"address"}],"name":"withdraw","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"assetId","type":"uint256"}],"name":"ownerOf","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"operator","type":"address"},{"name":"authorized","type":"bool"}],"name":"setApprovalForAll","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"packageId","type":"uint256"},{"name":"tokens","type":"address[]"},{"name":"ids","type":"uint256[]"},{"name":"to","type":"address"}],"name":"withdrawBatch","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"assetId","type":"uint256"},{"name":"userData","type":"bytes"}],"name":"safeTransferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint256"}],"name":"content","outputs":[{"name":"tokens","type":"address[]"},{"name":"ids","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_packageId","type":"uint256"},{"name":"token","type":"address"},{"name":"tokenId","type":"uint256"}],"name":"deposit","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"operator","type":"address"},{"name":"assetHolder","type":"address"}],"name":"isApprovedForAll","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"assetId","type":"uint256"}],"name":"getApprovedAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"create","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"id","type":"uint256"}],"name":"Created","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"sender","type":"address"},{"indexed":false,"name":"bundle","type":"uint256"},{"indexed":false,"name":"token","type":"address"},{"indexed":false,"name":"id","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"retriever","type":"address"},{"indexed":false,"name":"bundle","type":"uint256"},{"indexed":false,"name":"token","type":"address"},{"indexed":false,"name":"id","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_approved","type":"address"},{"indexed":false,"name":"_tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_operator","type":"address"},{"indexed":false,"name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"}]

Contract Creation Code
60806040523480156200001157600080fd5b50600680548091906001016200002891906200002f565b5062000118565b8154818355818111156200005f576003028160030283600052602060002091820191016200005e919062000064565b5b505050565b620000a791905b80821115620000a35760008082016000620000879190620000aa565b600182016000620000999190620000cd565b506003016200006b565b5090565b90565b5080546000825590600052602060002090810190620000ca9190620000f0565b50565b5080546000825590600052602060002090810190620000ed9190620000f0565b50565b6200011591905b8082111562000111576000816000905550600101620000f7565b5090565b90565b6131fd80620001286000396000f300608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301ffc9a71461012d578063095ea7b31461019157806318160ddd146101f657806323b872dd146102215780632972b0f0146102a65780632c62fa101461030b5780632f745c59146103a357806339443b8e1461040457806342842e0e146104495780634c2233a5146104ce5780634f4b470c146105335780635f0f48bd146105a85780636352211e1461063757806370a08231146106a4578063a22cb465146106fb578063a4d45dd014610762578063b88d4fde146107f7578063baa0b80614610894578063bc157ac11461095e578063e985e9c5146109cd578063eca4742a14610a48578063efc81a8c14610ab5575b600080fd5b34801561013957600080fd5b5061017760048036038101908080357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190505050610ae0565b604051808215151515815260200191505060405180910390f35b34801561019d57600080fd5b506101dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bce565b604051808215151515815260200191505060405180910390f35b34801561020257600080fd5b5061020b610d27565b6040518082815260200191505060405180910390f35b34801561022d57600080fd5b5061028c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d36565b604051808215151515815260200191505060405180910390f35b3480156102b257600080fd5b506102f1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5f565b604051808215151515815260200191505060405180910390f35b34801561031757600080fd5b5061034c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d73565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561038f578082015181840152602081019050610374565b505050509050019250505060405180910390f35b3480156103af57600080fd5b506103ee600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e0a565b6040518082815260200191505060405180910390f35b34801561041057600080fd5b5061042f60048036038101908080359060200190929190505050610e6b565b604051808215151515815260200191505060405180910390f35b34801561045557600080fd5b506104b4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e7e565b604051808215151515815260200191505060405180910390f35b3480156104da57600080fd5b5061051960048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ea7565b604051808215151515815260200191505060405180910390f35b34801561053f57600080fd5b5061058e60048036038101908080359060200190929190803590602001908201803590602001919091929391929390803590602001908201803590602001919091929391929390505050610fed565b604051808215151515815260200191505060405180910390f35b3480156105b457600080fd5b5061061d60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061111b565b604051808215151515815260200191505060405180910390f35b34801561064357600080fd5b50610662600480360381019080803590602001909291905050506111b3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106b057600080fd5b506106e5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111c5565b6040518082815260200191505060405180910390f35b34801561070757600080fd5b50610748600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506111d7565b604051808215151515815260200191505060405180910390f35b34801561076e57600080fd5b506107dd60048036038101908080359060200190929190803590602001908201803590602001919091929391929390803590602001908201803590602001919091929391929390803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111eb565b604051808215151515815260200191505060405180910390f35b34801561080357600080fd5b5061087a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019082018035906020019190919293919293905050506112ef565b604051808215151515815260200191505060405180910390f35b3480156108a057600080fd5b506108bf6004803603810190808035906020019092919050505061133c565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156109065780820151818401526020810190506108eb565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561094857808201518184015260208101905061092d565b5050505090500194505050505060405180910390f35b34801561096a57600080fd5b506109b360048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061146b565b604051808215151515815260200191505060405180910390f35b3480156109d957600080fd5b50610a2e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611519565b604051808215151515815260200191505060405180910390f35b348015610a5457600080fd5b50610a736004803603810190808035906020019092919050505061152d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610ac157600080fd5b50610aca61153f565b6040518082815260200191505060405180910390f35b600063ffffffff7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415610b355760009050610bc9565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610bc657506380ac58cd7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b90505b919050565b600080610bda836115d6565b90508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610c1c5750610c1b3382611613565b5b1515610c2757600080fd5b8373ffffffffffffffffffffffffffffffffffffffff16610c47846116a7565b73ffffffffffffffffffffffffffffffffffffffff16141515610d1c57836004600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a35b600191505092915050565b6000610d316116e4565b905090565b6000610d56848484602060405190810160405280600081525060006116ed565b90509392505050565b6000610d6b8383611720565b905092915050565b6060600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015610dfe57602002820191906000526020600020905b815481526020019060010190808311610dea575b50505050509050919050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515610e5857fe5b9060005260206000200154905092915050565b6000610e773383611720565b9050919050565b6000610e9e848484602060405190810160405280600081525060016116ed565b90509392505050565b600080600084610eb73382611720565b1515610f2b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4e6f7420617574686f72697a656420666f72207769746864726177000000000081525060200191505060405180910390fd5b600686815481101515610f3a57fe5b90600052602060002090600302019250600183600101805490500391505b600160000382141515610fe057610fc7868460000184815481101515610f7a57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168560010185815481101515610fb657fe5b9060005260206000200154886117e3565b1515610fd257600080fd5b818060019003925050610f58565b6001935050505092915050565b6000806000808814610fff5787611008565b61100761153f565b5b915061101382610e6b565b1515611087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4e6f7420617574686f72697a656420666f72206465706f73697400000000000081525060200191505060405180910390fd5b848490508787905014151561109b57600080fd5b600090505b8484905081101561110c576110f48288888481811015156110bd57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1687878581811015156110e857fe5b90506020020135611aff565b15156110ff57600080fd5b80806001019150506110a0565b60019250505095945050505050565b6000846111283382611720565b151561119c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4e6f7420617574686f72697a656420666f72207769746864726177000000000081525060200191505060405180910390fd5b6111a8868686866117e3565b915050949350505050565b60006111be826115d6565b9050919050565b60006111d082611e1a565b9050919050565b60006111e38383611e66565b905092915050565b600080876111f93382611720565b151561126d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4e6f7420617574686f72697a656420666f72207769746864726177000000000081525060200191505060405180910390fd5b600091505b878790508210156112df576112c789898985818110151561128f57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1688888681811015156112ba57fe5b90506020020135876117e3565b15156112d257600080fd5b8180600101925050611272565b6001925050509695505050505050565b600061133186868686868080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505060016116ed565b905095945050505050565b606080611347613087565b60068481548110151561135657fe5b9060005260206000209060030201604080519081016040529081600082018054806020026020016040519081016040528092919081815260200182805480156113f457602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116113aa575b505050505081526020016001820180548060200260200160405190810160405280929190818152602001828054801561144c57602002820191906000526020600020905b815481526020019060010190808311611438575b5050505050815250509050806000015192508060200151915050915091565b6000806000851461147c5784611485565b61148461153f565b5b905061149081610e6b565b1515611504576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4e6f7420617574686f72697a656420666f72206465706f73697400000000000081525060200191505060405180910390fd5b61150f818585611aff565b9150509392505050565b60006115258383611613565b905092915050565b6000611538826116a7565b9050919050565b600060068054905090506006805480919060010161155d91906130a1565b507f0ce3610e89a4bb9ec9359763f99110ed52a4abaea0b62028a1637e242ca2768b3382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a16115d38133611f26565b90565b60006001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008054905090565b6000836116fa3382611720565b151561170557600080fd5b6117128787878787611fdc565b600191505095945050505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff161415151561174957600080fd5b611752836115d6565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561179157600191506117dc565b61179b8482611613565b806117d957508373ffffffffffffffffffffffffffffffffffffffff166117c1846116a7565b73ffffffffffffffffffffffffffffffffffffffff16145b91505b5092915050565b6000806006868154811015156117f557fe5b906000526020600020906003020190506118108186866122bb565b7f457f950b75085c30ff780acd57bde642ff1316cc4aad9f286af2c1ffc4163a7833878787604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200194505050505060405180910390a18473ffffffffffffffffffffffffffffffffffffffff166323b872dd3085876040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561198e57600080fd5b505af11580156119a2573d6000803e3d6000fd5b505050508273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16636352211e866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b158015611a2c57600080fd5b505af1158015611a40573d6000803e3d6000fd5b505050506040513d6020811015611a5657600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16141515611af2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f455243373231207472616e73666572206661696c65640000000000000000000081525060200191505060405180910390fd5b6001915050949350505050565b6000808373ffffffffffffffffffffffffffffffffffffffff166323b872dd3330866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015611bd957600080fd5b505af1158015611bed573d6000803e3d6000fd5b505050503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16636352211e856040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b158015611c7757600080fd5b505af1158015611c8b573d6000803e3d6000fd5b505050506040513d6020811015611ca157600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16141515611d3d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f455243373231207472616e73666572206661696c65640000000000000000000081525060200191505060405180910390fd5b600685815481101515611d4c57fe5b90600052602060002090600302019050611d67818585612680565b7fd2f8022f659fd9c8c558f30c00fd5ee7038f7cb56da45095c3e0e7d48b3e0c4b33868686604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200194505050505060405180910390a160019150509392505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b60008115611e9357611e788333611613565b151515611e8457600080fd5b611e8e8333612946565b611eb3565b611e9d8333611613565b1515611ea857600080fd5b611eb283336129df565b5b3373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3184604051808215151515815260200191505060405180910390a36001905092915050565b60006001600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611f7e57600080fd5b611f888183612a78565b8073ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b60008086858173ffffffffffffffffffffffffffffffffffffffff16612001826115d6565b73ffffffffffffffffffffffffffffffffffffffff1614151561202357600080fd5b6001600088815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1693506120638488612b79565b61206d8488612e53565b6120778888612a78565b848015612089575061208888612f8d565b5b1561224b5763f0b9e5ba7c0100000000000000000000000000000000000000000000000000000000029250827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168873ffffffffffffffffffffffffffffffffffffffff1663f0b9e5ba868a8a6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561219657808201518184015260208101905061217b565b50505050905090810190601f1680156121c35780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b1580156121e457600080fd5b505af11580156121f8573d6000803e3d6000fd5b505050506040513d602081101561220e57600080fd5b81019080805190602001909291905050507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614151561224a57600080fd5b5b8773ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef896040518082815260200191505060405180910390a3505050505050505050565b6000806000808660020160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002054935061241387604080519081016040529081600082018054806020026020016040519081016040528092919081815260200182805480156123aa57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311612360575b505050505081526020016001820180548060200260200160405190810160405280929190818152602001828054801561240257602002820191906000526020600020905b8154815260200190600101908083116123ee575b505050505081525050858888612fa0565b15156124ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001807f54686520746f6b656e20646f6573206e6f7420657869737420696e736964652081526020017f746865207061636b61676500000000000000000000000000000000000000000081525060400191505060405180910390fd5b6001876000018054905003925083831415156125f15786600001838154811015156124d457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150866001018381548110151561251257fe5b9060005260206000200154905081876000018581548110151561253157fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080876001018581548110151561258b57fe5b9060005260206000200181905550838760020160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020819055505b8660000180548091906001900361260891906130d3565b508660010180548091906001900361262091906130ff565b508660020160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008681526020019081526020016000206000905550505050505050565b60008360020160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000205490506127d4846040805190810160405290816000820180548060200260200160405190810160405280929190818152602001828054801561276b57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311612721575b50505050508152602001600182018054806020026020016040519081016040528092919081815260200182805480156127c357602002820191906000526020600020905b8154815260200190600101908083116127af575b505050505081525050828585612fa0565b151515612849576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f416c72656164792065786973740000000000000000000000000000000000000081525060200191505060405180910390fd5b83600001805490509050836000018390806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505083600101829080600181540180825580915050906001820390600052602060002001600090919290919091505550808460020160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000208190555050505050565b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000826001600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612ad583611e1a565b9050600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020829080600181540180825580915050906001820390600052602060002001600090919290919091505550806005600084815260200190815260200160002081905550612b6e600160005461303990919063ffffffff16565b600081905550505050565b600080600060056000858152602001908152602001600020549250612bb06001612ba287611e1a565b61306690919063ffffffff16565b9150600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515612bfe57fe5b9060005260206000200154905060006001600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084815481101515612cab57fe5b90600052602060002001819055506000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481101515612d0757fe5b9060005260206000200181905550600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480919060019003612d6791906130ff565b506000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501415612dff57600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000612dfe919061312b565b5b60006005600086815260200190815260200160002081905550826005600083815260200190815260200160002081905550612e46600160005461306690919063ffffffff16565b6000819055505050505050565b8173ffffffffffffffffffffffffffffffffffffffff16612e73826115d6565b73ffffffffffffffffffffffffffffffffffffffff16148015612ee0575060006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b15612f895760006004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b5050565b600080823b905060008111915050919050565b6000808414158061302f575060008560200151511415801561300857508273ffffffffffffffffffffffffffffffffffffffff16856000015185815181101515612fe657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff16145b801561302e57508185602001518581518110151561302257fe5b90602001906020020151145b5b9050949350505050565b60008082840190508381101580156130515750828110155b151561305c57600080fd5b8091505092915050565b60008082841015151561307857600080fd5b82840390508091505092915050565b604080519081016040528060608152602001606081525090565b8154818355818111156130ce576003028160030283600052602060002091820191016130cd919061314c565b5b505050565b8154818355818111156130fa578183600052602060002091820191016130f9919061318b565b5b505050565b81548183558181111561312657818360005260206000209182019101613125919061318b565b5b505050565b5080546000825590600052602060002090810190613149919061318b565b50565b61318891905b80821115613184576000808201600061316b91906131b0565b60018201600061317b919061312b565b50600301613152565b5090565b90565b6131ad91905b808211156131a9576000816000905550600101613191565b5090565b90565b50805460008255906000526020600020908101906131ce919061318b565b505600a165627a7a723058203e8f52dbad9ad2f5909636299e3a8f6878ccfc154220909d619af2161321ea4f0029


   Swarm Source:
bzzr://3e8f52dbad9ad2f5909636299e3a8f6878ccfc154220909d619af2161321ea4f
Block Age Transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward