// File: /contracts/VIP_Factory.sol



// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// Holders of "Art Block Curated" NFTs can claim free Mandelbrot VIP Passes (1 per piece owned)
// Each VIP Pass token allows to purchase a fractal from the Mandelbrot Set Collection during the pre-sale window.
// More info on the project: 
// https://mandelbrot.fractalnft.art

/// @author: FractalSoft
/* ....................................................'''''''',,''''''''''................
   ................................................''''''''''',;c:;,,'''''''''.............
   ..........................................''''''''''''''',,,;col:;:;,'''''''''..........
   .......................................''''''''''''''''',,,,;:cdxol:;,''''''''''........
   .....................................''''''''''''''''',,,,;::coxkxc;;,,,'''''''''''.....
   ...............................'''''''''''''''''''',,,,,,:lxxxd;;xxdo:,,,'''''''''''....
   ...........................'''''''''''''''''''',,,,,,,,;;:oOo.   .cOx:;,,,,,,'''''''''..
   ........................''''''''''''''''''',,,,,,;;;;;;;::lkc     'xo:;;;;,,,,,,,'''''''
   ....................''''''''''''''''''''',,,,,:ldxxl::oddddxd,   .lxdooodl;;;;:lc,,'''''
   ..................''''''''''''''''''''',,,,,;;:oOOlldxdc;,....   ....,::oxlldddkxc,,''''
   ...............'''''''''''''''''''',,,,,,,,;;;:cxd..,,.                 .'cl,.ckx:,,''''
   ............'''''''''''',,,,,,,,,,,,,,,,,;;coddxxo'                          'odc;,,''''
   ..........''''''''''',,;:;;,,,,,,,,;,,;;;;:dOOd:'                            'loc;;;,'''
   .........''''''''''',,,:oo:::;;coc;;;;;;::lxxx:                               .:loxc,,''
   ......''''''''''''',,,;;lodkkdlxOxddoc:::cxxl'                                 .;oo:,,''
   ....''''''''''''',,,,,;;:cxOccol:,:lldxoldx;                                    :dl;,'''
   .''''''''''''',,,,,;;;;coxko.        .,okOl.                                    ,dl;,'''
   '''''''',,,,,,,,,;;loclokk;             ck,                                    .lo;,,'''
   '''',,,;;;,,;;;;;::lOkoox:               '.                                   .:l;,,,'''
   ,,;;;;:llc:cllccoxxOx,  ..     V I P            Mandelbrot Set Collection    ,c:;;,,,'''
   ',,,;;;:::;:::::clodko,,:'                                                   .,c:;,,,'''
   '''''',,,,,,,,,;;;:lxxxxOo.             .l'                                    'lc;,,'''
   ''''''''''',,,,,,,;::::cxko,.          ,x0:                                     :d:,,'''
   ..''''''''''''',,,,,,;;:clkk,.,.. ..':oxdkd.                                    ,do;,,''
   ....''''''''''''',,,,,;;:lkOddxkxodkkdlcclxo,.                                  cdc;,,''
   ......'''''''''''''',,,;odollc:lkdccc:;:::dkkl.                                .:dkc,,''
   .........'''''''''''',,;lc;;;;;;::;;;;;;;:cdOOc.                              ,ddll:,'''
   ............''''''''''',,,,,,,,,,,,,,,,;;;:okkdol,                           ;dd:;,,,'''
   .............'''''''''''''''''',,,,,,,,,,,;;:cclxx,                       .'..:xl;,,''''
   ................''''''''''''''''''''',,,,,,;;;:lkd,;oo;.              ..'lddlcokkc;,''''
   ....................'''''''''''''''''''',,,,,,:dOOkxookxoocc:,   .:cclooxd::cccdo:,'''''
   ......................''''''''''''''''''',,,,,;cccl:;:clccokd.   .ckdc:cc:;;,,;:;,''''''
   .........................'''''''''''''''''''',,,,,,,,;;;;:lkc     'xd:;;,,,,,,,''''''''.
   .............................'''''''''''''''''''',,,,,,,;:okkl;..:dkx:;,,,,''''''''''...
   .................................''''''''''''''''''',,,,,;coodkddkocc;,,,'''''''''''....
   ......................................''''''''''''''''',,,,;;:cxOdc:;,,''''''''''.......
   ..........................................''''''''''''''',,,;:odlll:,,'''''''''.........
   ..............................................'''''''''''',,;ll:;,,,'''''''''...........
   .................................................'''''''''',,;;,,''''''''''.............
   ....................................................'''''''''''''''''''.................
*/



/**
 * @title Mandelbrot VIP Dispenser
 */
contract IERC20 {
    function balanceOf(address account) public view virtual returns (uint256) {}
}

contract IVIP {
    function transfer(address _to, uint256 _value) public returns (bool) {}
}

contract VIP_Factory {     

    address constant ART_BLOCKS_ADDRESS = 0xa7d8d9ef8D8Ce8992Df33D8b8CF4Aebabd5bD270;
    address constant VIP_PASS_ADDRESS   = 0x5645E72bcBCb9f218268e5DB15F62F016f885984;
    mapping (address => uint256) claimed;
    string public name;
    string public symbol;
    

    constructor() { 
        name = "Mandelbrot VIP Dispenser";
        symbol = "MVD";
    }

    function claim(uint256 vips) public {
        uint256 art_blocks_holdings = IERC20(ART_BLOCKS_ADDRESS).balanceOf(msg.sender);
        require(art_blocks_holdings >= vips, "You don't hold enough Art Blocks!");
        require(claimed[msg.sender] + vips <= art_blocks_holdings, "You are claiming too many VIPS");
        claimed[msg.sender] = claimed[msg.sender] + vips;
        IVIP(VIP_PASS_ADDRESS).transfer(msg.sender, vips);
    }
}