interface ISimpleMarketplace {
    /**
     * @dev Emitted when a bundle is created and includes the contractAddress, 
     * tokenIds involved in the bundle, the price, and the creatorAddress who needs 
     * to own the tokens as well as receive the majority of the proceeds of the sale.
     */
    event BundleCreated(
        uint256 bundleId, 
        address contractAddress, 
        address creatorAddress, 
        uint256[] tokenIds, 
        uint256 price
    );

    /**
     * @dev Emitted when a created bundle is withdrawn from the marketplace
     * and can no longer be bought.
     */
    event BundleWithdrawn(uint256 bundleId);

    /**
     * @dev Emitted when a created bundle is sold from the marketplace and 
     * the related tokens have successfully transferred to the buyer.
     */
    event BundleBought(uint256 bundleId);

    /**
     * @dev Information that the marketplace needs in order to put a bundle of
     * tokens relating to a contract up for sale
     *
     * Requirements:
     * - contractAddress must support IERC721
     * - sender must be contractAddress or creatorAddress
     * - creatorAddress must grant this contract permission
     * - bundle cannot exceed a certain size
     * - price must be valid (at least 0.000001 ETH)
     */
    function sellBundle(
        address contractAddress, 
        address creatorAddress, 
        uint256[] memory tokenIds, 
        uint256 price
    ) external;

    /**
     * @dev Returns the bundleId that a specific token belongs to. Will throw
     * if token is not part of a bundle.
     */
    function getBundleId(address contractAddress, uint256 tokenId) external view returns (uint256);

    /**
     * @dev Because token ownership can change outside the marketplace contract, a created bundled
     * that is not withdrawn or bought cannot determine alone if the bundle is still buyable.
     * 
     * This function will check if the owner still has the tokens for a bundle and if this marketplace
     * still has the permissions to transfer the tokens.
     */
    function isBuyable(uint256 bundleId) external view returns (bool);

    /**
     * @dev Allows a bundle to be taken off the market and can no longer by bought by buyBundle.
     * The bundle is deleted in the process.
     *
     * Can only be called by the contract or creator who is marked on the bundleId.
     */
    function withdrawBundle(uint256 bundleId) external;

    /**
     * @dev Allows any user to buy a bundle of tokens and will be transferred from
     * the creatorAddress into the payer's address. The bundle is deleted after the transfer.
     *
     * Requirements:
     * - buyerAddress must be a safeTransfer location
     * - creatorAddress still has all the tokenIds in the bundle
     */
    function buyBundle(uint256 bundleId) external payable;
}
/**
 * @dev Required interface of a SimpleMarketplace that sells bundles
 */
function sellBundle(
    address contractAddress, 
    address creatorAddress, 
    uint256[] memory tokenIds, 
    uint256 price
) external;

/**
 * @dev Information that the marketplace needs in order to put a bundle of
 * tokens relating to a contract up for sale
 *
 * Requirements:
 * - contractAddress must support IERC721
 * - sender must be contractAddress or creatorAddress
 * - creatorAddress must grant this contract permission
 * - bundle cannot exceed a certain size
 * - price must be valid (at least 0.000001 ETH)
 */